dependencies/.forgejo/workflows/release.yaml

91 lines
3 KiB
YAML
Raw Normal View History

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') }}
2025-01-08 05:54:50 +01:00
env:
JRELEASER_OUTPUT_DIRECTORY: target
2025-01-04 10:04:50 +01:00
steps:
2025-01-07 11:58:38 +01:00
- name: "Initialize Environment"
2025-01-07 12:03:39 +01:00
id: initialize
2025-01-08 06:02:22 +01:00
uses: https://w9r.dev/w9r.dev/action-setup-environment@v1.1.4
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"
uses: https://github.com/obfu5c8/action-svu@e0ac511a90318bc284bf845936acd5c5c077d788 # v1
2025-01-04 10:04:50 +01:00
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-04 10:04:50 +01:00
run: |
NEW_VERSION=${{steps.generate_next_version.outputs.version}}
echo NEW_VERSION=$NEW_VERSION >> "$GITHUB_ENV"
2025-01-08 05:54:50 +01:00
echo JRELEASER_PROJECT_VERSION=$NEW_VERSION >> "$GITHUB_ENV"
2025-01-04 10:04:50 +01:00
echo "New version: $NEW_VERSION"
2025-01-07 12:03:39 +01:00
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)"
uses: https://github.com/jreleaser/release-action@f69e545b05f149483cecb2fb81866247992694b8 # 2.4.2
2025-01-04 10:04:50 +01:00
with:
arguments: changelog --debug
setup-java: false
continue-on-error: true
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 }}
2025-01-08 05:54:50 +01:00
commit_message: "Release ${{ env.JRELEASER_PROJECT_VERSION }} [skip ci]"
2025-01-07 12:03:39 +01:00
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
run: |
2025-01-07 15:10:55 +01:00
mvn -X -B --file pom.xml package
2025-01-07 16:04:29 +01:00
mvn -X --file pom.xml -Ppublication
2025-01-04 10:04:50 +01:00
2025-01-07 11:58:38 +01:00
- name: "Run JReleaser (Assemble)"
uses: https://github.com/jreleaser/release-action@f69e545b05f149483cecb2fb81866247992694b8 # 2.4.2
2025-01-04 10:04:50 +01:00
with:
arguments: assemble --debug
setup-java: false
continue-on-error: true
2025-01-07 11:58:38 +01:00
- name: "Run JReleaser (Release)"
uses: https://github.com/jreleaser/release-action@f69e545b05f149483cecb2fb81866247992694b8 # 2.4.2
2025-01-04 10:04:50 +01:00
with:
arguments: release --debug
setup-java: false
- name: JReleaser release trace
if: always()
uses: https://gitea.com/actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4
2025-01-04 10:04:50 +01:00
with:
name: jreleaser-trace
path: target/jreleaser/trace.log
- name: JReleaser release properties
if: always()
uses: https://gitea.com/actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4
2025-01-04 10:04:50 +01:00
with:
name: jreleaser-properties
path: target/jreleaser/output.properties