Build source-bound Golden Path release overlays

This commit is contained in:
unimatrixgit 2026-12-05 19:32:12 +01:00
commit 5c8361b920

View file

@ -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