diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5ed4f50..6b0acc7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,22 +1,38 @@ name: Build -on: [push] +on: [ push, workflow_dispatch ] jobs: build: + strategy: + matrix: + java: [ 21 ] + os: [ ubuntu-latest ] + runs-on: ${{ matrix.os }} - runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 - container: - image: openjdk:17-jdk - options: --user root + - name: Validate Gradle wrapper + uses: gradle/wrapper-validation-action@v1 - steps: - - uses: actions/checkout@v2.2.0 - - run: | - chmod +x ./gradlew - ./gradlew build - - uses: actions/upload-artifact@v2 - with: - name: build-artifacts - path: build/libs/ \ No newline at end of file + - name: Setup JDK ${{ matrix.java }} + uses: actions/setup-java@v3 + with: + distribution: zulu + java-version: ${{ matrix.java }} + + - name: Make Gradle wrapper executable + run: chmod +x ./gradlew + + - name: Build + run: ./gradlew build --stacktrace --parallel + + - name: Capture build artifacts + uses: actions/upload-artifact@v3 + with: + name: Artifacts + path: build/libs/ \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 10a7ebb..cc14200 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,24 +1,39 @@ name: Release -on: [workflow_dispatch] +on: [ workflow_dispatch ] jobs: release: + strategy: + matrix: + java: [ 21 ] + os: [ ubuntu-latest ] - runs-on: ubuntu-latest - - container: - image: openjdk:17-jdk - options: --user root + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2.2.0 - - run: | - chmod +x ./gradlew - ./gradlew build publish github curseforge modrinth --stacktrace - env: - CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }} - GITHUB_TOKEN: ${{ secrets.GH_API_KEY }} - MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} - MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} \ No newline at end of file + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Validate Gradle wrapper + uses: gradle/wrapper-validation-action@v1 + + - name: Setup JDK ${{ matrix.java }} + uses: actions/setup-java@v3 + with: + distribution: zulu + java-version: ${{ matrix.java }} + + - name: Make Gradle wrapper executable + run: chmod +x ./gradlew + + - name: Build + run: ./gradlew build publish github curseforge modrinth --stacktrace + env: + CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }} + GITHUB_TOKEN: ${{ secrets.GH_API_KEY }} + MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} \ No newline at end of file