Deploy artifacts #131
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy artifacts | |
| on: | |
| workflow_run: | |
| workflows: [ 'Build and test' ] | |
| types: [ 'completed' ] | |
| branches: [ 'develop', 'master', 'main' ] | |
| jobs: | |
| build: | |
| name: Deploy | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v5 | |
| - name: Set up JDK and Maven Central deployment | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: | | |
| 8 | |
| 21 | |
| mvn-toolchain-id: | | |
| jdk8 | |
| jdk21 | |
| cache: maven | |
| server-id: central | |
| server-username: MAVEN_CENTRAL_USERNAME | |
| server-password: MAVEN_CENTRAL_TOKEN | |
| gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
| gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
| - name: Publish to Apache Maven Central | |
| env: | |
| MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_USER }} | |
| MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_PASSWORD }} | |
| MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| run: ./mvnw --batch-mode --no-snapshot-updates deploy -DskipTests -DskipLicenseCheck |