From 06e5eb0704d995fdfc14738e8a085c27a20e2e11 Mon Sep 17 00:00:00 2001 From: Ludovic Ortega Date: Wed, 18 Feb 2026 13:22:16 +0100 Subject: [PATCH] ci: add create-tag workflow to streamline release process (#2493) Signed-off-by: Ludovic Ortega --- .github/workflows/ci.yml | 4 +- .github/workflows/create-tag.yml | 87 ++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/create-tag.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7f79746..674b466b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,7 +129,7 @@ jobs: build: name: Build (per-arch, native runners) - if: github.ref == 'refs/heads/develop' && !contains(github.event.head_commit.message, '[skip ci]') + if: github.ref == 'refs/heads/develop' strategy: matrix: include: @@ -237,7 +237,7 @@ jobs: discord: name: Send Discord Notification needs: publish - if: always() && github.event_name != 'pull_request' && !contains(github.event.head_commit.message, '[skip ci]') + if: always() && github.event_name != 'pull_request' runs-on: ubuntu-24.04 steps: - name: Determine Workflow Status diff --git a/.github/workflows/create-tag.yml b/.github/workflows/create-tag.yml new file mode 100644 index 00000000..e532d6be --- /dev/null +++ b/.github/workflows/create-tag.yml @@ -0,0 +1,87 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +name: Create tag + +on: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + determine-tag-version: + name: Determine tag version + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-24.04 + permissions: + contents: read + outputs: + tag_version: ${{ steps.git-cliff.outputs.tag_version }} + steps: + - name: Checkout + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Install git-cliff + uses: taiki-e/install-action@cede0bb282aae847dfa8aacca3a41c86d973d4d7 # v2.68.1 + with: + tool: git-cliff + + - name: Get tag version + id: git-cliff + run: | + tag_version=$(git-cliff -c .github/cliff.toml --bumped-version --unreleased) + echo "Next tag version is ${tag_version}" + echo "tag_version=${tag_version}" >> "$GITHUB_OUTPUT" + + create-tag: + name: Create tag + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-24.04 + permissions: + contents: write + needs: determine-tag-version + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAG_VERSION: ${{ needs.determine-tag-version.outputs.tag_version }} + steps: + - name: Checkout + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + with: + ssh-key: '${{ secrets.COMMIT_KEY }}' + + - name: Pnpm Setup + uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 + + - name: Set up Node.js + uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 + with: + node-version-file: 'package.json' + # For workflows with elevated privileges we recommend disabling automatic caching. + # https://github.com/actions/setup-node + package-manager-cache: false + + - name: Configure git + run: | + git config --global user.name "${{ github.actor }}" + git config --global user.email "${{ github.actor }}@users.noreply.github.com" + + - name: Bump package.json + run: npm version ${TAG_VERSION} --no-commit-hooks --no-git-tag-version + + - name: Commit updated files + run: | + git add package.json + git commit -m 'chore(release): prepare ${TAG_VERSION}' + git push + + - name: Create git tag + run: | + git tag ${TAG_VERSION} + git push origin ${TAG_VERSION}