Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/actions/update-project-version/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Update project version

inputs:
NEXT_VERSION:
required: true

runs:
using: composite
steps:
- name: Update `vcpkg.json`
shell: bash
run: |
cat <<< $(jq --arg ver "${{ inputs.NEXT_VERSION }}" '.version = $ver' vcpkg.json) > vcpkg.json

- name: Update `CMakeLists.txt`s
shell: bash
run: |
find . -name 'CMakeLists.txt' | \
xargs perl -0777 -i -pe 's/(project\s*\([^)]*?\bVERSION\s+)\S+/\1$ENV{NEXT_VERSION}/s'
env:
NEXT_VERSION: ${{ inputs.NEXT_VERSION }}

- name: Get current branch name
id: get-current-branch-name
shell: bash
run: |
echo "name=$(git rev-parse --abbrev-ref HEAD)" >> ${GITHUB_OUTPUT}

- name: Create Pull Request
# https://github.com/peter-evans/create-pull-request/releases/tag/v7.0.8
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
with:
branch: Update_version_to_${{ inputs.NEXT_VERSION }}_run_${{ github.run_id }}
title: Update version to `${{ inputs.NEXT_VERSION }}` in `${{ steps.get-current-branch-name.outputs.name }}`
body: ""
47 changes: 32 additions & 15 deletions .github/workflows/create-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,45 @@ jobs:
git checkout -b ${{ steps.project_version.outputs.version }}
git push origin ${{ steps.project_version.outputs.version }}

# https://github.com/madhead/semver-utils/releases/tag/v4.3.0
- uses: madhead/semver-utils@36d1e0ed361bd7b4b77665de8093092eaeabe6ba
id: parse-version
with:
version: ${{ steps.project_version.outputs.version }}

- name: Compute Z-Branch name
if: steps.parse-version.outputs.patch == '0'
id: compute-z-branch-name
run: |
echo "name=${{ steps.parse-version.outputs.major }}.${{ steps.parse-version.outputs.minor }}.z" >> ${GITHUB_OUTPUT}

- name: Create `${{ steps.compute-z-branch-name.outputs.name }}` branch
if: steps.parse-version.outputs.patch == '0'
run: |
git checkout -b ${{ steps.compute-z-branch-name.outputs.name }}
git push origin ${{ steps.compute-z-branch-name.outputs.name }}

- if: steps.parse-version.outputs.patch == '0'
uses: hazelcast/hazelcast-cpp-client/.github/actions/update-project-version@master
with:
NEXT_VERSION: ${{ steps.parse-version.outputs.inc-patch }}

update-version:
name: Update next version in `${{ inputs.BRANCH_NAME }}` to `${{ inputs.NEXT_VERSION }}`
runs-on: ubuntu-latest
env:
NEW_VERSION: ${{ inputs.NEXT_VERSION }}
steps:
- uses: actions/checkout@v5
with:
ref: ${{ inputs.BRANCH_NAME }}

- name: Update `vcpkg.json`
run: |
cat <<< $(jq --arg ver "${NEW_VERSION}" '.version = $ver' vcpkg.json) > vcpkg.json
- uses: hazelcast/hazelcast-cpp-client/.github/actions/update-project-version@master
with:
NEXT_VERSION: ${{ inputs.NEXT_VERSION }}

- name: Update `CMakeLists.txt`s
- name: Create milestone
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.NEXT_VERSION }}_run_${{ github.run_id }}
title: Update development version to `${{ inputs.NEXT_VERSION }}`
body: ""
gh api \
/repos/${GITHUB_REPOSITORY}/milestones \
--field title='${{ inputs.NEXT_VERSION }}'
env:
GH_TOKEN: ${{ github.token }}
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ jobs:
"${GH_PAGES_BRANCH}/api-index.html"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
# https://github.com/peter-evans/create-pull-request/releases/tag/v7.0.8
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
with:
branch: ${{ needs.prepare.outputs.tag_name }}_doc_update_run_${{ github.run_id }}
title: Add the new C++ client release (`${{ needs.prepare.outputs.tag_name }}`) documentation
Expand Down
Loading