Compare commits
2 Commits
2d8ca9dfbb
...
db2460b9ee
| Author | SHA1 | Date | |
|---|---|---|---|
| db2460b9ee | |||
| 734b5931e9 |
@@ -0,0 +1,43 @@
|
|||||||
|
name: Setup Godot
|
||||||
|
description: Download a Godot headless Linux binary and (optionally) export templates.
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
description: Godot version (e.g. 4.6). Templates land under <version>.stable.
|
||||||
|
required: false
|
||||||
|
default: "4.6"
|
||||||
|
templates:
|
||||||
|
description: Install export templates too. "true" / "false".
|
||||||
|
required: false
|
||||||
|
default: "false"
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Install Godot ${{ inputs.version }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
VER="${{ inputs.version }}"
|
||||||
|
URL="https://github.com/godotengine/godot/releases/download/${VER}-stable/Godot_v${VER}-stable_linux.x86_64.zip"
|
||||||
|
wget -q "$URL" -O /tmp/godot.zip
|
||||||
|
mkdir -p "$HOME/bin"
|
||||||
|
unzip -q /tmp/godot.zip -d /tmp
|
||||||
|
mv "/tmp/Godot_v${VER}-stable_linux.x86_64" "$HOME/bin/godot"
|
||||||
|
chmod +x "$HOME/bin/godot"
|
||||||
|
echo "$HOME/bin" >> "$GITHUB_PATH"
|
||||||
|
"$HOME/bin/godot" --version
|
||||||
|
|
||||||
|
- name: Install export templates
|
||||||
|
if: inputs.templates == 'true'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
VER="${{ inputs.version }}"
|
||||||
|
URL="https://github.com/godotengine/godot/releases/download/${VER}-stable/Godot_v${VER}-stable_export_templates.tpz"
|
||||||
|
wget -q "$URL" -O /tmp/templates.tpz
|
||||||
|
DEST="$HOME/.local/share/godot/export_templates/${VER}.stable"
|
||||||
|
mkdir -p "$DEST"
|
||||||
|
unzip -q /tmp/templates.tpz -d /tmp/templates_extracted
|
||||||
|
mv /tmp/templates_extracted/templates/* "$DEST/"
|
||||||
|
ls "$DEST" | head
|
||||||
+62
-11
@@ -5,19 +5,26 @@ Workflow defined in [`build.yml`](./build.yml). Triggered on push / PR to
|
|||||||
|
|
||||||
## Jobs
|
## Jobs
|
||||||
|
|
||||||
| Job | Image | Role |
|
All jobs run on the default `ubuntu-latest` runner image (which already
|
||||||
|----------------------|-----------------------------|------------------------------------------------------------------------------------------|
|
ships Node, Python, git, wget, unzip, etc.). Godot is installed per-job
|
||||||
| `validate` | `barichello/godot-ci:4.6` | `godot --headless --import` then grep for `SCRIPT ERROR` / `Parse Error`. Uploads `.godot/` cache. |
|
via the local composite action [`.gitea/actions/setup-godot`](../actions/setup-godot/action.yml),
|
||||||
| `lint` | `ubuntu-latest` (Python) | `gdlint scripts db scenes` via `gdtoolkit==4.*` (Scony). Parallel to `validate`; does not gate exports yet. |
|
which downloads the official Linux binary from the godotengine GitHub
|
||||||
| `export-desktop` | `barichello/godot-ci:4.6` | Matrix: Windows / Linux / macOS. Reuses the import cache, uploads each binary as artifact. |
|
release and (optionally) export templates into `$HOME`.
|
||||||
| `export-android` | `barichello/godot-ci:4.6` + JDK 17 + Android SDK installed at runtime | Provisions keystore, writes `editor_settings-4.tres` with SDK / JDK paths, exports APK. |
|
|
||||||
|
| Job | Tooling installed by the job | Role |
|
||||||
|
|------------------|---------------------------------------------------------------------------|------------------------------------------------------------------------------------------|
|
||||||
|
| `validate` | Godot binary (no templates) | `godot --headless --import` then grep for `SCRIPT ERROR` / `Parse Error`. Uploads `.godot/` cache. |
|
||||||
|
| `lint` | `gdtoolkit==4.*` via `pip` | `gdlint scripts db scenes`. Parallel to `validate`; does not gate exports yet. |
|
||||||
|
| `export-desktop` | Godot binary + export templates | Matrix: Windows / Linux / macOS. Reuses the import cache, uploads each binary as artifact. |
|
||||||
|
| `export-android` | Godot binary + export templates + JDK 17 + Android SDK (under `$GITHUB_WORKSPACE/.android-sdk`) | Provisions keystore, writes `editor_settings-4.tres` with SDK / JDK paths, exports APK. |
|
||||||
|
|
||||||
Artifacts are kept 14 days, accessible from the Gitea run page.
|
Artifacts are kept 14 days, accessible from the Gitea run page.
|
||||||
|
|
||||||
## Prerequisites before the first successful run
|
## Prerequisites before the first successful run
|
||||||
|
|
||||||
1. **Docker image tag** — verify `barichello/godot-ci:4.6` exists on Docker
|
1. **Godot version** — `GODOT_VERSION` is set at the top of the workflow
|
||||||
Hub. Otherwise adjust `GODOT_IMAGE` (common alternatives: `4.3`, `4.4`).
|
(currently `4.6`). The setup action expects a stable release on the
|
||||||
|
godotengine GitHub releases page; bump in lockstep with the project.
|
||||||
2. **macOS preset missing** — add it in Godot Editor → Project → Export →
|
2. **macOS preset missing** — add it in Godot Editor → Project → Export →
|
||||||
Add → macOS, name it exactly `macOS` (or change the matrix entry). The
|
Add → macOS, name it exactly `macOS` (or change the matrix entry). The
|
||||||
`.zip` will be unsigned; on Mac it needs
|
`.zip` will be unsigned; on Mac it needs
|
||||||
@@ -25,9 +32,11 @@ Artifacts are kept 14 days, accessible from the Gitea run page.
|
|||||||
3. **`Linux/X11Debug` preset** — Godot-3-era name. Reopen the project in
|
3. **`Linux/X11Debug` preset** — Godot-3-era name. Reopen the project in
|
||||||
Godot 4 once and re-save the preset (the editor may rename it). Update
|
Godot 4 once and re-save the preset (the editor may rename it). Update
|
||||||
the matrix `preset:` field accordingly if it does.
|
the matrix `preset:` field accordingly if it does.
|
||||||
4. **Gitea runner** — must support Docker containers (`act_runner` in
|
4. **Gitea runner** — `act_runner` with the default
|
||||||
`docker` mode, or `host` mode with Docker installed). Check
|
`catthehacker/ubuntu:act-latest` image is enough; no Docker-in-Docker
|
||||||
`act_runner exec` access to Docker Hub.
|
needed now that no job uses `container:`. The runner must reach
|
||||||
|
`github.com` (for actions + Godot release downloads) and
|
||||||
|
`dl.google.com` (for the Android SDK).
|
||||||
5. **Optional secret** `ANDROID_KEYSTORE_BASE64` — `base64 -w0 debug.keystore`,
|
5. **Optional secret** `ANDROID_KEYSTORE_BASE64` — `base64 -w0 debug.keystore`,
|
||||||
stored as a Gitea repo secret. Without it, a throwaway keystore is
|
stored as a Gitea repo secret. Without it, a throwaway keystore is
|
||||||
generated per run, so the APK signature changes every build.
|
generated per run, so the APK signature changes every build.
|
||||||
@@ -47,6 +56,48 @@ Suppress specific rules per-line with `# gdlint: disable=<rule>` or
|
|||||||
project-wide with a `gdlintrc` file at the repo root (see
|
project-wide with a `gdlintrc` file at the repo root (see
|
||||||
[gdtoolkit docs](https://github.com/Scony/godot-gdscript-toolkit/wiki)).
|
[gdtoolkit docs](https://github.com/Scony/godot-gdscript-toolkit/wiki)).
|
||||||
|
|
||||||
|
## Known issues from first runs
|
||||||
|
|
||||||
|
Captured from the first triggered runs on `feature/godot-migration`
|
||||||
|
(2026-05-17). Both must be resolved before the workflow can pass.
|
||||||
|
|
||||||
|
### 1. Container jobs failed with `node: not found` (resolved 2026-05-17)
|
||||||
|
|
||||||
|
The first runs used `container: barichello/godot-ci:4.6` for the Godot
|
||||||
|
jobs. That image does not ship Node.js, so `actions/checkout@v4` (a JS
|
||||||
|
action) crashed at startup with
|
||||||
|
`OCI runtime exec failed: exec: "node": executable file not found`.
|
||||||
|
|
||||||
|
Resolved by removing every `container:` block. The runner's default
|
||||||
|
`catthehacker/ubuntu:act-latest` image already has Node / Python / git /
|
||||||
|
JDK, and Godot is now installed at the start of each job via the local
|
||||||
|
composite action `.gitea/actions/setup-godot/`.
|
||||||
|
|
||||||
|
### 2. `actions/checkout` clones the wrong URL (resolved 2026-05-17)
|
||||||
|
|
||||||
|
The first runs failed at clone time because the runner asked for
|
||||||
|
`https://dev.stilobique.com/darknight/puzzle-quest/info/refs` while
|
||||||
|
Gitea was mounted under `/gitea/` behind YunoHost — the request was
|
||||||
|
intercepted by the YunoHost SSO at the root and redirected before
|
||||||
|
reaching Gitea.
|
||||||
|
|
||||||
|
Resolved by relocating Gitea to the root: it now serves at
|
||||||
|
`https://dev.stilobique.com/` directly (API at `/api/v1/...`,
|
||||||
|
`clone_url` at `/<owner>/<repo>.git`). The runner-injected
|
||||||
|
`GITHUB_SERVER_URL` and the actual Gitea base URL now agree.
|
||||||
|
|
||||||
|
If Gitea is ever moved back under a sub-path, the fix is `ROOT_URL` in
|
||||||
|
`app.ini` (`[server] ROOT_URL = https://<host>/<prefix>/`) or
|
||||||
|
re-registering `act_runner` with the full instance URL.
|
||||||
|
|
||||||
|
### 3. Default-branch mismatch
|
||||||
|
|
||||||
|
The Gitea API reports `default_branch: main` for the repo, but
|
||||||
|
`CLAUDE.md` describes `dev` as the default. The workflow listens to both,
|
||||||
|
so jobs trigger correctly either way, but the "Workflows" sidebar in the
|
||||||
|
Gitea UI reads from whatever the actual default branch is. If you intend
|
||||||
|
`dev` to be the default, update it under repo Settings → Branches.
|
||||||
|
|
||||||
## Differences from the old `.drone.yml`
|
## Differences from the old `.drone.yml`
|
||||||
|
|
||||||
- No more Drone, no more Butler — build only, artifacts downloadable from
|
- No more Drone, no more Butler — build only, artifacts downloadable from
|
||||||
|
|||||||
+27
-19
@@ -9,7 +9,6 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
GODOT_VERSION: "4.6"
|
GODOT_VERSION: "4.6"
|
||||||
GODOT_IMAGE: "barichello/godot-ci:4.6"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
@@ -18,11 +17,13 @@ jobs:
|
|||||||
validate:
|
validate:
|
||||||
name: Validate GDScript
|
name: Validate GDScript
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
|
||||||
image: barichello/godot-ci:4.6
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: ./.gitea/actions/setup-godot
|
||||||
|
with:
|
||||||
|
version: ${{ env.GODOT_VERSION }}
|
||||||
|
|
||||||
- name: Import project (parses every .gd / .tscn)
|
- name: Import project (parses every .gd / .tscn)
|
||||||
run: |
|
run: |
|
||||||
godot --headless --import 2>&1 | tee /tmp/godot-import.log || true
|
godot --headless --import 2>&1 | tee /tmp/godot-import.log || true
|
||||||
@@ -72,8 +73,6 @@ jobs:
|
|||||||
name: Export ${{ matrix.platform }}
|
name: Export ${{ matrix.platform }}
|
||||||
needs: validate
|
needs: validate
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
|
||||||
image: barichello/godot-ci:4.6
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -93,6 +92,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: ./.gitea/actions/setup-godot
|
||||||
|
with:
|
||||||
|
version: ${{ env.GODOT_VERSION }}
|
||||||
|
templates: "true"
|
||||||
|
|
||||||
- name: Restore import cache
|
- name: Restore import cache
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
@@ -114,7 +118,7 @@ jobs:
|
|||||||
retention-days: 14
|
retention-days: 14
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# 4. Android export — needs JDK + Android SDK on top of the Godot image.
|
# 4. Android export — Godot + JDK 17 + Android SDK installed in $HOME.
|
||||||
# Provide ANDROID_KEYSTORE_BASE64 as a Gitea secret for a stable signature;
|
# Provide ANDROID_KEYSTORE_BASE64 as a Gitea secret for a stable signature;
|
||||||
# otherwise a fresh debug keystore is generated on each run.
|
# otherwise a fresh debug keystore is generated on each run.
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
@@ -122,21 +126,25 @@ jobs:
|
|||||||
name: Export Android
|
name: Export Android
|
||||||
needs: validate
|
needs: validate
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
|
||||||
image: barichello/godot-ci:4.6
|
|
||||||
env:
|
env:
|
||||||
ANDROID_HOME: /opt/android-sdk
|
ANDROID_HOME: ${{ github.workspace }}/.android-sdk
|
||||||
JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install JDK 17 + unzip
|
- uses: ./.gitea/actions/setup-godot
|
||||||
|
with:
|
||||||
|
version: ${{ env.GODOT_VERSION }}
|
||||||
|
templates: "true"
|
||||||
|
|
||||||
|
- name: Install JDK 17
|
||||||
run: |
|
run: |
|
||||||
apt-get update
|
sudo apt-get update
|
||||||
apt-get install -y --no-install-recommends openjdk-17-jdk wget unzip
|
sudo apt-get install -y --no-install-recommends openjdk-17-jdk
|
||||||
|
echo "JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Install Android command-line tools + SDK
|
- name: Install Android command-line tools + SDK
|
||||||
run: |
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
mkdir -p "$ANDROID_HOME/cmdline-tools"
|
mkdir -p "$ANDROID_HOME/cmdline-tools"
|
||||||
wget -q https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -O /tmp/cmdline.zip
|
wget -q https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -O /tmp/cmdline.zip
|
||||||
unzip -q /tmp/cmdline.zip -d "$ANDROID_HOME/cmdline-tools"
|
unzip -q /tmp/cmdline.zip -d "$ANDROID_HOME/cmdline-tools"
|
||||||
@@ -149,14 +157,14 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
|
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
|
||||||
run: |
|
run: |
|
||||||
if [ -n "$ANDROID_KEYSTORE_BASE64" ]; then
|
if [ -n "${ANDROID_KEYSTORE_BASE64:-}" ]; then
|
||||||
echo "$ANDROID_KEYSTORE_BASE64" | base64 -d > /root/debug.keystore
|
echo "$ANDROID_KEYSTORE_BASE64" | base64 -d > /tmp/debug.keystore
|
||||||
else
|
else
|
||||||
keytool -keyalg RSA -genkeypair -alias androiddebugkey -keypass android \
|
keytool -keyalg RSA -genkeypair -alias androiddebugkey -keypass android \
|
||||||
-keystore /root/debug.keystore -storepass android \
|
-keystore /tmp/debug.keystore -storepass android \
|
||||||
-dname "CN=Android Debug,O=Android,C=US" -validity 9999
|
-dname "CN=Android Debug,O=Android,C=US" -validity 9999
|
||||||
fi
|
fi
|
||||||
sed -i 's@keystore/debug=".*"@keystore/debug="/root/debug.keystore"@g' export_presets.cfg
|
sed -i 's@keystore/debug=".*"@keystore/debug="/tmp/debug.keystore"@g' export_presets.cfg
|
||||||
|
|
||||||
- name: Write Godot editor settings (Android SDK / JDK paths)
|
- name: Write Godot editor settings (Android SDK / JDK paths)
|
||||||
run: |
|
run: |
|
||||||
@@ -164,9 +172,9 @@ jobs:
|
|||||||
cat > ~/.config/godot/editor_settings-4.tres <<EOF
|
cat > ~/.config/godot/editor_settings-4.tres <<EOF
|
||||||
[gd_resource type="EditorSettings" format=3]
|
[gd_resource type="EditorSettings" format=3]
|
||||||
[resource]
|
[resource]
|
||||||
export/android/android_sdk_path = "/opt/android-sdk"
|
export/android/android_sdk_path = "${ANDROID_HOME}"
|
||||||
export/android/java_sdk_path = "/usr/lib/jvm/java-17-openjdk-amd64"
|
export/android/java_sdk_path = "/usr/lib/jvm/java-17-openjdk-amd64"
|
||||||
export/android/debug_keystore = "/root/debug.keystore"
|
export/android/debug_keystore = "/tmp/debug.keystore"
|
||||||
export/android/debug_keystore_user = "androiddebugkey"
|
export/android/debug_keystore_user = "androiddebugkey"
|
||||||
export/android/debug_keystore_pass = "android"
|
export/android/debug_keystore_pass = "android"
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
Reference in New Issue
Block a user