Skip to content

Release v0.6

Release v0.6 #12

name: Manual Release Deploy
run-name: ${{ inputs.version && format('Release v{0}', inputs.version) || 'Release auto-bump' }}
on:
workflow_dispatch:
inputs:
version:
description: "Exact MAJOR.MINOR version to release. Leave empty to bump minor."
required: false
default: ""
type: string
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: manual-release-deploy
cancel-in-progress: false
env:
GODOT_VERSION: "4.6.3-stable"
GODOT_TEMPLATE_VERSION: "4.6.3.stable"
GODOT_BIN: "${{ github.workspace }}/.godot/Godot_v4.6.3-stable_linux.x86_64"
jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 30
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Configure Pages
uses: actions/configure-pages@v6
- name: Install Godot
shell: bash
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y unzip libfontconfig1
mkdir -p .godot
curl -L "https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}/Godot_v${GODOT_VERSION}_linux.x86_64.zip" -o .godot/godot.zip
curl -L "https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}/Godot_v${GODOT_VERSION}_export_templates.tpz" -o .godot/templates.zip
unzip -q .godot/godot.zip -d .godot
unzip -q .godot/templates.zip -d .godot/templates
chmod +x "$GODOT_BIN"
template_dir="$HOME/.local/share/godot/export_templates/${GODOT_TEMPLATE_VERSION}"
mkdir -p "$template_dir"
cp -a .godot/templates/templates/. "$template_dir/"
- name: Install browser smoke dependencies
shell: bash
run: |
set -euo pipefail
PLAYWRIGHT_ROOT="$RUNNER_TEMP/multi-server-test-playwright"
mkdir -p "$PLAYWRIGHT_ROOT"
npm --prefix "$PLAYWRIGHT_ROOT" install --no-save playwright@1.61.0
"$PLAYWRIGHT_ROOT/node_modules/.bin/playwright" install --with-deps chromium
- name: Configure Git
shell: bash
run: |
set -euo pipefail
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Set release project version
id: version
shell: bash
env:
REQUESTED_VERSION: ${{ inputs.version }}
run: |
set -euo pipefail
python3 tools/project_version.py --self-test
if [ -n "${REQUESTED_VERSION}" ]; then
python3 tools/project_version.py --set "${REQUESTED_VERSION}"
else
python3 tools/project_version.py --bump-minor
fi
version="$(python3 tools/project_version.py --print | sed -E 's/^PROJECT_VERSION version=//')"
echo "project_version=${version}" >> "$GITHUB_OUTPUT"
echo "PROJECT_VERSION version=${version}"
- name: Export release artifacts
shell: bash
run: |
set -euo pipefail
rm -rf builds
mkdir -p builds/server builds/web builds/world_packs builds/web/world_packs
cp project.godot .godot/project.godot.release
grep -v '^RunInstanceGrid=' .godot/project.godot.release > project.godot
"$GODOT_BIN" --headless --path . --export-release "Linux Server" builds/server/server.x86_64
chmod +x builds/server/server.x86_64
"$GODOT_BIN" --headless --path . --export-release "Web Client" builds/web/index.html
python3 tools/patch_web_cache_bust.py --web-root builds/web --version "${{ steps.version.outputs.project_version }}"
while IFS= read -r world_dir; do
world_key="$(basename "$world_dir")"
test -f "$world_dir/${world_key}.tscn"
"$GODOT_BIN" --headless --path . --export-pack "World Pack - ${world_key}" "builds/world_packs/${world_key}.pck"
"$GODOT_BIN" --headless --path . --export-pack "Web World Pack - ${world_key}" "builds/web/world_packs/${world_key}.pck"
echo "WORLD_PACK_EXPORTED key=${world_key}"
done < <(find server/worlds -mindepth 1 -maxdepth 1 -type d | sort)
mv .godot/project.godot.release project.godot
echo "EXPORT_ALL_DONE"
- name: Verify exports
shell: bash
run: |
set -euo pipefail
python3 tools/verify_export_artifacts.py --server-binary server/server.x86_64
- name: Run Web smoke
shell: bash
run: |
set -euo pipefail
mkdir -p .logs/web_smoke
python3 -m http.server 19200 --bind 127.0.0.1 --directory builds/web > .logs/web_smoke/static.out.log 2> .logs/web_smoke/static.err.log &
static_pid="$!"
MULTI_SERVER_WORLD_PACK_DIR="$PWD/builds/web/world_packs" \
MULTI_SERVER_WORLD_PACK_BASE_URL="http://127.0.0.1:19200/world_packs" \
./builds/server/server.x86_64 --headless > .logs/web_smoke/master.out.log 2> .logs/web_smoke/master.err.log &
master_pid="$!"
trap 'kill "$static_pid" "$master_pid" 2>/dev/null || true' EXIT
for _ in $(seq 1 120); do
if grep -q "MASTER_READY" .logs/web_smoke/master.out.log 2>/dev/null; then
break
fi
sleep 0.25
done
grep -q "MASTER_READY" .logs/web_smoke/master.out.log
NODE_PATH="$RUNNER_TEMP/multi-server-test-playwright/node_modules" node tools/web_smoke.mjs --url="http://127.0.0.1:19200/index.html?args=smoke_test,force_packrat_world_packs&run=${GITHUB_RUN_ID}" --timeout_ms=180000
- name: Commit release project version
shell: bash
run: |
set -euo pipefail
version="${{ steps.version.outputs.project_version }}"
git add project.godot
if git diff --cached --quiet; then
echo "PROJECT_VERSION_NO_CHANGE version=${version}"
else
git commit -m "chore: bump project version to v${version}"
git push origin "HEAD:${GITHUB_REF_NAME}"
fi
- name: Tag release commit
shell: bash
run: |
set -euo pipefail
version="${{ steps.version.outputs.project_version }}"
tag="v${version}"
git fetch --tags origin
if git rev-parse -q --verify "refs/tags/${tag}" >/dev/null; then
tag_commit="$(git rev-list -n 1 "${tag}")"
head_commit="$(git rev-parse HEAD)"
if [ "$tag_commit" != "$head_commit" ]; then
echo "Release tag ${tag} already points at ${tag_commit}, expected ${head_commit}" >&2
exit 1
fi
echo "RELEASE_TAG_EXISTS tag=${tag} commit=$(git rev-parse --short HEAD)"
else
git tag -a "${tag}" -m "Release ${tag}"
git push origin "${tag}"
echo "RELEASE_TAG_CREATED tag=${tag} commit=$(git rev-parse --short HEAD)"
fi
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v5
with:
path: builds/web
- name: Deploy Pages
id: deploy
uses: actions/deploy-pages@v5
- name: Upload server artifact
uses: actions/upload-artifact@v7
with:
name: server-v${{ steps.version.outputs.project_version }}
path: |
builds/server/**
builds/world_packs/*.pck
builds/web/world_packs/*.pck
if-no-files-found: error
- name: VPS deploy reminder
shell: bash
run: |
echo "VPS_DEPLOY_NOT_CONFIGURED"
echo "When the VPS is ready, add the stop -> upload staged Linux server -> start step here."