Refactor build workflow to install Godot and export templates directly from GitHub releases
This commit is contained in:
@@ -14,9 +14,8 @@ env:
|
||||
jobs:
|
||||
build:
|
||||
name: Export ${{ matrix.platform }}
|
||||
# Node-capable image so JS actions (checkout, upload-artifact) work on Gitea act_runner.
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: barichello/godot-ci:4.3
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -33,11 +32,23 @@ jobs:
|
||||
with:
|
||||
lfs: true
|
||||
|
||||
- name: Install export templates
|
||||
- name: Install Godot ${{ env.GODOT_VERSION }} + export templates
|
||||
run: |
|
||||
mkdir -p ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable
|
||||
cp -r /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable/* \
|
||||
~/.local/share/godot/export_templates/${GODOT_VERSION}.stable/ || true
|
||||
set -euxo pipefail
|
||||
GODOT_REL="${GODOT_VERSION}-stable"
|
||||
BASE="https://github.com/godotengine/godot/releases/download/${GODOT_REL}"
|
||||
# Editor (headless export uses the editor binary)
|
||||
curl -fSL -o godot.zip "${BASE}/Godot_v${GODOT_REL}_linux.x86_64.zip"
|
||||
unzip -o godot.zip
|
||||
mv "Godot_v${GODOT_REL}_linux.x86_64" /usr/local/bin/godot
|
||||
chmod +x /usr/local/bin/godot
|
||||
godot --version
|
||||
# Export templates
|
||||
curl -fSL -o templates.tpz "${BASE}/Godot_v${GODOT_REL}_export_templates.tpz"
|
||||
unzip -o templates.tpz
|
||||
TPL_DIR="${HOME}/.local/share/godot/export_templates/${GODOT_VERSION}.stable"
|
||||
mkdir -p "${TPL_DIR}"
|
||||
mv templates/* "${TPL_DIR}/"
|
||||
|
||||
- name: Import project (build resource cache)
|
||||
run: godot --headless --import
|
||||
@@ -45,8 +56,9 @@ jobs:
|
||||
|
||||
- name: Export ${{ matrix.platform }}
|
||||
run: |
|
||||
mkdir -p build/${{ matrix.platform }}
|
||||
godot --headless --export-release "${{ matrix.preset }}" build/${{ matrix.platform }}/${{ matrix.output }}
|
||||
set -euxo pipefail
|
||||
mkdir -p "build/${{ matrix.platform }}"
|
||||
godot --headless --export-release "${{ matrix.preset }}" "build/${{ matrix.platform }}/${{ matrix.output }}"
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
|
||||
Reference in New Issue
Block a user