From 308603bbcb3339be6a22a57b136d3111ce361d5d Mon Sep 17 00:00:00 2001 From: Jack Date: Fri, 7 Nov 2025 11:16:59 +0000 Subject: [PATCH 1/8] Partially automate release - release branch creation and version updates [DI-669] _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](https://github.com/JackPGreen/hazelcast-cpp-client/pull/5) Post-merge actions: - [ ] update docs _Partially addresses_: [DI-669](https://hazelcast.atlassian.net/browse/DI-669) --- .github/workflows/update-versions.yml | 68 +++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/update-versions.yml diff --git a/.github/workflows/update-versions.yml b/.github/workflows/update-versions.yml new file mode 100644 index 000000000..291927391 --- /dev/null +++ b/.github/workflows/update-versions.yml @@ -0,0 +1,68 @@ +name: Create release branch + +on: + workflow_dispatch: + inputs: + BRANCH_NAME: + description: The source branch to work with, if not implicit + required: false + NEW_VERSION: + description: New version to set in the source branch (e.g. 5.6.0) + required: true + +jobs: + prepare: + name: Prepare + runs-on: ubuntu-latest + outputs: + branch_name: ${{ inputs.BRANCH_NAME || github.ref_name }} + steps: + - run: exit 0 + + make-branch: + name: Make branch + runs-on: ubuntu-latest + needs: + - prepare + steps: + - uses: actions/checkout@v5 + with: + ref: ${{ needs.prepare.outputs.branch_name }} + + - name: Determine project version + id: project_version + run: | + echo "version=$(jq --raw-output '.version' vcpkg.json)" >> ${GITHUB_OUTPUT} + + - name: Create `${{ steps.project_version.outputs.version }}` branch + run: | + git checkout -b ${{ steps.project_version.outputs.version }} + git push origin ${{ steps.project_version.outputs.version }} + + update-version: + name: Update version in `${{ needs.prepare.outputs.branch_name }}` to `${{ inputs.NEW_VERSION }}` + runs-on: ubuntu-latest + needs: + - prepare + env: + NEW_VERSION: ${{ inputs.NEW_VERSION }} + steps: + - uses: actions/checkout@v5 + with: + ref: ${{ needs.prepare.outputs.branch_name }} + + - name: Update `vcpkg.json` + run: | + cat <<< $(jq --arg ver "${NEW_VERSION}" '.version = $ver' vcpkg.json) > vcpkg.json + + - name: Update `CMakeLists.txt`s + run: | + find . -name 'CMakeLists.txt' | \ + xargs perl -0777 -i -pe 's/(project\s*\([^)]*?\bVERSION\s+)\S+/\1$ENV{NEW_VERSION}/s' + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v7 + with: + branch: Update_version_to_${{ inputs.NEW_VERSION }}_run_${{ github.run_id }} + title: Update development version to `${{ inputs.NEW_VERSION }}` + body: "" From b16b0de6069357fe9771605f01188a9974886cb1 Mon Sep 17 00:00:00 2001 From: Jack Date: Fri, 7 Nov 2025 11:27:09 +0000 Subject: [PATCH 2/8] Remove dynamic branch selection --- ...versions.yml => create-release-branch.yml} | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) rename .github/workflows/{update-versions.yml => create-release-branch.yml} (74%) diff --git a/.github/workflows/update-versions.yml b/.github/workflows/create-release-branch.yml similarity index 74% rename from .github/workflows/update-versions.yml rename to .github/workflows/create-release-branch.yml index 291927391..ab2d5e97c 100644 --- a/.github/workflows/update-versions.yml +++ b/.github/workflows/create-release-branch.yml @@ -4,30 +4,20 @@ on: workflow_dispatch: inputs: BRANCH_NAME: - description: The source branch to work with, if not implicit - required: false + description: The source branch to work with + required: true NEW_VERSION: description: New version to set in the source branch (e.g. 5.6.0) required: true jobs: - prepare: - name: Prepare - runs-on: ubuntu-latest - outputs: - branch_name: ${{ inputs.BRANCH_NAME || github.ref_name }} - steps: - - run: exit 0 - make-branch: name: Make branch runs-on: ubuntu-latest - needs: - - prepare steps: - uses: actions/checkout@v5 with: - ref: ${{ needs.prepare.outputs.branch_name }} + ref: ${{ inputs.BRANCH_NAME }} - name: Determine project version id: project_version @@ -40,16 +30,14 @@ jobs: git push origin ${{ steps.project_version.outputs.version }} update-version: - name: Update version in `${{ needs.prepare.outputs.branch_name }}` to `${{ inputs.NEW_VERSION }}` + name: Update version in `${{ inputs.BRANCH_NAME }}` to `${{ inputs.NEW_VERSION }}` runs-on: ubuntu-latest - needs: - - prepare env: NEW_VERSION: ${{ inputs.NEW_VERSION }} steps: - uses: actions/checkout@v5 with: - ref: ${{ needs.prepare.outputs.branch_name }} + ref: ${{ inputs.BRANCH_NAME }} - name: Update `vcpkg.json` run: | From a229132f8b6fb1c3cbf67adb85e0622bcb0c7da0 Mon Sep 17 00:00:00 2001 From: Jack Green Date: Sat, 8 Nov 2025 21:01:59 +0000 Subject: [PATCH 3/8] Update .github/workflows/create-release-branch.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ɓukasz Dziedziul --- .github/workflows/create-release-branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release-branch.yml b/.github/workflows/create-release-branch.yml index ab2d5e97c..315bb9fff 100644 --- a/.github/workflows/create-release-branch.yml +++ b/.github/workflows/create-release-branch.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: BRANCH_NAME: - description: The source branch to work with + description: The source branch to create a release branch from required: true NEW_VERSION: description: New version to set in the source branch (e.g. 5.6.0) From 047e9f78dbf2eade0a10d00b085610450cccc879 Mon Sep 17 00:00:00 2001 From: Jack Green Date: Sat, 8 Nov 2025 21:03:11 +0000 Subject: [PATCH 4/8] https://github.com/hazelcast/hazelcast-cpp-client/pull/1366#discussion_r2506877272 --- .github/workflows/create-release-branch.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/create-release-branch.yml b/.github/workflows/create-release-branch.yml index 315bb9fff..dda40617f 100644 --- a/.github/workflows/create-release-branch.yml +++ b/.github/workflows/create-release-branch.yml @@ -6,7 +6,7 @@ on: BRANCH_NAME: description: The source branch to create a release branch from required: true - NEW_VERSION: + NEW_VERSION_TO_UPDATE_SOURCE_BRANCH_TO: description: New version to set in the source branch (e.g. 5.6.0) required: true @@ -30,10 +30,10 @@ jobs: git push origin ${{ steps.project_version.outputs.version }} update-version: - name: Update version in `${{ inputs.BRANCH_NAME }}` to `${{ inputs.NEW_VERSION }}` + name: Update version in `${{ inputs.BRANCH_NAME }}` to `${{ inputs.NEW_VERSION_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO }}` runs-on: ubuntu-latest env: - NEW_VERSION: ${{ inputs.NEW_VERSION }} + NEW_VERSION: ${{ inputs.NEW_VERSION_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO }} steps: - uses: actions/checkout@v5 with: @@ -51,6 +51,6 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v7 with: - branch: Update_version_to_${{ inputs.NEW_VERSION }}_run_${{ github.run_id }} - title: Update development version to `${{ inputs.NEW_VERSION }}` + branch: Update_version_to_${{ inputs.NEW_VERSION_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO }}_run_${{ github.run_id }} + title: Update development version to `${{ inputs.NEW_VERSION_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO }}` body: "" From 3b4bcb48230ac0de57948cfe473632f2192b0ec8 Mon Sep 17 00:00:00 2001 From: Jack Green Date: Sat, 8 Nov 2025 21:04:25 +0000 Subject: [PATCH 5/8] https://github.com/hazelcast/hazelcast-cpp-client/pull/1366#discussion_r2506877746 --- .github/workflows/create-release-branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release-branch.yml b/.github/workflows/create-release-branch.yml index dda40617f..b1cf35542 100644 --- a/.github/workflows/create-release-branch.yml +++ b/.github/workflows/create-release-branch.yml @@ -12,7 +12,7 @@ on: jobs: make-branch: - name: Make branch + name: Create release branch from `${{ inputs.BRANCH_NAME }}` runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 From 35c32ca9f489c1d400a8b68df97fa983eb59c2b4 Mon Sep 17 00:00:00 2001 From: Jack Green Date: Mon, 10 Nov 2025 09:44:58 +0000 Subject: [PATCH 6/8] https://github.com/hazelcast/hazelcast-cpp-client/pull/1366#pullrequestreview-3441986352 --- .github/workflows/create-release-branch.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/create-release-branch.yml b/.github/workflows/create-release-branch.yml index b1cf35542..b2cadc5f3 100644 --- a/.github/workflows/create-release-branch.yml +++ b/.github/workflows/create-release-branch.yml @@ -30,10 +30,10 @@ jobs: git push origin ${{ steps.project_version.outputs.version }} update-version: - name: Update version in `${{ inputs.BRANCH_NAME }}` to `${{ inputs.NEW_VERSION_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO }}` + name: Update version in `${{ inputs.BRANCH_NAME }}` to `${{ inputs.NEW_VERSION_TO_UPDATE_SOURCE_BRANCH_TO }}` runs-on: ubuntu-latest env: - NEW_VERSION: ${{ inputs.NEW_VERSION_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO }} + NEW_VERSION: ${{ inputs.NEW_VERSION_TO_UPDATE_SOURCE_BRANCH_TO }} steps: - uses: actions/checkout@v5 with: @@ -51,6 +51,6 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v7 with: - branch: Update_version_to_${{ inputs.NEW_VERSION_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO }}_run_${{ github.run_id }} - title: Update development version to `${{ inputs.NEW_VERSION_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO_TO_UPDATE_SOURCE_BRANCH_TO }}` + branch: Update_version_to_${{ inputs.NEW_VERSION_TO_UPDATE_SOURCE_BRANCH_TO }}_run_${{ github.run_id }} + title: Update development version to `${{ inputs.NEW_VERSION_TO_UPDATE_SOURCE_BRANCH_TO }}` body: "" From 22533ba0549096d9e7c69af0d25fcf2cc19cf491 Mon Sep 17 00:00:00 2001 From: Jack Date: Wed, 12 Nov 2025 23:17:03 +0000 Subject: [PATCH 7/8] https://github.com/hazelcast/hazelcast-cpp-client/pull/1366#pullrequestreview-3452919662 --- .github/workflows/create-release-branch.yml | 29 +++++++++++++-------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/create-release-branch.yml b/.github/workflows/create-release-branch.yml index b2cadc5f3..6c555bbed 100644 --- a/.github/workflows/create-release-branch.yml +++ b/.github/workflows/create-release-branch.yml @@ -3,41 +3,48 @@ name: Create release branch on: workflow_dispatch: inputs: - BRANCH_NAME: + SOURCE_BRANCH_NAME: description: The source branch to create a release branch from required: true + TARGET_BRANCH_NAME: + description: The target branch to create - optional, otherwise derived from the version in the source branch + required: false NEW_VERSION_TO_UPDATE_SOURCE_BRANCH_TO: description: New version to set in the source branch (e.g. 5.6.0) required: true jobs: make-branch: - name: Create release branch from `${{ inputs.BRANCH_NAME }}` + name: Create release branch from `${{ inputs.SOURCE_BRANCH_NAME }}` runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 with: - ref: ${{ inputs.BRANCH_NAME }} + ref: ${{ inputs.SOURCE_BRANCH_NAME }} - - name: Determine project version - id: project_version + - name: Derive target branch + id: derive_target_branch_name run: | - echo "version=$(jq --raw-output '.version' vcpkg.json)" >> ${GITHUB_OUTPUT} + if [[ -n "${{ inputs.TARGET_BRANCH_NAME }}" ]]; then + echo "name=${{ inputs.TARGET_BRANCH_NAME }}" >> "${GITHUB_OUTPUT}" + else + echo "name=$(jq --raw-output '.version' vcpkg.json)" >> "${GITHUB_OUTPUT}" + fi - - name: Create `${{ steps.project_version.outputs.version }}` branch + - name: Create `${{ steps.derive_target_branch_name.outputs.name }}` branch run: | - git checkout -b ${{ steps.project_version.outputs.version }} - git push origin ${{ steps.project_version.outputs.version }} + git checkout -b ${{ steps.derive_target_branch_name.outputs.name }} + git push origin ${{ steps.derive_target_branch_name.outputs.name }} update-version: - name: Update version in `${{ inputs.BRANCH_NAME }}` to `${{ inputs.NEW_VERSION_TO_UPDATE_SOURCE_BRANCH_TO }}` + name: Update version in `${{ inputs.SOURCE_BRANCH_NAME }}` to `${{ inputs.NEW_VERSION_TO_UPDATE_SOURCE_BRANCH_TO }}` runs-on: ubuntu-latest env: NEW_VERSION: ${{ inputs.NEW_VERSION_TO_UPDATE_SOURCE_BRANCH_TO }} steps: - uses: actions/checkout@v5 with: - ref: ${{ inputs.BRANCH_NAME }} + ref: ${{ inputs.SOURCE_BRANCH_NAME }} - name: Update `vcpkg.json` run: | From 9c8fb845e9f78fad0e9d955d3c229ddd7950a22e Mon Sep 17 00:00:00 2001 From: Jack Date: Thu, 13 Nov 2025 12:29:32 +0000 Subject: [PATCH 8/8] Revert "https://github.com/hazelcast/hazelcast-cpp-client/pull/1366#pullrequestreview-3452919662" This reverts commit 22533ba0549096d9e7c69af0d25fcf2cc19cf491. --- .github/workflows/create-release-branch.yml | 29 ++++++++------------- 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/.github/workflows/create-release-branch.yml b/.github/workflows/create-release-branch.yml index 6c555bbed..b2cadc5f3 100644 --- a/.github/workflows/create-release-branch.yml +++ b/.github/workflows/create-release-branch.yml @@ -3,48 +3,41 @@ name: Create release branch on: workflow_dispatch: inputs: - SOURCE_BRANCH_NAME: + BRANCH_NAME: description: The source branch to create a release branch from required: true - TARGET_BRANCH_NAME: - description: The target branch to create - optional, otherwise derived from the version in the source branch - required: false NEW_VERSION_TO_UPDATE_SOURCE_BRANCH_TO: description: New version to set in the source branch (e.g. 5.6.0) required: true jobs: make-branch: - name: Create release branch from `${{ inputs.SOURCE_BRANCH_NAME }}` + name: Create release branch from `${{ inputs.BRANCH_NAME }}` runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 with: - ref: ${{ inputs.SOURCE_BRANCH_NAME }} + ref: ${{ inputs.BRANCH_NAME }} - - name: Derive target branch - id: derive_target_branch_name + - name: Determine project version + id: project_version run: | - if [[ -n "${{ inputs.TARGET_BRANCH_NAME }}" ]]; then - echo "name=${{ inputs.TARGET_BRANCH_NAME }}" >> "${GITHUB_OUTPUT}" - else - echo "name=$(jq --raw-output '.version' vcpkg.json)" >> "${GITHUB_OUTPUT}" - fi + echo "version=$(jq --raw-output '.version' vcpkg.json)" >> ${GITHUB_OUTPUT} - - name: Create `${{ steps.derive_target_branch_name.outputs.name }}` branch + - name: Create `${{ steps.project_version.outputs.version }}` branch run: | - git checkout -b ${{ steps.derive_target_branch_name.outputs.name }} - git push origin ${{ steps.derive_target_branch_name.outputs.name }} + git checkout -b ${{ steps.project_version.outputs.version }} + git push origin ${{ steps.project_version.outputs.version }} update-version: - name: Update version in `${{ inputs.SOURCE_BRANCH_NAME }}` to `${{ inputs.NEW_VERSION_TO_UPDATE_SOURCE_BRANCH_TO }}` + name: Update version in `${{ inputs.BRANCH_NAME }}` to `${{ inputs.NEW_VERSION_TO_UPDATE_SOURCE_BRANCH_TO }}` runs-on: ubuntu-latest env: NEW_VERSION: ${{ inputs.NEW_VERSION_TO_UPDATE_SOURCE_BRANCH_TO }} steps: - uses: actions/checkout@v5 with: - ref: ${{ inputs.SOURCE_BRANCH_NAME }} + ref: ${{ inputs.BRANCH_NAME }} - name: Update `vcpkg.json` run: |