From a756be326bb0bfa2da8f5e59ae0141339b82f0e1 Mon Sep 17 00:00:00 2001 From: Yordan Atanasov Date: Tue, 24 Sep 2024 15:46:56 +0300 Subject: [PATCH] fix: Move jdk and build steps to release jobs. --- .github/workflows/tag-release.yml | 44 ++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index df2b794f0..b6ed8f4bb 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -38,12 +38,6 @@ jobs: with: ref: dev - - name: Write release version - run: | - VERSION=${{ github.event.inputs.tag_name }} - echo "Releasing version: $VERSION" - sed -i -e 's@version = .\d*.\d*.\d*.*@version = "'"$VERSION"'"@g' build.gradle.kts - - name: Create or use provided tag run: | # Use provided tag from the input @@ -62,15 +56,6 @@ jobs: restore-keys: | gradle-${{ runner.os }} - - name: Set up JDK 21 - uses: actions/setup-java@v4 - with: - java-version: '21' - distribution: 'corretto' - - - name: Build Gradle Project - run: ./gradlew build - github-release: name: Create GitHub Release runs-on: ubuntu-latest @@ -91,7 +76,24 @@ jobs: token: ${{ github.token }} tag: ${{ github.event.inputs.tag_name }} + - name: Write release version + if: always() + run: | + VERSION=${{ github.event.inputs.tag_name }} + echo "Releasing version: $VERSION" + sed -i -e 's@version = .\d*.\d*.\d*.*@version = "'"$VERSION"'"@g' build.gradle.kts + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'corretto' + + - name: Build Gradle Project + run: ./gradlew build + - name: Create release + if: always() id: create_release uses: actions/create-release@v1 env: @@ -99,11 +101,12 @@ jobs: with: tag_name: ${{ github.event.inputs.tag_name }} release_name: Release ${{ github.event.inputs.tag_name }} - body: ${{ steps.changelog.outputs.changes }} + body: ${{ steps.changelog.outputs.changes || 'No changelog available' }} draft: false prerelease: false - name: Upload Release Asset + if: always() id: upload-release-asset uses: actions/upload-release-asset@v1 env: @@ -125,6 +128,15 @@ jobs: with: ref: ${{ github.event.inputs.tag_name }} + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'corretto' + + - name: Build Gradle Project + run: ./gradlew build + - name: Unzip WAR file run: | ls -l