Build and verify central pack candidates in development CI

This commit is contained in:
unimatrixgit 2026-11-28 14:34:50 +01:00
commit 09cba2e732

View file

@ -1,5 +1,6 @@
name: DuneRealms Resourcepack CI
on:
workflow_dispatch:
push:
branches: [main]
paths:
@ -16,6 +17,7 @@ on:
- '.forgejo/workflows/resourcepack-ci.yml'
jobs:
resourcepack:
if: github.repository == 'unimatrix/MC' && github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: dune-ci
steps:
- name: Checkout exact reviewed revision
@ -63,3 +65,46 @@ jobs:
JarvisConnector/build/libs/jarvistranslator.jar
if-no-files-found: error
retention-days: 7
central-pack-development:
if: github.repository == 'dev/MC' && github.event_name == 'workflow_dispatch'
runs-on: dune-ci
steps:
- name: Check out exact development 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/${GITHUB_REPOSITORY}.git" "$GITHUB_SHA"
git checkout --detach FETCH_HEAD
test "$(git rev-parse HEAD)" = "$GITHUB_SHA"
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Verify baseline and build a central pack candidate
shell: bash
run: |
set -euo pipefail
node --test tools/build-planet-texture-packs.test.mjs
curl --fail --location --retry 2 https://www.dunerealms.com/downloads/DuneRealms-Network-Artwork-v3.zip -o central-pack-baseline.zip
python3 - <<'PYTHON'
import pathlib
import runpy
repair = runpy.run_path('tools/build-resourcepack-repair.py')
entries = repair['read_pack'](pathlib.Path('central-pack-baseline.zip'), repair['OLD_NETWORK'])
for name, data in repair['world_artwork'](entries).items():
target = pathlib.Path('central-pack-base') / name
target.parent.mkdir(parents=True, exist_ok=True)
target.write_bytes(data)
PYTHON
node tools/build-central-resource-pack.mjs central-pack-base central-pack-output 1
printf '%s\n' "$GITHUB_SHA" > central-pack-output/SOURCE_COMMIT
(cd central-pack-output && sha256sum -- *.zip central-pack-manifest.json SOURCE_COMMIT > SHA256SUMS)
- uses: actions/upload-artifact@v3
with:
name: DuneRealms-Central-Pack-Development
path: central-pack-output/
if-no-files-found: error
retention-days: 7