* Remap 1.21.6 to Mojang mappings * start working on automation * update newVersion script to use manifest * update scripts * update doc * add dispatchable bump workflow * update workflow env * update workflows
100 lines
2.5 KiB
YAML
100 lines
2.5 KiB
YAML
name: Java CI with Gradle
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
define-versions:
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
versions: ${{ steps.versions.outputs.versions }}
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Define Versions
|
|
id: versions
|
|
run: |
|
|
versions="["
|
|
for item in $(ls mc); do
|
|
versions+="\"$item\", "
|
|
done
|
|
|
|
versions="${versions%,*}]"
|
|
echo "versions=$versions" >> "$GITHUB_OUTPUT"
|
|
- name: Ensure that versions.json includes all versions
|
|
run: node -e 'const fs = require("fs"); const versions = JSON.parse(fs.readFileSync("versions.json", "utf8")); const expectedVersions = fs.readdirSync("mc"); if (expectedVersions.length !== versions.length || !expectedVersions.every(v => versions.includes(v))) { throw new Error("versions.json does not match the expected versions in mc/ folder"); }'
|
|
|
|
build:
|
|
needs: define-versions
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
version: ${{ fromJSON(needs.define-versions.outputs.versions) }}
|
|
|
|
name: Build ${{ matrix.version }}
|
|
timeout-minutes: 10
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Validate Gradle wrapper
|
|
uses: gradle/actions/wrapper-validation@v4
|
|
|
|
- name: Set up JDK 21
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: '21'
|
|
distribution: 'temurin'
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v4
|
|
with:
|
|
add-job-summary-as-pr-comment: on-failure
|
|
|
|
- name: Generate ${{ matrix.version }}
|
|
run: ./gradlew :mc:${{ matrix.version }}:runServer --stacktrace
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: data-${{ matrix.version }}
|
|
path: mc/${{ matrix.version }}/run/server/minecraft-data
|
|
if-no-files-found: error
|
|
|
|
repackage:
|
|
needs: build
|
|
|
|
name: Repackage versions
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
merge-multiple: true
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: merged-data
|
|
path: artifacts/*
|
|
if-no-files-found: error
|