65 lines
2.5 KiB
YAML
65 lines
2.5 KiB
YAML
name: DuneRealms Plugin CI
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- '.forgejo/workflows/plugins.yml'
|
|
- 'Dune*/**'
|
|
- 'JarvisConnector/**'
|
|
- 'gui-common/**'
|
|
- 'citizens-common/**'
|
|
- 'network/resource-pack/shared/**'
|
|
- 'network/content-assets/planet-artwork/profiles.json'
|
|
- 'tools/*gameplay*'
|
|
|
|
jobs:
|
|
plugins:
|
|
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 build first-party plugins
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
modules=(DuneEss DuneLobby DuneNPC DuneRealms-minecraft-only DuneRealmsGUI DuneTerrain JarvisConnector)
|
|
mkdir -p plugin-artifacts
|
|
for module in "${modules[@]}"; do
|
|
gradle --no-daemon -p "$module" test jar
|
|
for jar in "$module"/build/libs/*.jar; do
|
|
test -f "$jar"
|
|
artifact="plugin-artifacts/${jar##*/}"
|
|
test ! -e "$artifact"
|
|
cp "$jar" "$artifact"
|
|
done
|
|
done
|
|
printf '%s\n' "$(git rev-parse HEAD)" > plugin-artifacts/SOURCE_COMMIT
|
|
(cd plugin-artifacts && sha256sum -- *.jar SOURCE_COMMIT > SHA256SUMS)
|
|
- name: Validate gameplay assets and build pack with original GUI
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
python3 tools/test_gameplay_resourcepack.py -v
|
|
python3 tools/build-gameplay-resourcepack.py --from-gui-config DuneRealmsGUI/src/main/resources/gui-pack.yml --output "plugin-artifacts/DuneRealms-Gameplay-${GITHUB_SHA}.zip"
|
|
python3 tools/write-plugin-manifest.py plugin-artifacts "$GITHUB_SHA"
|
|
(cd plugin-artifacts && sha256sum -- *.jar *.zip *.json SOURCE_COMMIT > SHA256SUMS)
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: DuneRealms-Plugins
|
|
path: plugin-artifacts/
|
|
if-no-files-found: error
|

Staff