Publish package #10
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 Maven Central Repository | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '8' | |
distribution: 'temurin' | |
server-id: central | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
- name: Build with Maven | |
run: mvn -B package --file pom.xml | |
- name: Publish to Maven Central Repository | |
run: mvn --batch-mode deploy | |
env: | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_CENTRAL_GPG_SECRET_KEY_PASSWORD }} | |
MAVEN_GPG_KEY: ${{ secrets.MAVEN_CENTRAL_GPG_SECRET_KEY }} | |
- name: Set up GitHub Packages | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '8' | |
distribution: 'temurin' | |
- name: Publish to GitHub Packages | |
run: mvn --batch-mode deploy | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |