70 lines
1.9 KiB
YAML
70 lines
1.9 KiB
YAML
name: Prepare Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: 'Release version (e.g. 2.0.0)'
|
|
required: true
|
|
type: string
|
|
next_version:
|
|
description: 'Next development version without -SNAPSHOT (e.g. 2.1.0)'
|
|
required: true
|
|
type: string
|
|
|
|
jobs:
|
|
prepare:
|
|
name: Bump, Tag & Push
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Temurin 21
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: temurin
|
|
java-version: 21
|
|
cache: maven
|
|
|
|
- name: Configure Git
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
|
|
- name: Set release version
|
|
run: mvn -B --settings .github/settings.xml versions:set -DnewVersion=${{ inputs.version }}
|
|
env:
|
|
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
|
|
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
|
|
|
|
- name: Commit release version
|
|
run: |
|
|
git add -A
|
|
git commit -m "chore(release): ${{ inputs.version }}"
|
|
|
|
- name: Tag release
|
|
run: git tag v${{ inputs.version }}
|
|
|
|
- name: Set next snapshot version
|
|
run: mvn -B --settings .github/settings.xml versions:set -DnewVersion=${{ inputs.next_version }}-SNAPSHOT
|
|
env:
|
|
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
|
|
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
|
|
|
|
- name: Commit next snapshot version
|
|
run: |
|
|
git add -A
|
|
git commit -m "chore(release): prepare ${{ inputs.next_version }}-SNAPSHOT"
|
|
|
|
- name: Push commits and tag
|
|
run: |
|
|
git push origin master
|
|
git push origin v${{ inputs.version }}
|