Workflow file for this run
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: Publish package to the Maven Central Repository | |
| on: | |
| workflow_dispatch: | |
| release: | |
| types: [created] | |
| permissions: | |
| contents: read | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: carboneio/checkout@main | |
| - name: Set up Maven Central Repository | |
| uses: carboneio/setup-java@main | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| server-id: central | |
| server-username: MAVEN_USERNAME # name of the env variable holding the username | |
| server-password: MAVEN_PASSWORD # name of the env variable holding the token | |
| gpg-private-key: ${{ secrets.SIGN_KEY }} | |
| gpg-passphrase: SIGN_KEY_PASS # name of the env variable holding the GPG passphrase | |
| - name: Publish package | |
| run: mvn --batch-mode deploy -DskipTests # tests must pass before tagging a release | |
| env: | |
| MAVEN_USERNAME: ${{ secrets.CENTRAL_USERNAME }} | |
| MAVEN_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }} | |
| SIGN_KEY_PASS: ${{ secrets.SIGN_KEY_PASS }} |