diff --git a/.github/workflows/maven_build_win.yml b/.github/workflows/maven_build_win.yml index 6293e70..2cde90d 100644 --- a/.github/workflows/maven_build_win.yml +++ b/.github/workflows/maven_build_win.yml @@ -5,24 +5,23 @@ 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 + diff --git a/.github/workflows/maven_deploy_snapshot.yml b/.github/workflows/maven_deploy_snapshot.yml index 087bc4a..6839272 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 2068889..ed20daa 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 diff --git a/.github/workflows/maven_release.yml b/.github/workflows/maven_release.yml index eff0f34..29ea6e9 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 }}