Compare commits

3 Commits

Author SHA1 Message Date
Vaillant Jeremy 238fccef95 Fix gdlint findings in Global / Database / Levels
- Global.gd: move @onready var animation below the regular vars
  (gdlint class-definitions-order expects onready vars after
  public/private vars).
- Database.gd::DB: move the three _*_PROPS constants above the vars
  (constants come before vars in a class body).
- Levels.gd:_search_button_to_use: drop the elif after a branch
  that returns (no-elif-return).
- Levels.gd:_gyroscope_changed_{down,up}: continuation lines of the
  multi-line return mixed two tabs + three spaces; normalised to
  pure tabs.

No semantic change: @onready is property-level so source ordering
doesn't affect init; elif after a return is equivalent to if; the
continuation indent is cosmetic.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 14:48:20 +02:00
Vaillant Jeremy e883d662f2 Add gdlint job + gdlintrc to Gitea CI
Lints scripts/, db/, scenes/ via gdtoolkit==4.* on ubuntu-latest
(Python, no Godot needed), in parallel with the validate job.
addons/ (third-party LOD plugin) and developers/ (sandbox) are
left out. Non-blocking for now: the export jobs still only need
validate, so a lint regression won't break builds while the
Godot-3 leftover code is being cleaned up.

gdlintrc bumps max-line-length from 100 to 140 because Godot
$-style node paths and typed signatures routinely push past 100
without that being a real readability problem.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 14:48:13 +02:00
Vaillant Jeremy 410c135870 Replace Drone CI with Gitea Actions workflow
Drone server is gone; CI now lives in .gitea/workflows/build.yml.
Three jobs: GDScript validation (godot --headless --import + error
grep), desktop matrix (Windows / Linux / macOS), and Android (JDK 17
+ SDK installed at runtime, keystore from ANDROID_KEYSTORE_BASE64
secret or generated). Build only — Butler / itch.io deploy not wired.

