Upload builds to S3 Bucket (#146)

This commit is contained in:
Thaddeus Crews
2026-01-08 11:39:12 -06:00
committed by GitHub
parent 70467aab3f
commit 6e23401b14
2 changed files with 31 additions and 0 deletions

View File

@@ -22,6 +22,9 @@ export GH_TOKEN=''
# Only used for uploading official releases. # Only used for uploading official releases.
export GODOT_BUILDS_PATH='' export GODOT_BUILDS_PATH=''
# Simple Storage Service (S3) API key.
export S3_API_KEY=''
# Path to the directory with the Steam upload setup. # Path to the directory with the Steam upload setup.
export UPLOAD_STEAM_PATH='' export UPLOAD_STEAM_PATH=''

View File

@@ -166,6 +166,34 @@ if [ "${status}" == "stable" -a "${skip_stable}" == "0" ]; then
echo "All stable release upload steps done." echo "All stable release upload steps done."
fi fi
# Upload to S3 Bucket
upload_bucket() {
local file_path=$(realpath $1)
local upload_key=${godot_version}/$(basename $file_path)
echo "Uploading $upload_key..."
local json_data=$(curl -s -S -f -H "Authorization: Bearer $S3_API_KEY" https://storage.godotengine.org/api/v1/request_upload_url/2/${upload_key})
curl -s -S -f \
-F key="$upload_key" \
-F ACL=$(echo $json_data | jq '.fields.ACL') \
-F policy=$(echo $json_data | jq '.fields.policy') \
-F x-amz-algorithm=$(echo $json_data | jq '.fields."x-amz-algorithm"') \
-F x-amz-credential=$(echo $json_data | jq '.fields."x-amz-credential"') \
-F x-amz-date=$(echo $json_data | jq '.fields."x-amz-date"') \
-F x-amz-signature=$(echo $json_data | jq '.fields."x-amz-signature"') \
-F file="@$file_path" \
$(echo $json_data | jq -r '.url')
}
if [ ! -z "${S3_API_KEY}" ]; then
echo "Uploading release to S3 Bucket..."
for path in $reldir/Godot_v* $reldir/mono/Godot_v*; do
upload_bucket $path
done
else
echo "Disabling S3 Bucket publishing as no valid API key was found."
fi
# NuGet packages # NuGet packages
publish_nuget_packages() { publish_nuget_packages() {