Skip to content

Conversation

@akien-mga
Copy link
Member

@akien-mga akien-mga commented Mar 26, 2025

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 -l can 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.

@akien-mga akien-mga requested a review from Repiteo March 26, 2025 10:48
Comment on lines +12 to +13
# Log output to a file automatically.
exec > >(tee -a "out/logs/build") 2>&1
Copy link
Member Author

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.

Comment on lines +313 to +323
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
Copy link
Member Author

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.

Comment on lines 112 to 126
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
Copy link
Member Author

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).

Copy link
Member Author

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.

Copy link
Member Author

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

Comment on lines 194 to 210
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
}
Copy link
Member Author

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.

@akien-mga akien-mga force-pushed the stable-release-upload branch from 4b38cef to 73402a1 Compare March 26, 2025 12:14
@akien-mga
Copy link
Member Author

akien-mga commented Mar 26, 2025

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.

@dsnopek
Copy link

dsnopek commented Mar 26, 2025

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
  • The $HORIZONOS_APP_ID and $HORIZONOS_APP_SECRET should be kept secret
  • The $HORIZONOS_CHANNEL isn't a secret and can be "store" to deploy straight to the store, however, we've been using this special "prototype_dogfooding" channel and then in the developer portal sending that to the store channel manually. We'll need to decide what we want the automation to do

You can get the Linux version of the CLI tool from here:

https://www.oculus.com/download_app/?id=5159709737372459

@akien-mga akien-mga merged commit 3348432 into main Mar 27, 2025
@akien-mga akien-mga deleted the stable-release-upload branch March 27, 2025 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants