diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e41659c51..2737556e4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,8 +15,7 @@ jobs: release: strategy: matrix: - base_jdk: [21] - graal: [latest] + base_jdk: [17] os: [ubuntu-22.04] if: "!startsWith(github.event.commits[0].message, '[CI-Skip]')" @@ -27,11 +26,12 @@ jobs: - name: Checkout javadocs uses: actions/checkout@v4 + if: github.ref_name == env.MAIN_BRANCH with: repository: PlazmaMC/Javadocs path: javadoc ref: main - token: ${{ secrets.GH_PAT }} + token: ${{ secrets.GITHUB_TOKEN }} - name: Validate Gradle Wrapper uses: gradle/wrapper-validation-action@v1 @@ -39,9 +39,9 @@ jobs: - name: Set up GraalVM ${{ matrix.base_jdk }} uses: graalvm/setup-graalvm@v1 with: - github-token: ${{ secrets.GH_PAT }} + github-token: ${{ secrets.GITHUB_TOKEN }} java-version: ${{ matrix.base_jdk }} - version: ${{ matrix.graal }} + version: latest cache: 'gradle' - name: Configure Git @@ -72,11 +72,11 @@ jobs: if: github.ref_name == env.MAIN_BRANCH run: | export GITHUB_USERNAME=${{ env.ORG_NAME }} - export GITHUB_TOKEN=${{ secrets.GH_PAT }} + export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} ./gradlew publish --stacktrace - name: Upload Artifacts - if: env.DEBUG == 'true' || !startsWith(github.ref_name, 'ver/') + if: "!startsWith(github.ref_name, 'ver/')" uses: actions/upload-artifact@v3 with: name: Artifacts @@ -85,24 +85,40 @@ jobs: Plazma-API/build/docs/javadoc - name: Get Release Number - run: echo "RELEASE=$(git ls-remote --tags origin | grep "release" | wc -l)" >> $GITHUB_ENV + if: startsWith(github.ref_name, 'ver/') + run: echo "RELEASE=$(git ls-remote --tags origin | grep "build/${{ env.MC_VERSION }}" | wc -l)" >> $GITHUB_ENV - name: Release Artifacts if: startsWith(github.ref_name, 'ver/') - uses: marvinpinto/action-automatic-releases@latest + uses: softprops/action-gh-release@v0.1.15 with: - title: "Release #${{ env.RELEASE }}" - automatic_release_tag: release-${{ env.RELEASE }} - repo_token: "${{ secrets.GH_PAT }}" + name: "Build #${{ env.RELEASE }} for ${{ env.MC_VERSION }}" + tag_name: build/${{ env.MC_VERSION }}/${{ env.RELEASE }} + target_commitish: ${{ github.ref_name }} + generate_release_notes: true + fail_on_unmatched_files: true files: build/libs/*.jar - prerelease: false - - name: Release Artifacts (Latest) + - name: Release Artifacts (Latest/Stable) if: startsWith(github.ref_name, 'ver/') - uses: marvinpinto/action-automatic-releases@latest + uses: softprops/action-gh-release@v0.1.15 with: - title: "Release #${{ env.RELEASE }}" - automatic_release_tag: latest-${{ env.MC_VERSION }} - repo_token: "${{ secrets.GH_PAT }}" + name: "Build #${{ env.RELEASE }} for ${{ env.MC_VERSION }}" + tag_name: build/${{ env.MC_VERSION }}/latest + target_commitish: ${{ github.ref_name }} + generate_release_notes: true + fail_on_unmatched_files: true files: build/libs/*.jar + + - name: Release Artifacts (Latest/Development) + if: startsWith(github.ref_name, 'dev/') + uses: softprops/action-gh-release@v0.1.15 + with: + name: "Development Build for ${{ env.MC_VERSION }}" + tag_name: build/${{ env.MC_VERSION }}/latest + target_commitish: ${{ github.ref_name }} + generate_release_notes: true + fail_on_unmatched_files: true + files: build/libs/*.jar + prerelease: false