diff --git a/.github/workflows/build-all-and-publish.yml b/.github/workflows/build-all-and-publish.yml index 2e6d55d0..d896bd82 100644 --- a/.github/workflows/build-all-and-publish.yml +++ b/.github/workflows/build-all-and-publish.yml @@ -4,6 +4,13 @@ name: Build and publish for all platforms on: release: types: [published] + workflow_dispatch: + inputs: + publish: + description: 'Publish to Maven Central?' + required: false + default: false + type: boolean jobs: linux: @@ -211,8 +218,11 @@ jobs: with: distribution: zulu java-version: '7' + + # with central credentials - name: Setup Temurin JDK 21 uses: actions/setup-java@v5 + if: github.event_name == 'release' || inputs.publish with: distribution: temurin java-version: '21' @@ -222,6 +232,14 @@ jobs: server-id: 'central' server-username: CENTRAL_TOKEN_USERNAME server-password: CENTRAL_TOKEN_PASSWORD + # without central credentials + - name: Setup Temurin JDK 21 + uses: actions/setup-java@v5 + if: github.event_name != 'release' && !inputs.publish + with: + distribution: temurin + java-version: '21' + cache: maven - name: Download natives uses: actions/download-artifact@v4 @@ -261,13 +279,20 @@ jobs: echo "Contents of src/resources/net:" find src/resources/net -maxdepth 3 -type f -print - - name: Build with Maven (verify) consuming staged natives + # with maven central + - name: Build and deploy with Maven run: ./mvnw -B -V -Pdeploy deploy + if: github.event_name == 'release' || inputs.publish env: CENTRAL_TOKEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }} CENTRAL_TOKEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }} GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} + # without maven central + - name: Build with Maven + run: ./mvnw -B -V verify + if: github.event_name != 'release' && !inputs.publish + - name: Upload final JAR uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 93307fd0..03f5f43a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,6 @@ name: Run tests on: push: - pull_request: jobs: linux: