From bcd522650b626c83f49e14ba61283d6010721c69 Mon Sep 17 00:00:00 2001 From: "gp42-ops (GitHub)" <91820843+gp42-ops@users.noreply.github.com> Date: Sat, 2 May 2026 21:33:41 +0300 Subject: [PATCH 1/2] ci: update release workflow --- .github/workflows/release.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c148160..a351db2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,10 +24,20 @@ jobs: tag: ${{ steps.tag.outputs.tag }} released: ${{ steps.tag.outputs.released }} steps: + # Mint a short-lived GitHub App installation token. Required so the + # bump commit pushed below triggers downstream workflows (CI on the + # PR branch, tag-push handler). The default GITHUB_TOKEN is blocked + # from triggering other workflows by GitHub's anti-recursion rule. + - id: app-token + uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1 + with: + client-id: ${{ secrets.RELEASE_APP_CLIENT_ID }} + private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} + - uses: actions/checkout@v4 with: fetch-depth: 0 - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ steps.app-token.outputs.token }} - name: Compute bump args id: args From e7a67e4c6f13962e2845641e9515e79daea0d18e Mon Sep 17 00:00:00 2001 From: "gp42-ops (GitHub)" <91820843+gp42-ops@users.noreply.github.com> Date: Sat, 2 May 2026 23:43:48 +0300 Subject: [PATCH 2/2] fix: update release workflow --- .github/workflows/release.yml | 67 +++++++++++++++++++++++------------ CHANGELOG.md | 64 --------------------------------- cog.toml | 11 +++--- 3 files changed, 50 insertions(+), 92 deletions(-) delete mode 100644 CHANGELOG.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a351db2..5fd9aad 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,7 @@ name: Release on: push: branches: [main] + tags: ["v*"] workflow_dispatch: {} permissions: @@ -19,27 +20,24 @@ jobs: # from conventional commits, updates package.json + CHANGELOG.md, # commits "chore(version): X.Y.Z", and tags vX.Y.Z. release: + # Skip when the triggering push is the bot's own version-bump commit + # to avoid re-running the workflow on the bump (which would either + # no-op or, on tag pushes, double-publish). + if: >- + github.event_name != 'push' || + !startsWith(github.event.head_commit.message, 'chore(version):') runs-on: ubuntu-latest outputs: tag: ${{ steps.tag.outputs.tag }} released: ${{ steps.tag.outputs.released }} steps: - # Mint a short-lived GitHub App installation token. Required so the - # bump commit pushed below triggers downstream workflows (CI on the - # PR branch, tag-push handler). The default GITHUB_TOKEN is blocked - # from triggering other workflows by GitHub's anti-recursion rule. - - id: app-token - uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1 - with: - client-id: ${{ secrets.RELEASE_APP_CLIENT_ID }} - private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} - - uses: actions/checkout@v4 with: fetch-depth: 0 - token: ${{ steps.app-token.outputs.token }} + token: ${{ secrets.GITHUB_TOKEN }} - name: Compute bump args + if: github.ref_type != 'tag' id: args run: | if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then @@ -54,10 +52,12 @@ jobs: fi - name: Capture pre-bump tag + if: github.ref_type != 'tag' id: before run: echo "tag=$(git describe --tags --abbrev=0 2>/dev/null || echo '')" >> "$GITHUB_OUTPUT" - name: Bump + if: github.ref_type != 'tag' id: bump uses: cocogitto/cocogitto-action@9a9fe03b31c47444290c0d7f9b1ee1b44ee13f20 # v4.1.0 continue-on-error: true @@ -70,21 +70,32 @@ jobs: - name: Resolve tag + released flag id: tag run: | - AFTER=$(git describe --tags --abbrev=0 2>/dev/null || echo "") - if [[ -z "$AFTER" || "$AFTER" == "${{ steps.before.outputs.tag }}" ]]; then - echo "released=false" >> "$GITHUB_OUTPUT" - echo "No releasable commits since '${{ steps.before.outputs.tag }}'" - else + if [[ "${{ github.ref_type }}" == "tag" ]]; then echo "released=true" >> "$GITHUB_OUTPUT" - echo "tag=$AFTER" >> "$GITHUB_OUTPUT" + echo "tag=${{ github.ref_name }}" >> "$GITHUB_OUTPUT" + else + AFTER=$(git describe --tags --abbrev=0 2>/dev/null || echo "") + if [[ -z "$AFTER" || "$AFTER" == "${{ steps.before.outputs.tag }}" ]]; then + echo "released=false" >> "$GITHUB_OUTPUT" + echo "No releasable commits since '${{ steps.before.outputs.tag }}'" + else + echo "released=true" >> "$GITHUB_OUTPUT" + echo "tag=$AFTER" >> "$GITHUB_OUTPUT" + fi fi - - name: Push commit + tag - if: steps.tag.outputs.released == 'true' - run: | - git push origin "HEAD:${{ github.ref_name }}" - git push origin "${{ steps.tag.outputs.tag }}" - + - name: Push tag + if: github.ref_type != 'tag' && steps.tag.outputs.released == 'true' + # Push only the tag - cog doesn't create a bump commit + # (disable_bump_commit), so the tag points at the existing + # branch HEAD. No writes to the branch, branch protection + # untouched, history clean. + run: git push origin "${{ steps.tag.outputs.tag }}" + + # Build + publish run in-band in the same workflow run that pushed the + # tag (whether dispatched, push-to-main, or triggered by a manual tag + # push). Pushes from GITHUB_TOKEN don't retrigger workflows, so no + # double-fire from our own tag pushes. build: needs: [release] if: needs.release.outputs.released == 'true' @@ -101,6 +112,11 @@ jobs: - run: npm ci + - name: Stamp version from tag + env: + TAG: ${{ needs.release.outputs.tag }} + run: npm version "${TAG#v}" --no-git-tag-version --allow-same-version + - run: npm run typecheck - run: npm run build @@ -157,6 +173,11 @@ jobs: - run: npm ci + - name: Stamp version from tag + env: + TAG: ${{ needs.release.outputs.tag }} + run: npm version "${TAG#v}" --no-git-tag-version --allow-same-version + - run: npm run typecheck - run: npm run build diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index fd3f30a..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,64 +0,0 @@ -# Changelog -All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines. - -- - - -## v1.0.1 - 2026-05-02 - -- - - - -## v1.0.1-rc.17 - 2026-05-02 -#### Bug Fixes -- cut release - (523d330) - gp42-ops (GitHub) -#### Miscellaneous Chores -- (**version**) v1.0.1-rc.17 - (de0d920) - github-actions[bot] - -- - - - -## v1.0.1-rc.17 - 2026-05-02 -#### Bug Fixes -- cut release - (523d330) - gp42-ops (GitHub) - -- - - - -## v0.1.0 - 2026-05-02 - -- - - - -## v0.1.0-rc.14 - 2026-05-02 -#### Miscellaneous Chores -- (**version**) v0.1.0-rc.14 - (2a58ae6) - github-actions[bot] - -- - - - -## v0.1.0-rc.13 - 2026-05-02 -#### Features -- BREAKINGupdate release workflow and trigger release - (c2d7b3d) - Gennady Potapov -- BREAKINGinitial 1.0.0 release - (eecfc8c) - Gennady Potapov -#### Continuous Integration -- switch release flow to cocogitto - (0cc4d51) - Gennady Potapov -#### Miscellaneous Chores -- (**version**) v0.1.0-rc.13 - (4f7fe17) - github-actions[bot] - -- - - - -## v0.1.0-rc.14 - 2026-05-02 -#### Features -- BREAKINGupdate release workflow and trigger release - (c2d7b3d) - Gennady Potapov -- BREAKINGinitial 1.0.0 release - (eecfc8c) - Gennady Potapov -#### Continuous Integration -- switch release flow to cocogitto - (0cc4d51) - Gennady Potapov -#### Miscellaneous Chores -- (**version**) v0.1.0-rc.13 - (4f7fe17) - github-actions[bot] - -- - - - -## v0.1.0-rc.13 - 2026-05-02 -#### Features -- BREAKINGupdate release workflow and trigger release - (c2d7b3d) - Gennady Potapov -- BREAKINGinitial 1.0.0 release - (eecfc8c) - Gennady Potapov -#### Continuous Integration -- switch release flow to cocogitto - (0cc4d51) - Gennady Potapov - -- - - - -Changelog generated by [cocogitto](https://github.com/cocogitto/cocogitto). \ No newline at end of file diff --git a/cog.toml b/cog.toml index a50d0cc..9afa818 100644 --- a/cog.toml +++ b/cog.toml @@ -1,13 +1,14 @@ tag_prefix = "v" ignore_merge_commits = true -# Keep package.json version in sync with the bumped tag. -pre_bump_hooks = [ - "npm version --no-git-tag-version --allow-same-version {{version}}", -] +# We use cog only to decide the next version and create the tag. +# No bump commit on the branch, no CHANGELOG.md committed to the repo. +# package.json stays at 0.0.0 in source - CI stamps the real version +# from the tag before npm pack/publish. +disable_bump_commit = true +disable_changelog = true [changelog] -path = "CHANGELOG.md" remote = "github.com" owner = "hostsmith" repository = "js-sdk"