Build the exact elytra anvil overlay in CI
This commit is contained in:
parent
0b9cbc4b8e
commit
70cc6a9f70
1 changed files with 47 additions and 0 deletions
47
.forgejo/workflows/elytra-anvil.yml
Normal file
47
.forgejo/workflows/elytra-anvil.yml
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
name: Elytra Anvil Overlay
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: ['feat/anvil-elytra-merge-*']
|
||||
|
||||
jobs:
|
||||
elytra-anvil:
|
||||
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 JARVIS and build the anvil overlay
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
gradle --no-daemon -p JarvisConnector test jar
|
||||
mkdir elytra-anvil
|
||||
PYTHONPATH=tools python3 - <<'PY'
|
||||
from pathlib import Path
|
||||
from plugin_elytra_anvil import ADDED, CHANGED, entry
|
||||
from plugin_wild_update import read_archive, write_archive
|
||||
source = read_archive(Path("JarvisConnector/build/libs/jarvistranslator.jar").read_bytes())
|
||||
Path("elytra-anvil/donor.zip").write_bytes(write_archive({entry(name): source[entry(name)] for name in (*CHANGED, *ADDED)}))
|
||||
PY
|
||||
cp tools/{ElytraAnvilOverlay.java,plugin_elytra_anvil.py,plugin_wild_update.py} elytra-anvil/
|
||||
printf '%s\n' "$GITHUB_SHA" > elytra-anvil/SOURCE_COMMIT
|
||||
(cd elytra-anvil && sha256sum -- *.zip *.py *.java SOURCE_COMMIT > SHA256SUMS)
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: DuneRealms-Elytra-Anvil
|
||||
path: elytra-anvil
|
||||
if-no-files-found: error
|
||||
Loading…
Reference in a new issue

Staff