Publish to the Maven Central Repository #22
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
# This workflow will release project to Sonatype. | |
# For more information see: https://docs.github.com/en/actions/guides/publishing-java-packages-with-maven | |
name: Publish to the Maven Central Repository | |
on: | |
release: | |
types: [created] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: master | |
token: ${{ secrets.PAT }} | |
- name: Configure Git User | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "Elisedlund-ericsson" | |
- name: Set up Java and Maven Central Repository | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
architecture: x64 | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Release and deploy to Sonatype repo | |
run: mvn --batch-mode release:prepare release:perform -Dusername=Elisedlund-ericsson -Dgoals=deploy -DdryRun=false -Dresume=false '-Darguments=-DskipTests -Dformatter.skip=true' -P deploy | |
env: | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} |