Fix release issues with pom.xml #8
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: release_on_master | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
# Get GPG private key into GPG | |
- name: Import GPG Owner Trust | |
run: echo ${{ secrets.GPG_OWNERTRUST }} | base64 --decode | gpg --import-ownertrust | |
- name: Import GPG key | |
run: echo ${{ secrets.GPG_SECRET_KEYS }} | base64 --decode | gpg --import --no-tty --batch --yes | |
# Setup JDK and Maven | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
cache: 'maven' | |
server-id: sonatype-nexus-staging | |
server-username: OSS_CENTRAL_USERNAME # env variable for Maven Central | |
server-password: OSS_CENTRAL_PASSWORD # env variable for Maven Central | |
- name: Prepare mvnw | |
run: chmod +x ./mvnw | |
- name: Build | |
run: ./mvnw -DskipTests clean package | |
- name: Deploy a new version to central | |
run: ./mvnw clean install javadoc:jar source:jar deploy -B -DskipTests -Prelease -Dgpg.keyname=${{secrets.GPG_KEYNAME}} -Dgpg.passphrase="${{secrets.GPG_PASSPHRASE}}" | |
env: | |
OSS_CENTRAL_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
OSS_CENTRAL_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} |