From bf9a5d866495ea5c92a36d5e6095307a7f22dd26 Mon Sep 17 00:00:00 2001 From: Jack Date: Thu, 6 Nov 2025 21:57:17 +0000 Subject: [PATCH 1/3] Partially automate release - tagging and documentation generation _Partially_ automates the steps in https://hazelcast.atlassian.net/wiki/spaces/HZC/pages/129810774/C+Client+Release+Process Specifically: - Git tagging - Doxygen By scripting and chaining the steps, the (manual) release work is reduced and consistency is improved. Tagging logic based on [approach in `hazelcast-docker`](https://github.com/hazelcast/hazelcast-docker/blob/master/.github/workflows/retag.yml). Of note - the instructions call for an "annotated tag" (`tag -a`). While this [seems more sensible](https://stackoverflow.com/q/4971746), it's not [how we make tags elsewhere](https://github.com/search?q=org%3Ahazelcast%20%22git%20tag%22&type=code) (most notablly - [in the release pipeline](https://github.com/hazelcast/hazelcast-pipeline-library/blob/43882a84b3715e2ac74f84c92f3c3d170504f2ab/src/com/hazelcast/qe/pipeline/git/Branch.groovy#L122-L127)), so for consistency I've changed to lightweight tags. Testing: - [example execution](https://github.com/JackPGreen/hazelcast-cpp-client/actions/runs/19150806835) - [tag created](https://github.com/JackPGreen/hazelcast-cpp-client/releases/tag/v5.5.3) - [documentation PR raised](https://github.com/JackPGreen/hazelcast-cpp-client/pull/4) Post-merge actions: - [ ] update docs --- .github/workflows/release.yml | 87 +++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..96b8f3ffa --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,87 @@ +name: Release + +on: + workflow_dispatch: + inputs: + BRANCH_NAME: + description: The branch to work with, if not implicit + required: false + +jobs: + prepare: + name: Prepare + runs-on: ubuntu-latest + outputs: + branch_name: ${{ inputs.BRANCH_NAME || github.ref_name }} + tag_name: v${{ inputs.BRANCH_NAME || github.ref_name }} + steps: + - run: exit 0 + + tag: + name: Tag and delete branch + runs-on: ubuntu-latest + needs: prepare + steps: + - uses: actions/checkout@v5 + with: + ref: ${{ needs.prepare.outputs.branch_name }} + fetch-depth: 0 + + - name: Tag `${{ needs.prepare.outputs.branch_name }}` as `${{ needs.prepare.outputs.tag_name }}` + run: | + git tag ${{ needs.prepare.outputs.tag_name }} origin/${{ needs.prepare.outputs.branch_name }} + git push origin ${{ needs.prepare.outputs.tag_name }} + + - name: Delete `${{ needs.prepare.outputs.branch_name }}` + run: | + git push origin --delete ${{ needs.prepare.outputs.branch_name }} + + pages: + name: Publish docs + runs-on: ubuntu-latest + needs: + - tag + - prepare + env: + GH_PAGES_BRANCH: gh-pages + steps: + - uses: actions/checkout@v5 + with: + path: repo + ref: ${{ needs.prepare.outputs.tag_name }} + + - uses: actions/checkout@v5 + with: + ref: ${{ env.GH_PAGES_BRANCH}} + path: ${{ env.GH_PAGES_BRANCH}} + + - name: Install Doxygen + run: | + sudo apt-get update + sudo apt-get install -y doxygen + + - name: Generate Doxygen documentation + run: | + doxygen repo/Doxyfile + + - name: Post-process docs + run: | + mv docs/html ${GH_PAGES_BRANCH}/${{ needs.prepare.outputs.branch_name }} + + # doc-index.html + sed -i \ + "/Development Branch/a\
  • ${{ needs.prepare.outputs.branch_name }}
  • " \ + "${GH_PAGES_BRANCH}/doc-index.html" + + # api-index.html + sed -i \ + "/