diff --git a/.github/workflows/release-publish.yml b/.github/workflows/release-publish.yml index 591228d..dc1022e 100644 --- a/.github/workflows/release-publish.yml +++ b/.github/workflows/release-publish.yml @@ -8,10 +8,13 @@ on: - master jobs: - release: + prepare: if: github.event.pull_request.merged == true && github.head_ref == 'develop' runs-on: ubuntu-latest + outputs: + version: ${{ steps.bump_version.outputs.version }} + steps: - name: Checkout master branch @@ -32,23 +35,79 @@ jobs: run: | mvn versions:set -DremoveSnapshot=true -DgenerateBackupPoms=false NEW_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) - echo "VERSION=$NEW_VERSION" >> $GITHUB_ENV + echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT - name: Commit and Push to Master run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - git commit -am "chore: release version ${{ env.VERSION }}" + git commit -am "chore: release version ${{ steps.bump_version.outputs.version }}" git push origin master - - name: Package Application + package: + if: github.event.pull_request.merged == true && github.head_ref == 'develop' + needs: prepare + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + profile: + - win-x86-64 + - linux-x86-64 + - linux-aarch64 + + steps: + + - name: Checkout master branch + uses: actions/checkout@v4 + with: + ref: master + token: ${{ secrets.PAT_TOKEN }} + + - name: Set up JDK 25 + uses: actions/setup-java@v4 + with: + java-version: '25' + distribution: 'temurin' + cache: 'maven' + + - name: Package Application (${{ matrix.profile }}) # Tests are skipped because they already passed in the PR Validation workflow - run: mvn clean package -DskipTests + run: mvn clean package -DskipTests -P${{ matrix.profile }} + + - name: Copy release jar with profile suffix + shell: bash + run: | + mkdir -p dist + VERSION='${{ needs.prepare.outputs.version }}' + JAR_NAME="VGreeter-${VERSION}-${{ matrix.profile }}.jar" + cp target/*.jar "dist/${JAR_NAME}" + + - name: Upload release artifact + uses: actions/upload-artifact@v4 + with: + name: VGreeter-${{ needs.prepare.outputs.version }}-${{ matrix.profile }} + path: dist/*.jar + if-no-files-found: error + + release: + if: github.event.pull_request.merged == true && github.head_ref == 'develop' + needs: [prepare, package] + runs-on: ubuntu-latest + + steps: + + - name: Download all release artifacts + uses: actions/download-artifact@v4 + with: + path: dist + merge-multiple: true - name: Publish GitHub Release uses: softprops/action-gh-release@v2 with: - tag_name: v${{ env.VERSION }} - name: Release v${{ env.VERSION }} - files: target/*.jar + tag_name: v${{ needs.prepare.outputs.version }} + name: Release v${{ needs.prepare.outputs.version }} + files: dist/*.jar generate_release_notes: true diff --git a/pom.xml b/pom.xml index 2f68f52..788efd1 100644 --- a/pom.xml +++ b/pom.xml @@ -37,10 +37,6 @@ org.springframework.boot spring-boot-starter-data-jpa - - org.springframework.boot - spring-boot-configuration-processor - @@ -53,21 +49,6 @@ jdave-api ${jdave.version} - - club.minnced - jdave-native-win-x86-64 - ${jdave.version} - - - club.minnced - jdave-native-linux-x86-64 - ${jdave.version} - - - club.minnced - jdave-native-linux-aarch64 - ${jdave.version} - @@ -81,12 +62,6 @@ 0.8 - - - ch.qos.logback - logback-classic - - com.fasterxml.jackson.core @@ -133,6 +108,11 @@ + + org.springframework.boot + spring-boot-maven-plugin + + org.apache.maven.plugins maven-compiler-plugin @@ -155,12 +135,60 @@ - - org.springframework.boot - spring-boot-maven-plugin - - + + + win-x86-64 + + + Windows + amd64 + + + + + club.minnced + jdave-native-win-x86-64 + ${jdave.version} + + + + + + linux-x86-64 + + + Linux + amd64 + + + + + club.minnced + jdave-native-linux-x86-64 + ${jdave.version} + + + + + + linux-aarch64 + + + Linux + aarch64 + + + + + club.minnced + jdave-native-linux-aarch64 + ${jdave.version} + + + + + \ No newline at end of file