Notes in .gitea/workflows/README.md cover the Godot-4 pre-reqs
(macOS preset to add, Linux/X11Debug likely renamed on first 4.x
save, Docker image tag) and how to plug Butler back in later.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 12:36:34 +02:00
9 changed files with 282 additions and 150 deletions
+67
View File
@@ -0,0 +1,67 @@
# Gitea Actions CI
Workflow defined in [`build.yml`](./build.yml). Triggered on push / PR to
`dev` and `main`, or manually via `workflow_dispatch`.
## Jobs
| Job | Image | Role |
|----------------------|-----------------------------|------------------------------------------------------------------------------------------|
| `validate` | `barichello/godot-ci:4.6` | `godot --headless --import` then grep for `SCRIPT ERROR` / `Parse Error`. Uploads `.godot/` cache. |
| `lint` | `ubuntu-latest` (Python) | `gdlint scripts db scenes` via `gdtoolkit==4.*` (Scony). Parallel to `validate`; does not gate exports yet. |
| `export-desktop` | `barichello/godot-ci:4.6` | Matrix: Windows / Linux / macOS. Reuses the import cache, uploads each binary as artifact. |
| `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. |
Artifacts are kept 14 days, accessible from the Gitea run page.
## Prerequisites before the first successful run
1. **Docker image tag** — verify `barichello/godot-ci:4.6` exists on Docker
Hub. Otherwise adjust `GODOT_IMAGE` (common alternatives: `4.3`, `4.4`).
2. **macOS preset missing** — add it in Godot Editor → Project → Export →
Add → macOS, name it exactly `macOS` (or change the matrix entry). The
`.zip` will be unsigned; on Mac it needs
`xattr -dr com.apple.quarantine` to launch.
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
the matrix `preset:` field accordingly if it does.
4. **Gitea runner** — must support Docker containers (`act_runner` in
`docker` mode, or `host` mode with Docker installed). Check
`act_runner exec` access to Docker Hub.
5. **Optional secret** `ANDROID_KEYSTORE_BASE64``base64 -w0 debug.keystore`,
stored as a Gitea repo secret. Without it, a throwaway keystore is
generated per run, so the APK signature changes every build.
## Linting
`gdlint` (from Scony's `gdtoolkit`) runs in the `lint` job over `scripts/`,
`db/`, and `scenes/`. `addons/` (third-party LOD plugin) and `developers/`
(sandbox) are intentionally excluded.
The job is **non-blocking** today — the export jobs only depend on
`validate`, so a lint failure prints warnings but still produces binaries.
Once the codebase is clean, switch the export jobs' `needs: validate` to
`needs: [validate, lint]` to make lint a hard gate.
Suppress specific rules per-line with `# gdlint: disable=<rule>` or
project-wide with a `gdlintrc` file at the repo root (see
[gdtoolkit docs](https://github.com/Scony/godot-gdscript-toolkit/wiki)).
## Differences from the old `.drone.yml`
- No more Drone, no more Butler — build only, artifacts downloadable from
the Gitea UI.
- GDScript validation step before export (didn't exist).
- `.godot/` import cache shared between jobs (faster reruns).
- Keystore via Gitea secret instead of a public pCloud link.
- macOS target added (preset still to be created in Godot).
- `master` / empty `ReleaseVersion` pipeline → replaced by triggers on
`main` (release branch per `CLAUDE.md`).
## Future: itch.io deploy via Butler
Not wired. When you want it back, add a `deploy-itch` job gated on tag
push (`v*`) that downloads the artifacts and runs
`butler push <dir> dev-crea/ahog:<channel>` with `BUTLER_API_KEY` from
secrets. Channels used historically:
`windows`, `linux`, `android`, `mac`.
+192
View File
@@ -0,0 +1,192 @@
name: Build Puzzle Quest
on:
push:
branches: [dev, main]
pull_request:
branches: [dev, main]
workflow_dispatch:
env:
GODOT_VERSION: "4.6"
GODOT_IMAGE: "barichello/godot-ci:4.6"
jobs:
# ---------------------------------------------------------------------------
# 1. GDScript validation — parse every script and fail on errors / warnings.
# ---------------------------------------------------------------------------
validate:
name: Validate GDScript
runs-on: ubuntu-latest
container:
image: barichello/godot-ci:4.6
steps:
- uses: actions/checkout@v4
- name: Import project (parses every .gd / .tscn)
run: |
godot --headless --import 2>&1 | tee /tmp/godot-import.log || true
- name: Fail on parse / script errors
run: |
if grep -qE "SCRIPT ERROR|Parse Error|ERROR: .*\.gd" /tmp/godot-import.log; then
echo "::error::GDScript errors detected during import"
grep -E "SCRIPT ERROR|Parse Error|ERROR: .*\.gd" /tmp/godot-import.log
exit 1
fi
- name: Upload import cache
uses: actions/upload-artifact@v3
with:
name: godot-import-cache
path: .godot
retention-days: 1
# ---------------------------------------------------------------------------
# 2. Static analysis — gdlint from Scony's gdtoolkit (Python, no Godot).
# Runs in parallel with `validate`. Exports do NOT depend on this job,
# so a lint failure does not block builds while the Godot-3 leftovers
# are still being cleaned up. Once the tree is clean, add this job to
# the `needs:` of the export jobs to make it a hard gate.
# ---------------------------------------------------------------------------
lint:
name: Lint GDScript
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install gdtoolkit
run: |
python3 -m pip install --user "gdtoolkit==4.*"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Run gdlint
run: gdlint scripts db scenes
# ---------------------------------------------------------------------------
# 3. Desktop exports (Windows / Linux / macOS) — runs in parallel.
# macOS preset must be added in the Godot editor before this matrix entry
# can succeed (export_presets.cfg currently has none).
# ---------------------------------------------------------------------------
export-desktop:
name: Export ${{ matrix.platform }}
needs: validate
runs-on: ubuntu-latest
container:
image: barichello/godot-ci:4.6
strategy:
fail-fast: false
matrix:
include:
- platform: Windows
preset: WindowsDebug
output: releases/windows/Puzzle-Quest.exe
artifact_path: releases/windows
- platform: Linux
preset: Linux/X11Debug
output: releases/linux/Puzzle-Quest.x86_64
artifact_path: releases/linux
- platform: macOS
preset: macOS
output: releases/macos/Puzzle-Quest.zip
artifact_path: releases/macos
steps:
- uses: actions/checkout@v4
- name: Restore import cache
uses: actions/download-artifact@v3
with:
name: godot-import-cache
path: .godot
- name: Prepare output dir
run: mkdir -p "${{ matrix.artifact_path }}"
- name: Export ${{ matrix.platform }}
run: godot --headless --export-debug "${{ matrix.preset }}" "${{ matrix.output }}"
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: PuzzleQuest-${{ matrix.platform }}
path: ${{ matrix.artifact_path }}
if-no-files-found: error
retention-days: 14
# ---------------------------------------------------------------------------
# 4. Android export — needs JDK + Android SDK on top of the Godot image.
# Provide ANDROID_KEYSTORE_BASE64 as a Gitea secret for a stable signature;
# otherwise a fresh debug keystore is generated on each run.
# ---------------------------------------------------------------------------
export-android:
name: Export Android
needs: validate
runs-on: ubuntu-latest
container:
image: barichello/godot-ci:4.6
env:
ANDROID_HOME: /opt/android-sdk
JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64
steps:
- uses: actions/checkout@v4
- name: Install JDK 17 + unzip
run: |
apt-get update
apt-get install -y --no-install-recommends openjdk-17-jdk wget unzip
- name: Install Android command-line tools + SDK
run: |
mkdir -p "$ANDROID_HOME/cmdline-tools"
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"
mv "$ANDROID_HOME/cmdline-tools/cmdline-tools" "$ANDROID_HOME/cmdline-tools/latest"
yes | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --licenses >/dev/null
"$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" \
"platform-tools" "platforms;android-34" "build-tools;34.0.0" >/dev/null
- name: Provision debug keystore
env:
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
run: |
if [ -n "$ANDROID_KEYSTORE_BASE64" ]; then
echo "$ANDROID_KEYSTORE_BASE64" | base64 -d > /root/debug.keystore
else
keytool -keyalg RSA -genkeypair -alias androiddebugkey -keypass android \
-keystore /root/debug.keystore -storepass android \
-dname "CN=Android Debug,O=Android,C=US" -validity 9999
fi
sed -i 's@keystore/debug=".*"@keystore/debug="/root/debug.keystore"@g' export_presets.cfg
- name: Write Godot editor settings (Android SDK / JDK paths)
run: |
mkdir -p ~/.config/godot
cat > ~/.config/godot/editor_settings-4.tres <<EOF
[gd_resource type="EditorSettings" format=3]
[resource]
export/android/android_sdk_path = "/opt/android-sdk"
export/android/java_sdk_path = "/usr/lib/jvm/java-17-openjdk-amd64"
export/android/debug_keystore = "/root/debug.keystore"
export/android/debug_keystore_user = "androiddebugkey"
export/android/debug_keystore_pass = "android"
EOF
- name: Restore import cache
uses: actions/download-artifact@v3
with:
name: godot-import-cache
path: .godot
- name: Prepare output dir
run: mkdir -p releases/android
- name: Export Android APK
run: godot --headless --export-debug "AndroidDebug" "releases/android/Puzzle-Quest.apk"
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: PuzzleQuest-Android
path: releases/android
if-no-files-found: error
retention-days: 14
+6 -4
View File
@@ -149,10 +149,12 @@ re-author it with Godot 4's built-in `theme_override_constants/outline_size`
## CI
Build pipeline is in `releases/.drone.yml`. The Docker images still pin
`barichello/godot-ci:3.3.2` and a custom `devcrea/godot-ci:3.3.2-android`
— **bump these to a 4.x image** before relying on CI builds again. Butler
push targets `dev-crea/ahog:windows|android|linux|mac` on itch.io.
Gitea Actions workflow at `.gitea/workflows/build.yml`, documented in
`.gitea/workflows/README.md`. Three jobs: GDScript validation
(`godot --headless --import` + error grep), desktop matrix
(Windows / Linux / macOS), and Android. Build only — no Butler / itch.io
deploy currently wired (channels used historically were
`dev-crea/ahog:windows|android|linux|mac`). Drone pipeline removed.
Branches: default `dev`, releases from `main`. Long-running migration work
on `feature/godot-migration`.
-2
View File
@@ -1,5 +1,3 @@
[![Build Status](https://drone.dev-crea.com/api/badges/Athena/game-source/status.svg)](https://drone.dev-crea.com/Athena/game-source)
- Hidden Object
- Tips
- Log on Android
+7
View File
@@ -0,0 +1,7 @@
# gdtoolkit / gdlint config
# https://github.com/Scony/godot-gdscript-toolkit/wiki
# Godot $-paths and typed signatures push lines well past 100 cols routinely;
# 140 keeps the rule as a "no absurdly long line" safety net without forcing
# constant manual wrapping of node paths.
max-line-length: 140
-134
View File
@@ -1,134 +0,0 @@
---
# Windows Development version
kind: pipeline
type: docker
name: WindowsDebugVersion
platform:
os: linux
arch: amd64
clone:
depth: 1
steps:
- name: WindowsDebug
image: barichello/godot-ci:3.3.2
volumes:
- name: binary
path: releases/windows
commands:
- godot --export "WindowsDebug" "releases/windows/Puzzle Quest.exe"
- name: WindowsDeploy
image: barichello/godot-ci:3.3.2
volumes:
- name: binary
path: releases/windows
environment:
BUTLER_API_KEY:
from_secret: BUTLER_API_KEY
commands:
- butler push --if-changed --ignore '.keep' "releases/windows" "dev-crea/ahog:windows"
trigger:
branch:
- dev
---
# Android Development version
kind: pipeline
type: docker
name: AndroidDebugVersion
platform:
os: linux
arch: amd64
clone:
depth: 1
steps:
- name: AndroidDebug
image: devcrea/godot-ci:3.3.2-android
volumes:
- name: binary
path: releases/android
commands:
- apt-get update
- apt-get install -y wget
- wget -O /root/debug.keystore https://u.pcloud.link/publink/show?code=XZD8dxXZSdXUyze6UHXxhssGJXHfUBI730Gk
- sed 's@keystore/debug=".*"@keystore/debug="'/root/debug.keystore'"@g' -i export_presets.cfg
# - sed 's@keystore/release_user=".*"@keystore/release_user="'$SECRET_RELEASE_KEYSTORE_USER'"@g' -i export_presets.cfg
# - sed 's@keystore/release_password=".*"@keystore/release_password="'$SECRET_RELEASE_KEYSTORE_PASSWORD'"@g' -i export_presets.cfg
- godot --export "AndroidDebug" "releases/android/Puzzle Quest.apk"
- name: AndroidDeploy
image: barichello/godot-ci:3.3.2
volumes:
- name: binary
path: releases/android
environment:
BUTLER_API_KEY:
from_secret: BUTLER_API_KEY
commands:
- butler push --if-changed --ignore '.keep' "releases/android" "dev-crea/ahog:android"
trigger:
branch:
- dev
---
# Linux Development version
kind: pipeline
type: docker
name: LinuxDebugVersion
platform:
os: linux
arch: amd64
clone:
depth: 1
steps:
- name: LinuxDebug
image: barichello/godot-ci:3.3.2
volumes:
- name: binary
path: releases/linux
commands:
- godot --export "Linux/X11Debug" "releases/linux/Puzzle Quest.x86_64"
- name: LinuxDeploy
image: barichello/godot-ci:3.3.2
volumes:
- name: binary
path: releases/linux
environment:
BUTLER_API_KEY:
from_secret: BUTLER_API_KEY
commands:
- butler push --if-changed --ignore '.keep' "releases/linux" "dev-crea/ahog:linux"
trigger:
branch:
- dev
---
# For Production version
kind: pipeline
type: docker
name: ReleaseVersion
platform:
os: linux
arch: amd64
clone:
depth: 1
trigger:
branch:
- master
+3 -3
View File
@@ -75,7 +75,7 @@ func _get_node_animated() -> Node:
func _search_button_to_use(counter: int) -> Node:
if counter == 0:
return object_first.instantiate()
elif counter == meshes.size() - 1:
if counter == meshes.size() - 1:
return object_last.instantiate()
return object_std.instantiate()
@@ -184,13 +184,13 @@ func _gyroscope_changed_right(gyroscope: Vector3) -> bool:
func _gyroscope_changed_down(gyroscope: Vector3) -> bool:
return (gyroscope.abs().z - gyroscope_value_old.abs().z) > GYROSCOPE_MAX_DIFF and \
gyroscope.z > gyroscope_value_old.z or \
(gyroscope.abs().x - gyroscope_value_old.abs().x) > GYROSCOPE_MAX_DIFF and \
(gyroscope.abs().x - gyroscope_value_old.abs().x) > GYROSCOPE_MAX_DIFF and \
gyroscope.x > gyroscope_value_old.x
func _gyroscope_changed_up(gyroscope: Vector3) -> bool:
return (gyroscope.abs().z - gyroscope_value_old.abs().z) > GYROSCOPE_MAX_DIFF and \
gyroscope.z < gyroscope_value_old.z or \
(gyroscope.abs().x - gyroscope_value_old.abs().x) > GYROSCOPE_MAX_DIFF and \
(gyroscope.abs().x - gyroscope_value_old.abs().x) > GYROSCOPE_MAX_DIFF and \
gyroscope.x < gyroscope_value_old.x
func _start_dissolve(key: String) -> void:
+5 -5
View File
@@ -9,11 +9,6 @@ extends Node
# (per-scene lock state) persists across runs.
class DB extends RefCounted:
var settings: SettingsData
var levels: Array[LevelEntry] = []
var scenes: Array[SceneEntry] = []
var _path: String
const _SETTINGS_PROPS := [
{"name": "langue", "type": "1", "auto_increment": "0"},
{"name": "gyroscope", "type": "0", "auto_increment": "0"},
@@ -36,6 +31,11 @@ class DB extends RefCounted:
{"name": "counter", "type": "1", "auto_increment": "0"},
]
var settings: SettingsData
var levels: Array[LevelEntry] = []
var scenes: Array[SceneEntry] = []
var _path: String
func _init(path: String) -> void:
_path = path
var f := FileAccess.open(path, FileAccess.READ)
+2 -2
View File
@@ -2,8 +2,6 @@ extends Control
# Application root: async scene loading + reference to the loaded Database.
@onready var animation: AnimationPlayer = Loading.get_node("AnimLoading")
var current_scene: Node = null
var current_scene_int: int = -1
var wait_frames: int = 1
@@ -11,6 +9,8 @@ var database: RefCounted = null
var loaded: bool = false
var _loading_path: String = ""
@onready var animation: AnimationPlayer = Loading.get_node("AnimLoading")
func _ready() -> void:
database = load("res://scripts/Database.gd").new().initialize()
_initialize_current_scene()