From 5c8361b9205271193413b5f9870ce5ff08bc7053 Mon Sep 17 00:00:00 2001 From: unimatrixgit <95320811+unimatrixgit@users.noreply.github.com> Date: Sat, 5 Dec 2026 19:32:12 +0100 Subject: [PATCH] Build source-bound Golden Path release overlays --- .forgejo/workflows/golden-path.yml | 59 ++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .forgejo/workflows/golden-path.yml diff --git a/.forgejo/workflows/golden-path.yml b/.forgejo/workflows/golden-path.yml new file mode 100644 index 00000000..ce1782a0 --- /dev/null +++ b/.forgejo/workflows/golden-path.yml @@ -0,0 +1,59 @@ +name: Golden Path Quest Overlay +on: + workflow_dispatch: + push: + branches: ['feat/golden-path-finish-plugins-*'] + +jobs: + golden-path: + runs-on: dune-ci + steps: + - name: Check out exact revision + shell: bash + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -euo pipefail + git init . + git -c http.extraheader="AUTHORIZATION: basic $(printf 'x-access-token:%s' "$REPO_TOKEN" | base64 -w0)" fetch --depth=1 https://www.dunerealms.com/git/unimatrix/plugins.git "$GITHUB_SHA" + git checkout --detach FETCH_HEAD + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '21' + - uses: gradle/actions/setup-gradle@v4 + with: + gradle-version: '9.2.1' + - name: Build and verify scoped quest payloads + shell: bash + run: | + set -euo pipefail + gradle --no-daemon -p JarvisConnector test jar + gradle --no-daemon -p DuneRealmsGUI test jar + mkdir golden-path + PYTHONPATH=tools python3 - <<'PY' + from pathlib import Path + from golden_path_artwork import ART, CATALOG, artwork + from plugin_golden_path import MODULES + from plugin_wild_update import read_archive, write_archive + + root = Path(".") + output = Path("golden-path") + paths = {"gui": "DuneRealmsGUI/build/libs/DunerealmsGUI.jar", + "jarvis": "JarvisConnector/build/libs/jarvistranslator.jar"} + for name, (prefix, changed, added, resource) in MODULES.items(): + jar = read_archive(Path(paths[name]).read_bytes()) + entries = [prefix + cls + ".class" for cls in (*changed, *added)] + [resource] + (output / (name + "-donor.zip")).write_bytes(write_archive({entry: jar[entry] for entry in entries})) + art = {f"{ART}/{entry}": data for entry, data in artwork(root).items()} + art[CATALOG] = Path(CATALOG).read_bytes() + (output / "artwork.zip").write_bytes(write_archive(art)) + PY + cp tools/{GoldenPathMerge.java,plugin_golden_path.py,golden_path_artwork.py,plugin_wild_update.py} golden-path/ + printf '%s\n' "$GITHUB_SHA" > golden-path/SOURCE_COMMIT + (cd golden-path && sha256sum -- *.zip *.py *.java SOURCE_COMMIT > SHA256SUMS) + - uses: actions/upload-artifact@v3 + with: + name: DuneRealms-Golden-Path + path: golden-path + if-no-files-found: error