Skip to content

Commit

Permalink
fix: Move jdk and build steps to release jobs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zurcusa committed Sep 24, 2024
1 parent 87940c9 commit a756be3
Showing 1 changed file with 28 additions and 16 deletions.
44 changes: 28 additions & 16 deletions .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -91,19 +76,37 @@ 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:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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:
Expand All @@ -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
Expand Down

0 comments on commit a756be3

Please sign in to comment.