-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit 38d3ec2a6601c49886840c4bb6bf14d0c6a26807 Author: Kiri <[email protected]> Date: Sun Oct 20 17:25:38 2024 -0700 Added the thing with the stuff. commit f033327 Author: Kiri <[email protected]> Date: Sun Oct 20 17:15:15 2024 -0700 BLAH BLAH BLAH BLAH commit 311a9ff Author: Kiri <[email protected]> Date: Sun Oct 20 17:04:48 2024 -0700 I hate this. commit 915dc06 Author: Kiri <[email protected]> Date: Sun Oct 20 16:52:27 2024 -0700 Attempt again. commit 509edf0 Author: Kiri <[email protected]> Date: Sun Oct 20 16:48:35 2024 -0700 test again blaaaaaah commit 684e9b1 Author: Kiri <[email protected]> Date: Sun Oct 20 16:42:03 2024 -0700 Testing another thing. commit decab05 Author: Kiri <[email protected]> Date: Sun Oct 20 16:36:23 2024 -0700 Automation test 1. commit 26cb9e7 Author: Kiri <[email protected]> Date: Sun Oct 20 14:38:56 2024 -0700 Pre-stream build work. commit e6a128e Author: Kiri <[email protected]> Date: Sun Oct 13 18:52:42 2024 -0700 Initial (incomplete) work on build automation.
- Loading branch information
1 parent
31753d9
commit 5298a57
Showing
11 changed files
with
318 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Build | ||
|
||
# on: | ||
# push: | ||
# pull_request: | ||
# release: | ||
# types: [published] | ||
|
||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
jobs: | ||
build: | ||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository | ||
runs-on: ubuntu-latest | ||
container: debian:bookworm | ||
|
||
steps: | ||
|
||
# Create the release, I guess? | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
body: Auto generated release | ||
draft: false | ||
prerelease: false | ||
|
||
# Install git. | ||
- name: Git | ||
run: | | ||
apt-get update | ||
apt-get install -y git | ||
# check out git repository. | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
# Do the build. | ||
- name: Build | ||
run: | | ||
Build/run_this_inside_debian_container_to_build.bsh | ||
- name: Upload Assets to Release with a wildcard | ||
uses: csexton/release-asset-action@v3 | ||
with: | ||
pattern: "Build/Builds/Dist/SnekStudio_*" | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
release-url: ${{ steps.create_release.outputs.upload_url }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# FIXME: This file is kinda rough. We should probably clean it up. But we need | ||
# build automation NOW. | ||
|
||
extends SceneTree | ||
|
||
var updater : KiriPythonBuildUpdater = null | ||
var frame_count = 0 | ||
|
||
func _initialize(): | ||
pass | ||
|
||
func _process(_delta): | ||
|
||
if frame_count == 0: | ||
|
||
# Instantiate the updater. | ||
updater = load("res://addons/KiriPythonRPCWrapper/UpdateUI/PythonBuildUpdateUI.tscn").instantiate() | ||
root.add_child(updater) | ||
|
||
# Start Python downloads per-platform. | ||
updater._start_github_download("Windows") | ||
updater._start_github_download("Linux") | ||
# FIXME: MacOS. | ||
|
||
for platform in updater._current_downloads.keys(): | ||
var download_request : HTTPRequest = updater._current_downloads[platform] | ||
download_request.request_completed.connect( | ||
func(result: int, response_code: int, headers: PackedStringArray, body: PackedByteArray): | ||
if result == HTTPRequest.RESULT_SUCCESS and response_code == 200: | ||
print("Download finished (", response_code, ") for platform: ", platform) | ||
else: | ||
push_error("Download failed (", result, ") (", response_code, ") for platform: ", platform) | ||
quit(1)) | ||
|
||
# FIXME: Add MacOS. | ||
if updater._check_platform_file_ready("Windows") and \ | ||
updater._check_platform_file_ready("Linux"): | ||
|
||
# Download pip requirements. | ||
var succeeded = true | ||
if not updater.download_platform_requirements("Windows", true): | ||
succeeded = false | ||
if not updater.download_platform_requirements("Linux", true): | ||
succeeded = false | ||
# FIXME: MacOS. | ||
|
||
if not succeeded: | ||
push_error("Something went wrong!") | ||
quit(1) | ||
|
||
# We're done! Wrap it up. | ||
updater.queue_free() | ||
return true | ||
|
||
# Keep going. | ||
frame_count += 1 | ||
return false | ||
|
||
func _finalize(): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
extends SceneTree | ||
|
||
func _initialize(): | ||
var f : FileAccess = FileAccess.open("res://Build/build_vars.sh", FileAccess.WRITE) | ||
f.store_string("VERSION=" + ProjectSettings.get("application/config/version") + "\n") | ||
f.close() | ||
quit(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#!/bin/bash | ||
|
||
GODOT_RELEASE_URL="https://github.com/godotengine/godot/releases/download/4.3-stable/Godot_v4.3-stable_linux.x86_64.zip" | ||
GODOT_EXPORT_TEMPLATE_URL="https://github.com/godotengine/godot/releases/download/4.3-stable/Godot_v4.3-stable_export_templates.tpz" | ||
GODOT_EXPORT_TEMPLATE_VERSION="4.3.stable" | ||
|
||
set -e | ||
|
||
cd "$(dirname "$0")/.." | ||
pushd . | ||
|
||
# Download Godot. | ||
cd Build | ||
echo "Downloading Godot..." | ||
if [ \! -e godot.zip ]; then | ||
curl -sfL -o godot.zip "${GODOT_RELEASE_URL}" | ||
fi | ||
|
||
# Download templates. | ||
echo "Downloading export templates..." | ||
if [ \! -e godot_templates.tpz ]; then | ||
curl -sfL -o godot_templates.tpz "${GODOT_EXPORT_TEMPLATE_URL}" | ||
fi | ||
|
||
# Extract Godot. | ||
echo "Extracting Godot..." | ||
if [ \! -e GodotBinary ]; then | ||
mkdir GodotBinary | ||
fi | ||
cd GodotBinary | ||
unzip -o ../godot.zip | ||
cd .. | ||
|
||
# Extract export templates. | ||
echo "Extracting export templates..." | ||
mkdir -p "$HOME/.local/share/godot/export_templates/${GODOT_EXPORT_TEMPLATE_VERSION}" | ||
unzip -j godot_templates.tpz -d "$HOME/.local/share/godot/export_templates/${GODOT_EXPORT_TEMPLATE_VERSION}" | ||
|
||
|
||
GODOT="$(realpath "$(ls GodotBinary/*.x86_64)")" | ||
echo "Godot binary path: ${GODOT}" | ||
|
||
popd | ||
|
||
|
||
|
||
|
||
# Write out build variables and read them in. | ||
"${GODOT}" \ | ||
--disable-render-loop \ | ||
--no-header \ | ||
--headless --script \ | ||
Build/WriteBuildVars.gd | ||
source Build/build_vars.sh | ||
|
||
|
||
|
||
# We have to do this or it can't see a bunch of the classes. | ||
|
||
"${GODOT}" --headless --path . \ | ||
--import | ||
|
||
# Fetch all Python dependencies. | ||
|
||
"${GODOT}" --headless --path . \ | ||
--script Build/DownloadPythonRequirements.gd | ||
|
||
|
||
# Actually do the builds. | ||
|
||
"${GODOT}" --headless --path . \ | ||
--export-release "Linux/X11" Build/Builds/SnekStudio_Linux/snekstudio | ||
|
||
"${GODOT}" --headless --path . \ | ||
--export-debug "Windows Desktop" Build/Builds/SnekStudio_Windows/snekstudio.exe | ||
|
||
# Package them. | ||
|
||
pushd . | ||
cd Build/Builds | ||
tar czvf "SnekStudio_Linux_${VERSION}.tar.gz" SnekStudio_Linux | ||
zip -r "SnekStudio_Windows_${VERSION}.zip" SnekStudio_Windows | ||
|
||
# Make the output directory | ||
|
||
if [ \! -e Dist ]; then | ||
mkdir Dist | ||
fi | ||
|
||
# Move stuff into it. | ||
|
||
mv -f *.tar.gz *.zip Dist/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
# This is NOT a script to be run inside a container. It is a script that runs something inside a container | ||
|
||
cd "$(dirname "$0")/.." | ||
|
||
#echo "docker run -v /build:. debian" | ||
docker run --rm \ | ||
-v "$(realpath .)":/build \ | ||
debian \ | ||
"/build/Build/run_this_inside_debian_container_to_build.bsh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
cd "$(dirname "$0")" | ||
|
||
bash ./setup_debian_container.bsh | ||
|
||
bash ./build.bsh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
apt-get update | ||
|
||
apt-get install -y \ | ||
curl unzip zip libfontconfig1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.