From 5f09b0e57b0dad8621123ec6957da1ae9f5e5ab3 Mon Sep 17 00:00:00 2001 From: Zdenek Jonas Date: Mon, 8 Dec 2025 11:28:19 +0100 Subject: [PATCH 1/4] feat: add native JAR build step and make project version input optional in maven workflows --- .github/workflows/maven_deploy_snapshot.yml | 11 +++++++++++ .github/workflows/maven_jni_25.yml | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven_deploy_snapshot.yml b/.github/workflows/maven_deploy_snapshot.yml index 087bc4af..68392724 100644 --- a/.github/workflows/maven_deploy_snapshot.yml +++ b/.github/workflows/maven_deploy_snapshot.yml @@ -31,3 +31,14 @@ jobs: MAVEN_PASSWORD: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }} MAVEN_GPG_PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }} MAVEN_GPG_KEY: ${{ secrets.ORG_GPG_PRIVATE_KEY }} + + build-native-jar: + needs: publish + uses: ./.github/workflows/maven_jni_25.yml + with: + project-version: UNCHANGED + secrets: + MAVEN_USERNAME: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }} + GPG_PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }} + GPG_PRIVATE_KEY: ${{ secrets.ORG_GPG_PRIVATE_KEY }} diff --git a/.github/workflows/maven_jni_25.yml b/.github/workflows/maven_jni_25.yml index 20688891..ed20daa5 100644 --- a/.github/workflows/maven_jni_25.yml +++ b/.github/workflows/maven_jni_25.yml @@ -7,8 +7,9 @@ on: workflow_call: inputs: project-version: - required: true + required: false type: string + default: UNCHANGED secrets: MAVEN_USERNAME: required: true @@ -128,6 +129,7 @@ jobs: merge-multiple: 'true' - name: Set project version + if: ${{ inputs.project-version != 'UNCHANGED' && inputs.project-version != '' }} run: mvn versions:set -DnewVersion=${{ inputs.project-version }} --batch-mode - name: Deploy final JAR From e81aa92641bfdde542288533c2ce34eb68cf363b Mon Sep 17 00:00:00 2001 From: Zdenek Jonas Date: Mon, 8 Dec 2025 11:42:51 +0100 Subject: [PATCH 2/4] win build native --- .github/workflows/maven_build_win.yml | 34 +++++++++++++++++---------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/.github/workflows/maven_build_win.yml b/.github/workflows/maven_build_win.yml index 6293e708..2237ad5f 100644 --- a/.github/workflows/maven_build_win.yml +++ b/.github/workflows/maven_build_win.yml @@ -5,24 +5,34 @@ name: Java CI Windows with Maven on: push: - branches: + branches: - '**' pull_request: branches: [ main ] jobs: build: - runs-on: windows-latest steps: - #Build with java 17 - - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - cache: 'maven' - - name: Build with Maven - run: mvn -B clean package --file pom.xml + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: 'maven' + - name: Build with Maven + run: mvn -B clean package --file pom.xml + + build-native-jar: + needs: build + # Calls to a reusable workflow in the same repository must be at the job level. + uses: ./.github/workflows/maven_jni_25.yml + with: + project-version: UNCHANGED + secrets: + MAVEN_USERNAME: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }} + GPG_PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }} + GPG_PRIVATE_KEY: ${{ secrets.ORG_GPG_PRIVATE_KEY }} From 40c33e2ceda0cade12dabd8ff49807092018dcbe Mon Sep 17 00:00:00 2001 From: Zdenek Jonas Date: Mon, 8 Dec 2025 11:45:05 +0100 Subject: [PATCH 3/4] win build just a build --- .github/workflows/maven_build_win.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/maven_build_win.yml b/.github/workflows/maven_build_win.yml index 2237ad5f..2cde90d8 100644 --- a/.github/workflows/maven_build_win.yml +++ b/.github/workflows/maven_build_win.yml @@ -25,14 +25,3 @@ jobs: - name: Build with Maven run: mvn -B clean package --file pom.xml - build-native-jar: - needs: build - # Calls to a reusable workflow in the same repository must be at the job level. - uses: ./.github/workflows/maven_jni_25.yml - with: - project-version: UNCHANGED - secrets: - MAVEN_USERNAME: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }} - GPG_PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }} - GPG_PRIVATE_KEY: ${{ secrets.ORG_GPG_PRIVATE_KEY }} From a0f0a8d0de5319afbbc110dbaf2861e2fb703a08 Mon Sep 17 00:00:00 2001 From: Zdenek Jonas Date: Mon, 8 Dec 2025 11:57:55 +0100 Subject: [PATCH 4/4] feat: add native JAR build step to maven_release.yml workflow --- .github/workflows/maven_release.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven_release.yml b/.github/workflows/maven_release.yml index eff0f34b..29ea6e96 100644 --- a/.github/workflows/maven_release.yml +++ b/.github/workflows/maven_release.yml @@ -1,4 +1,3 @@ - # This workflow will build a package using Maven and then publish it to GitHub packages when a release is created # For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path @@ -31,3 +30,16 @@ jobs: MAVEN_PASSWORD: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }} MAVEN_GPG_PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }} MAVEN_GPG_KEY: ${{ secrets.ORG_GPG_PRIVATE_KEY }} + + build-native-jar: + needs: publish + # Call the reusable workflow in the same repository after publish completes. + uses: ./.github/workflows/maven_jni_25.yml + with: + # pass release tag as project-version input (adjust input name if the reusable workflow expects a different key) + project-version: ${{ github.event.release.tag_name }} + secrets: + MAVEN_USERNAME: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }} + GPG_PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }} + GPG_PRIVATE_KEY: ${{ secrets.ORG_GPG_PRIVATE_KEY }}