Release Trigger #36
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 Trigger | |
on: | |
workflow_dispatch: | |
inputs: | |
milestoneId: | |
description: 'Milestone ID' | |
required: true | |
default: '1' | |
releaseVersion: | |
description: 'Release version' | |
required: true | |
default: 'x.xx.x' | |
nextVersion: | |
description: 'Next version' | |
required: true | |
default: 'x.xx.x-SNAPSHOT' | |
env: | |
MAVEN_ARGS: "--no-transfer-progress --errors --fail-at-end --show-version" | |
jobs: | |
trigger-release: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'liberica' | |
java-version: 21 | |
cache: 'maven' | |
- name: Build | |
run: ./mvnw -Pcoverage clean verify | |
- name: Setup git user | |
uses: fregante/setup-git-user@v2 | |
- name: Create Release Notes | |
uses: docker://decathlon/release-notes-generator-action:3.1.5 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
OUTPUT_FOLDER: .chglog/ | |
FILENAME: ${{ github.event.inputs.releaseVersion }} | |
- name: Commit Release Notes | |
run: | | |
git add .chglog/*.md | |
git commit -m "[skip ci] Add release notes for version ${{ github.event.inputs.releaseVersion }}" | |
- name: Push Release Notes | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.AM_PAT }} | |
branch: ${{ github.ref }} | |
- name: Set release version | |
run: ./mvnw versions:set -DnewVersion=${{ github.event.inputs.releaseVersion }} | |
- name: Commit release version | |
run: git add pom.xml && git commit -m "New Release Version zeiterfassung-${{ github.event.inputs.releaseVersion }}" | |
- name: Add release tag | |
run: git tag -a -m "zeiterfassung-${{ github.event.inputs.releaseVersion }}" zeiterfassung-${{ github.event.inputs.releaseVersion }} | |
- name: Push release version | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.AM_PAT }} | |
branch: ${{ github.ref }} | |
- name: Set new snapshot version | |
run: ./mvnw versions:set -DnewVersion=${{ github.event.inputs.nextVersion }} | |
- name: Commit new snapshot version | |
run: git add pom.xml && git commit -m "Prepare Next Snapshot Version zeiterfassung-${{ github.event.inputs.nextVersion }}" | |
- name: Push snapshot commit | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.AM_PAT }} | |
branch: ${{ github.ref }} |