2025-01-04 10:04:50 +01:00
|
|
|
---
|
|
|
|
name: release
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
name: Release
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: ${{ !startsWith(github.event.head_commit.message, 'Release') }}
|
|
|
|
|
|
|
|
steps:
|
2025-01-07 11:58:38 +01:00
|
|
|
- name: "Initialize Environment"
|
2025-01-07 12:03:39 +01:00
|
|
|
id: initialize
|
|
|
|
uses: https://w9r.dev/w9r.dev/action-setup-environment@v1.1.2
|
2025-01-07 06:56:20 +01:00
|
|
|
with:
|
2025-01-07 11:58:38 +01:00
|
|
|
roleid: ${{ secrets.VAULT_ROLE_ID }}
|
|
|
|
secretid: ${{ secrets.VAULT_SECRET_ID }}
|
2025-01-05 17:59:25 +01:00
|
|
|
|
2025-01-07 11:58:38 +01:00
|
|
|
- name: "Determine next version"
|
2025-01-04 10:04:50 +01:00
|
|
|
uses: https://github.com/obfu5c8/action-svu@v1
|
|
|
|
id: generate_next_version
|
|
|
|
with:
|
|
|
|
type: auto
|
|
|
|
force-increment: true
|
|
|
|
no-metadata: false
|
|
|
|
no-pre-release: false
|
|
|
|
no-build: false
|
|
|
|
strip-prefix: true
|
|
|
|
prefix: ''
|
|
|
|
suffix: ''
|
|
|
|
|
2025-01-07 11:58:38 +01:00
|
|
|
- name: "Set new version"
|
2025-01-07 06:08:44 +01:00
|
|
|
env:
|
|
|
|
MAVEN_USERNAME: ${{ env.NEXUS_USERNAME }}
|
|
|
|
MAVEN_CENTRAL_TOKEN: ${{ env.NEXUS_PASSWORD }}
|
|
|
|
MAVEN_GPG_PASSPHRASE: ${{ env.GPG_PASSPHRASE }}
|
2025-01-04 10:04:50 +01:00
|
|
|
run: |
|
|
|
|
NEW_VERSION=${{steps.generate_next_version.outputs.version}}
|
|
|
|
echo NEW_VERSION=$NEW_VERSION >> "$GITHUB_ENV"
|
|
|
|
echo "New version: $NEW_VERSION"
|
2025-01-07 12:03:39 +01:00
|
|
|
echo "mvn -B --file pom.xml versions:set -DnewVersion=$NEW_VERSION"
|
|
|
|
mvn -B --file pom.xml versions:set -DnewVersion=$NEW_VERSION
|
|
|
|
|
2025-01-04 10:04:50 +01:00
|
|
|
|
2025-01-07 11:58:38 +01:00
|
|
|
- name: "Run JReleaser (Changelog)"
|
2025-01-04 10:04:50 +01:00
|
|
|
uses: https://w9r.dev/actions/release-action@main
|
|
|
|
with:
|
|
|
|
arguments: changelog --debug
|
|
|
|
setup-java: false
|
|
|
|
continue-on-error: true
|
|
|
|
env:
|
|
|
|
JRELEASER_OUTPUT_DIRECTORY: target
|
|
|
|
JRELEASER_PROJECT_VERSION: ${{ env.NEW_VERSION }}
|
2025-01-07 06:08:44 +01:00
|
|
|
JRELEASER_GITEA_TOKEN: ${{ env.JRELEASER_GITEA_TOKEN }}
|
|
|
|
JRELEASER_GPG_PASSPHRASE: ${{ env.GPG_PASSPHRASE }}
|
|
|
|
JRELEASER_GPG_PUBLIC_KEY: ${{ env.GPG_PUBLIC_KEY }}
|
|
|
|
JRELEASER_GPG_SECRET_KEY: ${{ env.GPG_PRIVATE_KEY }}
|
2025-01-06 01:09:08 +01:00
|
|
|
|
2025-01-07 11:58:38 +01:00
|
|
|
- name: "Commit and push changes"
|
2025-01-07 14:55:02 +01:00
|
|
|
uses: https://w9r.dev/w9r.dev/action-git-commit-push@v1.4
|
2025-01-07 12:03:39 +01:00
|
|
|
with:
|
|
|
|
email: ${{ steps.initialize.outputs.gitemail }}
|
|
|
|
name: ${{ steps.initialize.outputs.gituser }}
|
|
|
|
commit_message: "Release ${{ env.NEW_VERSION }}"
|
|
|
|
files: pom.xml CHANGELOG.md
|
|
|
|
access_token: ${{ env.JRELEASER_GITEA_TOKEN }}
|
2025-01-06 01:09:08 +01:00
|
|
|
|
2025-01-04 10:04:50 +01:00
|
|
|
- name: Build package and populate staging area for deployment
|
2025-01-07 14:59:24 +01:00
|
|
|
env:
|
|
|
|
MAVEN_USERNAME: ${{ env.NEXUS_USERNAME }}
|
|
|
|
MAVEN_CENTRAL_TOKEN: ${{ env.NEXUS_PASSWORD }}
|
|
|
|
MAVEN_GPG_PASSPHRASE: ${{ env.GPG_PASSPHRASE }}
|
2025-01-04 10:04:50 +01:00
|
|
|
run: |
|
2025-01-07 15:10:55 +01:00
|
|
|
mvn -X -B --file pom.xml package
|
|
|
|
mvn -X -B --file pom.xml -Ppublication^
|
2025-01-04 10:04:50 +01:00
|
|
|
|
2025-01-07 11:58:38 +01:00
|
|
|
- name: "Run JReleaser (Assemble)"
|
2025-01-04 10:04:50 +01:00
|
|
|
uses: https://w9r.dev/actions/release-action@main
|
|
|
|
with:
|
|
|
|
arguments: assemble --debug
|
|
|
|
setup-java: false
|
|
|
|
continue-on-error: true
|
|
|
|
env:
|
|
|
|
JRELEASER_OUTPUT_DIRECTORY: target
|
|
|
|
JRELEASER_PROJECT_VERSION: ${{ env.NEW_VERSION }}
|
|
|
|
JRELEASER_GITEA_TOKEN: ${{ secrets.JRELEASER_GITEA_TOKEN }}
|
2025-01-07 06:08:44 +01:00
|
|
|
JRELEASER_GPG_PASSPHRASE: ${{ env.GPG_PASSPHRASE }}
|
|
|
|
JRELEASER_GPG_PUBLIC_KEY: ${{ env.GPG_PUBLIC_KEY }}
|
|
|
|
JRELEASER_GPG_SECRET_KEY: ${{ env.GPG_PRIVATE_KEY }}
|
2025-01-04 10:04:50 +01:00
|
|
|
|
2025-01-07 11:58:38 +01:00
|
|
|
- name: "Run JReleaser (Release)"
|
2025-01-04 10:04:50 +01:00
|
|
|
uses: https://w9r.dev/actions/release-action@main
|
|
|
|
with:
|
|
|
|
arguments: release --debug
|
|
|
|
setup-java: false
|
|
|
|
env:
|
|
|
|
JRELEASER_OUTPUT_DIRECTORY: target
|
|
|
|
JRELEASER_PROJECT_VERSION: ${{ env.NEW_VERSION }}
|
|
|
|
JRELEASER_GITEA_TOKEN: ${{ secrets.JRELEASER_GITEA_TOKEN }}
|
2025-01-07 06:08:44 +01:00
|
|
|
JRELEASER_GPG_PASSPHRASE: ${{ env.GPG_PASSPHRASE }}
|
|
|
|
JRELEASER_GPG_PUBLIC_KEY: ${{ env.GPG_PUBLIC_KEY }}
|
|
|
|
JRELEASER_GPG_SECRET_KEY: ${{ env.GPG_PRIVATE_KEY }}
|
|
|
|
JRELEASER_ARTIFACTORY_USERNAME: ${{ env.NEXUS_USERNAME }}
|
|
|
|
JRELEASER_ARTIFACTORY_TOKEN: ${{ env.NEXUS_PASSWORD }}
|
2025-01-04 10:04:50 +01:00
|
|
|
|
|
|
|
- name: JReleaser release trace
|
|
|
|
if: always()
|
|
|
|
uses: https://gitea.com/actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: jreleaser-trace
|
|
|
|
path: target/jreleaser/trace.log
|
|
|
|
|
|
|
|
- name: JReleaser release properties
|
|
|
|
if: always()
|
|
|
|
uses: https://gitea.com/actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: jreleaser-properties
|
|
|
|
path: target/jreleaser/output.properties
|