Create release branch 8.7.0 #34
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: Create release branch | |
run-name: Create release branch ${{ inputs.version }} | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Full semantic version number of the next minor release, e.g. 8.4.0' | |
required: 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: Restore cache | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Prepare Java and Maven settings | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- 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: Set snapshot version on release branch | |
id: set-snapshot-version | |
run: | | |
MINOR_VERSION=${RELEASE_VERSION%.*} | |
git checkout -b release/${MINOR_VERSION} | |
mvn -B versions:set -DnewVersion=${RELEASE_VERSION}-SNAPSHOT -DgenerateBackupPoms=false -f parent | |
git commit -am "ci: set next snapshot version" | |
git push origin release/${MINOR_VERSION} | |
git checkout main | |
git cherry-pick release/${MINOR_VERSION} | |
echo "branchName=temp-release/${RELEASE_VERSION%.*}" >> $GITHUB_OUTPUT | |
env: | |
RELEASE_VERSION: ${{ github.event.inputs.version }} | |
- name: Create pull request to main branch | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ steps.set-snapshot-version.outputs.branchName }} | |
commit-message: "ci: set next snapshot version" | |
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | |
delete-branch: true | |
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 | |
- [ ] this temporary branch can be safely deleted after merging | |
- [ ] the PR contains exactly one commit with the version change | |
If this PR has conflicts, re-run the `Create release branch` workflow. No need to close the PR or delete the branch. | |
env: | |
RELEASE_VERSION: ${{ github.event.inputs.version }} |