Files
millimeters-of-aluminum/.gitea/workflows/build-game.yaml
Olof Pettersson 9855d02525
Some checks failed
Build Game / Export Game Client (push) Failing after 1m4s
Build from root cleanup modules file
2025-12-05 15:55:35 +01:00

109 lines
3.8 KiB
YAML

name: Build Game
on:
push:
branches:
- main
- infra/export-chain
workflow_dispatch:
jobs:
export-game:
name: Export Game Client
runs-on: ubuntu-latest
steps:
- name: Checkout Game
uses: actions/checkout@v3
- name: Prepare Build Environment
env:
# 1. CONFIGURATION
# The Git SHA of the Engine Build you want to use
ENGINE_HASH: "e40804a4aec8fad5d3215766045ff7ba21e59ac9"
# The internal version string Godot expects for templates
# CRITICAL: Run your custom editor, check "Help -> About" to find this exact string.
# It is usually "4.3.stable.custom_build" unless you changed version.py
GODOT_VERSION: "4.6.dev.double"
# Registry details
REGISTRY_URL: https://gitea.212.63.210.91.nip.io/api/packages/seedlingattempt/generic
TOKEN: ${{ secrets.USER_PACKAGE_PASSWORD }}
run: |
echo "--- 1. FETCHING TOOLS ---"
# Download Linux Editor (The Builder)
echo "Downloading Editor..."
wget "$REGISTRY_URL/godot-editor-linux/$ENGINE_HASH/godot-editor-linux.zip"
# Download Templates (The Payload)
echo "Downloading Templates..."
wget "$REGISTRY_URL/godot-templates/$ENGINE_HASH/templates.tpz"
echo "--- 2. INSTALLING ---"
# Unzip Editor
unzip -o godot-editor-linux.zip
# Find the binary (it has no extension)
EDITOR_BIN=$(find . -maxdepth 1 -type f -name "godot.linuxbsd.editor*" | head -n 1)
chmod +x "$EDITOR_BIN"
mv "$EDITOR_BIN" ./godot_headless
echo "Editor ready: ./godot_headless"
# Install Templates
# Godot looks in ~/.local/share/godot/export_templates/{VERSION}/
TEMPLATE_DIR="$HOME/.local/share/godot/export_templates/$GODOT_VERSION"
mkdir -p "$TEMPLATE_DIR"
echo "Extracting templates to $TEMPLATE_DIR..."
unzip -o templates.tpz -d "$TEMPLATE_DIR"
# Verify files are where Godot expects them
ls -l "$TEMPLATE_DIR"
- name: Export Windows Client
run: |
mkdir -p build/windows
# "Windows Desktop" must match the name in your export_presets.cfg
./godot_headless --headless --export-release "Windows Desktop" ./build/windows/game.exe
- name: Export Linux Client
run: |
mkdir -p build/linux
# "Linux" must match the name in your export_presets.cfg
./godot_headless --headless --export-release "Linux" ./build/linux/game.x86_64
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: game-clients
path: build/
- name: Publish Nightly Build
env:
# Config
PACKAGE_NAME: moa-windows-nightly
# We overwrite the 'nightly' version every time so the URL stays the same
VERSION: nightly
ZIP_NAME: moa-windows-nightly.zip
# Auth
API_URL: https://gitea.212.63.210.91.nip.io/api/packages/${{ gitea.repository_owner }}/generic
TOKEN: ${{ secrets.USER_PACKAGE_PASSWORD }}
run: |
echo "Packaging Game..."
cd build/windows
# Zip everything (Executable + PCK + potential .dlls)
zip -r ../../$ZIP_NAME .
cd ../..
echo "Uploading Nightly..."
# PUT request replaces the file if it exists
curl --fail --user "${{ gitea.actor }}:$TOKEN" \
--upload-file "$ZIP_NAME" \
"$API_URL/$PACKAGE_NAME/$VERSION/$ZIP_NAME"
echo "✅ Nightly Build Available at:"
echo "$API_URL/$PACKAGE_NAME/$VERSION/$ZIP_NAME"