Skip to content

Commit ac4fcf8

Browse files
Partially automate release - release branch creation and version updates [DI-669] (#1366)
_Partially_ automates the steps listed in [the `C++ Client Release Process` documentation](https://hazelcast.atlassian.net/wiki/spaces/HZC/pages/129810774/C+Client+Release+Process). Specifically, steps: - `Create branch` - `Update next version` By scripting and chaining the steps, the (manual) release work is reduced and consistency is improved. Testing (in my fork): - [example execution](https://github.com/JackPGreen/hazelcast-cpp-client/actions/runs/19166496611) - [branch created](https://github.com/JackPGreen/hazelcast-cpp-client/tree/5.5.0) - [version update PR raised](JackPGreen#5) - (note, action is included in PR as I've since reset my forks' `master`, it's not _actually_ in the PR) _Partially addresses_: [DI-669](https://hazelcast.atlassian.net/browse/DI-669) [DI-669]: https://hazelcast.atlassian.net/browse/DI-669?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Co-authored-by: Łukasz Dziedziul <l.dziedziul@gmail.com>
1 parent 7bf37c7 commit ac4fcf8

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Create release branch
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
BRANCH_NAME:
7+
description: The source branch to create a release branch from
8+
required: true
9+
NEXT_VERSION:
10+
description: New version to set in the source branch (e.g. 5.6.0)
11+
required: true
12+
13+
jobs:
14+
make-branch:
15+
name: Create release branch from `${{ inputs.BRANCH_NAME }}`
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v5
19+
with:
20+
ref: ${{ inputs.BRANCH_NAME }}
21+
22+
- name: Determine project version
23+
id: project_version
24+
run: |
25+
echo "version=$(jq --raw-output '.version' vcpkg.json)" >> ${GITHUB_OUTPUT}
26+
27+
- name: Create `${{ steps.project_version.outputs.version }}` branch
28+
run: |
29+
git checkout -b ${{ steps.project_version.outputs.version }}
30+
git push origin ${{ steps.project_version.outputs.version }}
31+
32+
update-version:
33+
name: Update next version in `${{ inputs.BRANCH_NAME }}` to `${{ inputs.NEXT_VERSION }}`
34+
runs-on: ubuntu-latest
35+
env:
36+
NEW_VERSION: ${{ inputs.NEXT_VERSION }}
37+
steps:
38+
- uses: actions/checkout@v5
39+
with:
40+
ref: ${{ inputs.BRANCH_NAME }}
41+
42+
- name: Update `vcpkg.json`
43+
run: |
44+
cat <<< $(jq --arg ver "${NEW_VERSION}" '.version = $ver' vcpkg.json) > vcpkg.json
45+
46+
- name: Update `CMakeLists.txt`s
47+
run: |
48+
find . -name 'CMakeLists.txt' | \
49+
xargs perl -0777 -i -pe 's/(project\s*\([^)]*?\bVERSION\s+)\S+/\1$ENV{NEW_VERSION}/s'
50+
51+
- name: Create Pull Request
52+
uses: peter-evans/create-pull-request@v7
53+
with:
54+
branch: Update_version_to_${{ inputs.NEXT_VERSION }}_run_${{ github.run_id }}
55+
title: Update development version to `${{ inputs.NEXT_VERSION }}`
56+
body: ""

0 commit comments

Comments
 (0)