Repository navigation
feat: added sponge 11+ support #501
Workflow file for this run
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: Java CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| schedule: | |
| - cron: "0 0 * * 0" # weekly | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| name: Java ${{ matrix.java }} - ${{ matrix.storageType }} | |
| strategy: | |
| matrix: | |
| include: | |
| - storageType: mariadb | |
| java: 21 | |
| - storageType: h2 | |
| java: 21 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Set up JDK 17 for Fabric 1.20.x builds (Gradle toolchain will use this) | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 17 | |
| distribution: "temurin" | |
| # Set up JDK 21 as the primary JDK | |
| - name: Set up JDK ${{ matrix.java }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: ${{ matrix.java }} | |
| distribution: "temurin" | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| cache-read-only: ${{ github.ref != 'refs/heads/master' }} | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .gradle/loom-cache | |
| key: ${{ runner.os }}-loom-${{ hashFiles('**/libs.versions.*', '**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: ${{ runner.os }}-loom- | |
| - name: Execute Gradle build | |
| env: | |
| STORAGE_TYPE: ${{ matrix.storageType }} | |
| run: ./gradlew build --build-cache --info | |
| # Build all Fabric versions | |
| - name: Build all Fabric versions | |
| run: ./gradlew :fabric:1.20.1:remapJar :fabric:1.21.1:remapJar :fabric:1.21.4:remapJar --build-cache | |
| # Build both Sponge modules (legacy API 7 and modern API 11+) | |
| - name: Build Sponge modules | |
| run: ./gradlew :BanManagerSponge:shadowJar :BanManagerSponge7:shadowJar --build-cache | |
| - name: Publish to Maven Central | |
| # only publish once | |
| if: github.ref == 'refs/heads/master' && matrix.java == '21' && matrix.storageType == 'mariadb' | |
| env: | |
| ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEUSERNAME }} | |
| ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEPASSWORD }} | |
| ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY }} | |
| ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }} | |
| run: | | |
| VERSION=$(grep "^version=" gradle.properties | cut -d'=' -f2) | |
| if [[ "$VERSION" == *"SNAPSHOT"* ]]; then | |
| # SNAPSHOT: publish to snapshot repository (no staging/release) | |
| ./gradlew publishToSonatype | |
| else | |
| # Release: publish, stage, and release to Maven Central | |
| ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository | |
| fi |