-
-
Notifications
You must be signed in to change notification settings - Fork 75
publish-release: Add support to upload stable builds to GH, Steam, EGS and itch.io #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| # Log output to a file automatically. | ||
| exec > >(tee -a "out/logs/build") 2>&1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this to the three top-level scripts so that their output is logged into out/logs/{build,build-release,publish-release}. This should help validate that things worked fine, especially with screen making scrolling up a bit tricky.
| if [ -d out/windows/steam ]; then | ||
| cp out/windows/steam/godot.windows.editor.x86_64.exe ${steamdir}/godot.windows.opt.tools.64.exe | ||
| cp out/windows/steam/godot.windows.editor.x86_32.exe ${steamdir}/godot.windows.opt.tools.32.exe | ||
| sign_windows ${steamdir}/godot.windows.opt.tools.64.exe | ||
| sign_windows ${steamdir}/godot.windows.opt.tools.32.exe | ||
| unzip ${reldir}/${godot_basename}_linux.x86_64.zip -d ${steamdir}/ | ||
| unzip ${reldir}/${godot_basename}_linux.x86_32.zip -d ${steamdir}/ | ||
| mv ${steamdir}/{${godot_basename}_linux.x86_64,godot.x11.opt.tools.64} | ||
| mv ${steamdir}/{${godot_basename}_linux.x86_32,godot.x11.opt.tools.32} | ||
| unzip ${reldir}/${godot_basename}_macos.universal -d ${steamdir}/ | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we're preparing the Steam binaries to be signed (for Windows, it's a custom Steam-specific build) and with the expected names (for Linux). This is just to make it easier to copy the binaries in publish-release.sh directly.
| export GH_TOKEN=${personal_gh_token} | ||
| pushd git | ||
| # Get release details from existing godot-builds release. | ||
| release_info=$(gh release view ${godot_version} --repo godotengine/godot-builds --json name,body -q '.name, .body') | ||
| read -r RELEASE_TITLE RELEASE_DESC <<< "$release_info" | ||
|
|
||
| gh release create ${godot_version} --repo godotengine/godot --title "$RELEASE_TITLE" --notes "$RELEASE_DESC" | ||
| gh release upload ${godot_version} ${reldir}/[Gg]* ${reldir}/mono/[Gg]* | ||
| # Concatenate SHA sums. | ||
| cp ${reldir}/SHA512-SUMS.txt . | ||
| cat ${reldir}/mono/SHA512-SUMS.txt >> SHA512-SUMS.txt | ||
| gh release upload ${godot_version} SHA512-SUMS.txt | ||
| rm SHA512-SUMS.txt | ||
| popd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This copies the release info from godotengine/godot-builds and uploads it anew to godotengine/godot.
As we don't give @GodotBuilder write permissions on godotengine/godot for security, this requires one of us to get a PAT for upload. I suggest making one with 1 day expiry each time this is needed, which is why the script asks for it at the start (so it's only pasted in the terminal and not hardcoded anywhere).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to recheck this, as it didn't seem to work fully in https://github.com/godotengine/godot/releases/tag/4.4.1-stable - I've now copied the text from the godot-builds release manually, but initially the description was empty.
Also, we should handle the ${latest_stable} flag here too to make sure that only the latest stable gets flagged as latest release on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to recheck this, as it didn't seem to work fully in https://github.com/godotengine/godot/releases/tag/4.4.1-stable - I've now copied the text from the godot-builds release manually, but initially the description was empty.
Found a fix using jq.
Also, we should handle the
${latest_stable}flag here too to make sure that only the latest stable gets flagged as latest release on GitHub.
Seems like we might be able to rely on GH's default logic here:
$ gh release create --help | grep Latest
--latest Mark this release as "Latest" (default: automatic based on date and version)
Since the default is to guess, and there's no way to say "not latest", I guess we don't really have much options :D
| retry_command() { | ||
| local attempt=1 | ||
| local cmd=$1 | ||
| while [ $attempt -le $MAX_RETRIES ]; do | ||
| echo "Attempt $attempt: Running command..." | ||
| eval "$cmd" && return 0 # Success | ||
|
|
||
| echo "Command failed. Retrying in $DELAY seconds..." | ||
| sleep $DELAY | ||
| ((attempt++)) | ||
| DELAY=$((DELAY * 2)) # Exponential backoff | ||
| done | ||
|
|
||
| echo "❌ Command failed after $MAX_RETRIES attempts." | ||
| return 1 | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the web editor upload SSH connection often gets aborted by the remote server, I finally put it some retry logic. Courtesy of ChatGPT /o\
I still think this is super hacky and could be done better, but if it does the work for now, should be good.
4b38cef to
73402a1
Compare
|
For the record I've co-developed this alongside publishing 4.4.1-stable so it's tested, but oftentimes in chunks and not the full process all at once with no manual tweaks. So the real trial of fire will be 4.4.2-stable or 4.3.1-stable, whichever comes first. |
|
For uploading to the HorizonOS store, the command would be something like: ./ovr-platform-util upload-quest-build --app_id $HORIZONOS_APP_ID --age-group TEENS_AND_ADULTS --app-secret $HORIZONOS_APP_SECRET --apk ${godot_basename}_android_editor_horizonos.apk --channel $HORIZONOS_CHANNEL
You can get the Linux version of the CLI tool from here: |
This is hacked together but seems to work, tested with 4.4.1-stable.
More work would be good eventually to rely less on some adhoc configuration of Steam/EGS/godot-builds paths on our build server. We should move those configs to a Git repository (this one, or a separate one, possibly private as only us should use it), but this should be done carefully as there are some passwords involved (which should be moved to
config.sh).For now, this should be a good start though to automate some of the process.
Worth noting, for a stable release,
./publish-release.sh -lcan be used to mark the release as latest - this should only be used for the most recent supported release (e.g. 4.4.1 now, but a future 4.3.1 shouldn't be marked as stable). This controls which version of the Web editor is the default one, and whether to upload builds to EGS and itch.io (where we only maintain one version). We upload all versions to Steam as we have version branches there.Before running the script, the version bump commit and Git tag should be pushed to godotengine/godot. Not made into a GitHub Release though, this is done by the script.
After running the script, builds still need to be made live manually on Steam and EGS in their respective backends. On itch it's automatically live.