spring-boot-starter/.forgejo/workflows/release.yaml

90 lines
3 KiB
YAML
Raw Normal View History

2024-06-30 09:50:42 +02: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 07:33:11 +01:00
env:
JRELEASER_OUTPUT_DIRECTORY: target
2024-06-30 09:50:42 +02:00
steps:
2025-01-08 07:33:11 +01:00
- name: "Initialize Environment"
id: initialize
uses: https://w9r.dev/w9r.dev/action-setup-environment@v1.1.4
2024-06-30 09:50:42 +02:00
with:
2025-01-08 07:33:11 +01:00
roleid: ${{ secrets.VAULT_ROLE_ID }}
secretid: ${{ secrets.VAULT_SECRET_ID }}
2024-06-30 09:50:42 +02:00
2025-01-08 07:33:11 +01:00
- name: "Determine next version"
uses: https://github.com/obfu5c8/action-svu@e0ac511a90318bc284bf845936acd5c5c077d788 # v1
2024-06-30 09:50:42 +02: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-08 07:33:11 +01:00
- name: "Set new version"
2024-06-30 09:50:42 +02:00
run: |
NEW_VERSION=${{steps.generate_next_version.outputs.version}}
echo NEW_VERSION=$NEW_VERSION >> "$GITHUB_ENV"
2025-01-08 07:33:11 +01:00
echo JRELEASER_PROJECT_VERSION=$NEW_VERSION >> "$GITHUB_ENV"
2024-06-30 09:50:42 +02:00
echo "New version: $NEW_VERSION"
2025-01-08 07:33:11 +01:00
mvn -B --file pom.xml versions:set -DnewVersion=$NEW_VERSION
2024-06-30 09:50:42 +02:00
2025-01-08 07:33:11 +01:00
- name: "Run JReleaser (Changelog)"
uses: https://github.com/jreleaser/release-action@f69e545b05f149483cecb2fb81866247992694b8 # 2.4.2
2024-06-30 09:50:42 +02:00
with:
arguments: changelog --debug
setup-java: false
continue-on-error: true
2025-01-08 07:33:11 +01:00
- name: "Commit and push changes"
uses: https://w9r.dev/w9r.dev/action-git-commit-push@v1.4
with:
email: ${{ steps.initialize.outputs.gitemail }}
name: ${{ steps.initialize.outputs.gituser }}
commit_message: "Release ${{ env.JRELEASER_PROJECT_VERSION }} [skip ci]"
files: pom.xml CHANGELOG.md
access_token: ${{ env.JRELEASER_GITEA_TOKEN }}
2024-06-30 09:50:42 +02:00
- name: Build package and populate staging area for deployment
run: |
mvn -B --file pom.xml -P skipShadeAndCycloneDX,publication deploy
2024-06-30 09:50:42 +02:00
2025-01-08 07:33:11 +01:00
- name: "Run JReleaser (Assemble)"
uses: https://github.com/jreleaser/release-action@f69e545b05f149483cecb2fb81866247992694b8 # 2.4.2
2024-06-30 09:50:42 +02:00
with:
arguments: assemble --debug
setup-java: false
continue-on-error: true
2025-01-08 07:33:11 +01:00
- name: "Run JReleaser (Release)"
uses: https://github.com/jreleaser/release-action@f69e545b05f149483cecb2fb81866247992694b8 # 2.4.2
2024-06-30 09:50:42 +02:00
with:
arguments: release --debug
setup-java: false
- name: JReleaser release trace
if: always()
uses: https://gitea.com/actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5 # v3
2024-06-30 09:50:42 +02:00
with:
name: jreleaser-trace
path: target/jreleaser/trace.log
- name: JReleaser release properties
if: always()
uses: https://gitea.com/actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5 # v3
2024-06-30 09:50:42 +02:00
with:
name: jreleaser-properties
path: target/jreleaser/output.properties