Build and test all Minecraft plugins in DuneGit CI
This commit is contained in:
parent
88ff96791d
commit
f100733dd2
1 changed files with 51 additions and 0 deletions
51
.forgejo/workflows/plugins.yml
Normal file
51
.forgejo/workflows/plugins.yml
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
name: DuneRealms Plugin CI
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [main, ci/plugin-build]
|
||||
paths:
|
||||
- '.forgejo/workflows/plugins.yml'
|
||||
- 'Dune*/**'
|
||||
- 'JarvisConnector/**'
|
||||
- 'gui-common/**'
|
||||
|
||||
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/MC.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 DuneKits DuneLobby DuneNPC DuneRealms-minecraft-only DuneRealmsGUI DuneTerrain JarvisConnector)
|
||||
mkdir -p plugin-artifacts
|
||||
for module in "${modules[@]}"; do
|
||||
gradle --no-daemon -p "$module" test jar
|
||||
jars=("$module"/build/libs/*.jar)
|
||||
test "${#jars[@]}" -eq 1
|
||||
test -f "${jars[0]}"
|
||||
cp "${jars[0]}" "plugin-artifacts/$module.jar"
|
||||
done
|
||||
printf '%s\n' "$(git rev-parse HEAD)" > plugin-artifacts/SOURCE_COMMIT
|
||||
(cd plugin-artifacts && sha256sum -- *.jar SOURCE_COMMIT > SHA256SUMS)
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: DuneRealms-Plugins
|
||||
path: plugin-artifacts/
|
||||
if-no-files-found: error
|
||||
Loading…
Reference in a new issue

Staff