Publish a new Release #48
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 a new Release | |
on: | |
release: | |
types: [published] | |
jobs: | |
# Build job | |
update-version: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: | |
write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Update PRP Files | |
uses: CIFriends/prp-preprocessor@0.1.1 | |
with: | |
ignoredDirs: | | |
docs | |
src | |
target | |
env: | |
currentVersion: ${{ github.event.release.tag_name }} | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Not needed if lastUpdated is not enabled | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
java-package: 'jdk' | |
cache: 'maven' | |
server-id: ossrh | |
- name: mvn versions | |
run: mvn versions:set -DnewVersion=${{ github.event.release.tag_name }} | |
- name: Import GPG Key | |
uses: crazy-max/ghaction-import-gpg@v5.0.0 | |
with: | |
gpg_private_key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} | |
passphrase: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} | |
- name: Release With Maven | |
run: | | |
mvn -s settings.xml -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} --batch-mode deploy -DskipTests -P publish | |
env: | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} |