Update maven.yml #26
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 build a Java project with Maven | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
name: Java CI with Maven | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Maven Central Repository # Configures settings.xml with required credentials | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
server-id: ossrh | |
server-username: MAVEN_USER | |
server-password: MAVEN_PASSWORD | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
- name: Print settings.xml | |
run: cat $HOME/.m2/settings.xml | |
- name: Publish package | |
run: mvn clean deploy | |
env: | |
MAVEN_USER: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} |