ci(publish-sdk): allow same-version on npm bump

When /VERSION is bumped on the source branch before tagging, the SDK
package.json already matches the release tag. Without --allow-same-version,
npm version errors as 'Version not changed' and the workflow fails on
stable main releases (nightly worked by accident because the bump was
done in the previous commit cycle and package.json was a step behind).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
anonpenguin23 2026-05-12 10:07:34 +03:00
parent fbe05d94b3
commit cd690bd28c

View File

@ -61,9 +61,13 @@ jobs:
if [ "${{ github.event_name }}" = "release" ]; then
VERSION="${{ github.event.release.tag_name }}"
VERSION="${VERSION#v}"
npm version "$VERSION" --no-git-tag-version
# --allow-same-version: when /VERSION was already bumped on the
# source branch before tagging, package.json may already match
# the tag. npm version errors as 'Version not changed' without
# this flag.
npm version "$VERSION" --no-git-tag-version --allow-same-version
elif [ -n "${{ inputs.version }}" ]; then
npm version ${{ inputs.version }} --no-git-tag-version
npm version ${{ inputs.version }} --no-git-tag-version --allow-same-version
fi
- name: Typecheck