Accept empty CurseForge plugin listings and trailing whitespace on Ha… #57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Verify | |
| on: | |
| pull_request: | |
| push: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: verify-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| automation: | |
| name: Automation configuration | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Validate manifests and shell scripts | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| ./scripts/release/validate-targets.sh | |
| ./scripts/release/validate-release-config.sh --development | |
| ./scripts/release/validate-workflows.sh | |
| find scripts -type f -name '*.sh' -print0 | xargs -0 -n1 bash -n | |
| matrix: | |
| name: Read loader target matrices | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 5 | |
| outputs: | |
| forge: ${{ steps.targets.outputs.forge }} | |
| neoforge: ${{ steps.targets.outputs.neoforge }} | |
| fabric: ${{ steps.targets.outputs.fabric }} | |
| server_plugins: ${{ steps.targets.outputs.server_plugins }} | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - id: targets | |
| name: Validate and export loader families | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| ./scripts/release/validate-targets.sh | |
| for loader in forge neoforge fabric; do | |
| matrix=$(jq -c --arg loader "$loader" \ | |
| '{include: [.targets[] | select(.loader == $loader) | {target: .id, game_version: .game_version, java: (.java | tostring)}]}' \ | |
| release/targets.json) | |
| jq -e '.include | length > 0' <<<"$matrix" >/dev/null | |
| echo "${loader}=$matrix" >> "$GITHUB_OUTPUT" | |
| done | |
| ./scripts/ci/validate-server-plugin-targets.sh | |
| server_plugins=$(jq -c '{include: [.targets[] | | |
| {target: .id, platform_name: .platform_name, | |
| game_version: .game_version, java: (.java | tostring)}]}' \ | |
| ci/server-plugin-targets.json) | |
| jq -e '.include | length > 0' <<<"$server_plugins" >/dev/null | |
| echo "server_plugins=$server_plugins" >> "$GITHUB_OUTPUT" | |
| forge: | |
| name: Forge / ${{ matrix.game_version }} (JDK ${{ matrix.java }}) | |
| needs: matrix | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 6 | |
| matrix: ${{ fromJSON(needs.matrix.outputs.forge) }} | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install target JDK ${{ matrix.java }} for the Gradle toolchain | |
| uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 | |
| with: | |
| distribution: temurin | |
| java-version: ${{ matrix.java }} | |
| - name: Install the JDK 21 Gradle launcher (Loom is configured on every invocation) | |
| uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| cache: gradle | |
| - name: Build and test | |
| run: ./scripts/ci/build-target.sh "${{ matrix.target }}" | |
| neoforge: | |
| name: NeoForge / ${{ matrix.game_version }} (JDK ${{ matrix.java }}) | |
| needs: matrix | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 6 | |
| matrix: ${{ fromJSON(needs.matrix.outputs.neoforge) }} | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install target JDK ${{ matrix.java }} for the Gradle toolchain | |
| uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 | |
| with: | |
| distribution: temurin | |
| java-version: ${{ matrix.java }} | |
| - name: Install the JDK 21 Gradle launcher (Loom is configured on every invocation) | |
| uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| cache: gradle | |
| - name: Build and test | |
| run: ./scripts/ci/build-target.sh "${{ matrix.target }}" | |
| fabric: | |
| name: Fabric / ${{ matrix.game_version }} (JDK ${{ matrix.java }}) | |
| needs: matrix | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 6 | |
| matrix: ${{ fromJSON(needs.matrix.outputs.fabric) }} | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install target JDK ${{ matrix.java }} for the Gradle toolchain | |
| uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 | |
| with: | |
| distribution: temurin | |
| java-version: ${{ matrix.java }} | |
| - name: Install the JDK 21 Gradle launcher (Loom is configured on every invocation) | |
| uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| cache: gradle | |
| - name: Build and test | |
| run: ./scripts/ci/build-target.sh "${{ matrix.target }}" | |
| server-plugin: | |
| name: ${{ matrix.platform_name }} / ${{ matrix.game_version }} (JDK ${{ matrix.java }}) | |
| needs: matrix | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 35 | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 2 | |
| matrix: ${{ fromJSON(needs.matrix.outputs.server_plugins) }} | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install target JDK ${{ matrix.java }} for the exact server runtime | |
| uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 | |
| with: | |
| distribution: temurin | |
| java-version: ${{ matrix.java }} | |
| - name: Install the JDK 21 Gradle launcher | |
| uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| cache: gradle | |
| - name: Build and test against the exact server | |
| run: ./scripts/ci/run-server-plugin-target.sh "${{ matrix.target }}" build | |
| - name: Inspect the production-shaped plugin JAR | |
| run: >- | |
| ./scripts/ci/run-server-plugin-target.sh "${{ matrix.target }}" verify | |
| "build/server-plugin-ci/${{ matrix.target }}/verified-plugin" |