diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9e8147b..7432f2a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,10 +6,10 @@ on: tags-ignore: [ "**" ] pull_request: release: - types: [ released ] + types: [ released, prereleased ] concurrency: - group: ${{ github.workflow }}-${{ github.event.number || github.ref }} + group: "${{ github.workflow }}-${{ github.event.number || github.ref }}" cancel-in-progress: true jobs: @@ -21,17 +21,17 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Validate Gradle Wrapper - uses: gradle/wrapper-validation-action@v1 + uses: gradle/actions/wrapper-validation@v3 - name: Set up JDK 17 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: 17 - distribution: 'temurin' - cache: 'gradle' + distribution: "temurin" + cache: "gradle" - name: Build Artifact run: ./gradlew build @@ -41,21 +41,14 @@ jobs: run: echo "ARTIFACT_PATH=$(./gradlew getArtifactPath -q)" >> $GITHUB_ENV - name: Upload Artifact to Actions - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ github.event.repository.name }} path: ${{ env.ARTIFACT_PATH }} - - - name: Determine Status - run: | - if [ "$(./gradlew properties | awk '/^version:/ { print $2; }' | grep '\-SNAPSHOT')" ]; then - echo "STATUS=snapshot" >> $GITHUB_ENV - else - echo "STATUS=release" >> $GITHUB_ENV - fi + if-no-files-found: error - name: Upload Artifact to Release - if: ${{ env.STATUS == 'release' && github.event_name == 'release' }} + if: ${{ github.event_name == 'release' }} uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} @@ -64,15 +57,15 @@ jobs: tag: ${{ github.ref }} - name: Update Changelog - if: ${{ env.STATUS == 'release' && github.event_name == 'release' }} + if: ${{ github.event_name == 'release' }} uses: stefanzweifel/changelog-updater-action@v1 with: latest-version: ${{ github.event.release.tag_name }} release-notes: ${{ github.event.release.body }} - name: Commit Updated Changelog - if: ${{ env.STATUS == 'release' && github.event_name == 'release' }} - uses: stefanzweifel/git-auto-commit-action@v4 + if: ${{ github.event_name == 'release' }} + uses: stefanzweifel/git-auto-commit-action@v5 with: branch: ${{ github.event.release.target_commitish }} commit_message: Update CHANGELOG