Skip to content

Create release branch 8.4.0 #11

Create release branch 8.4.0

Create release branch 8.4.0 #11

name: Create release branch
run-name: Create release branch ${{ inputs.version }}
on:
workflow_dispatch:
inputs:
version:
description: 'Semantic version number of release: ^[0-9]+.[0-9]+.[0-9]+(-[a-zA-Z0-9.-]+){0,1}$'
required: true
setVersionOnMain:
description: 'Set the new snapshot version on main branch?'
type: boolean
required: true
default: true
jobs:
create-release-branch:
name: Create release branch ${{ inputs.version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
fetch-depth: 0
- name: Prepare Java and Maven settings
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Configure git user
run: |
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Create branch and set release version
id: create-branch
run: |
MINOR_VERSION=${RELEASE_VERSION%.*}
git checkout -b release/${MINOR_VERSION}
git push --set-upstream origin release/${MINOR_VERSION}
echo "branchName=release/${RELEASE_VERSION%.*}" >> $GITHUB_OUTPUT
env:
RELEASE_VERSION: ${{ github.event.inputs.version }}
- name: Set snapshot version on release branch
run: |
MINOR_VERSION=${RELEASE_VERSION%.*}
git checkout release/${MINOR_VERSION}
mvn -B versions:set -DnewVersion=${RELEASE_VERSION}-SNAPSHOT -DgenerateBackupPoms=false -f parent
env:
RELEASE_VERSION: ${{ github.event.inputs.version }}
- name: Create pull request to main branch
if: ${{ github.event.inputs.setVersionOnMain == 'true' }}
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ steps.create-branch.outputs.branchName }}
commit-message: "ci: set next snapshot version"
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
base: main
title: "ci: set next snapshot version"
body: |
This PR sets the next snapshot version on the main branch.
Checklist:
- [ ] the PR should be accepted via the "Rebase and merge" option
- [ ] the branch must **not** be deleted after merging
- [ ] the PR contains exactly one commit with the version change
env:
RELEASE_VERSION: ${{ github.event.inputs.version }}