Publish package #6
Workflow file for this run
This file contains 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 | |
on: | |
release: | |
types: [created] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up GitHub Packages | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '8' | |
distribution: 'temurin' | |
gpg-private-key: ${{ secrets.MAVEN_CENTRAL_GPG_SECRET_KEY }} | |
gpg-passphrase: MAVEN_CENTRAL_GPG_SECRET_KEY_PASSWORD | |
- name: Build with Maven | |
run: mvn -B package --file pom.xml | |
- name: Publish to GitHub Packages | |
run: mvn deploy | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
MAVEN_CENTRAL_GPG_SECRET_KEY_PASSWORD: ${{ secrets.MAVEN_CENTRAL_GPG_SECRET_KEY_PASSWORD }} | |
- name: Set up Apache Maven Central | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '8' | |
distribution: 'temurin' | |
server-id: ossrh | |
server-username: MAVEN_CENTRAL_USERNAME | |
server-password: MAVEN_CENTRAL_PASSWORD | |
gpg-private-key: ${{ secrets.MAVEN_CENTRAL_GPG_SECRET_KEY }} | |
gpg-passphrase: MAVEN_CENTRAL_GPG_SECRET_KEY_PASSWORD | |
- name: Publish to Apache Maven Central | |
run: mvn deploy | |
env: | |
MAVEN_CENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_CENTRAL_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
MAVEN_CENTRAL_GPG_SECRET_KEY_PASSWORD: ${{ secrets.MAVEN_CENTRAL_GPG_SECRET_KEY_PASSWORD }} |