plugins/.forgejo/workflows/guild-cookbook.yml
unimatrixgit 5bb36a4eb2
Some checks failed
Guild and Cookbook Overlay / guild-cookbook (push) Successful in 2m27s
DuneRealms Resourcepack CI / resourcepack (push) Has been cancelled
DuneRealms Plugin CI / plugins (push) Has been cancelled
Package a scoped Guild and Cookbook overlay for each retained variant
2026-12-04 20:35:31 +01:00

54 lines
2.1 KiB
YAML

name: Guild and Cookbook Overlay
on:
workflow_dispatch:
push:
branches: ['fix/guild-navigator-*']
jobs:
guild-cookbook:
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: Test and package exact overlay donors
shell: bash
run: |
set -euo pipefail
for module in DuneRealmsGUI DuneNPC DuneLobby; do
gradle --no-daemon -p "$module" test jar
done
mkdir guild-cookbook
PYTHONPATH=tools python3 - <<'PY'
from pathlib import Path
from plugin_guild_cookbook import CLASSES
from plugin_wild_update import read_archive, write_archive
for module, jar in (
("gui", "DuneRealmsGUI/build/libs/DunerealmsGUI.jar"),
("npc", "DuneNPC/build/libs/DuneRealms-NPC.jar"),
("lobby", "DuneLobby/build/libs/DuneRealms-Lobby.jar"),
):
entries = read_archive(Path(jar).read_bytes())
Path(f"guild-cookbook/{module}.zip").write_bytes(write_archive({entry: entries[entry] for entry in CLASSES[module]}))
PY
cp tools/{GuildCookbookMerge.java,plugin_guild_cookbook.py,plugin_wild_update.py} guild-cookbook/
printf '%s\n' "$GITHUB_SHA" > guild-cookbook/SOURCE_COMMIT
(cd guild-cookbook && sha256sum -- *.zip *.py *.java SOURCE_COMMIT > SHA256SUMS)
- uses: actions/upload-artifact@v3
with:
name: DuneRealms-Guild-Cookbook
path: guild-cookbook
if-no-files-found: error