Skip to content

Commit 3f7edce

Browse files
authored
Merge pull request #163 from ether/ci/explicit-commit-and-tag
ci: create the git commit + tag ourselves, not via pnpm version patch
2 parents 40e9b4d + 83febc3 commit 3f7edce

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

.github/workflows/npmpublish.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,16 @@ jobs:
6060
git config user.name 'github-actions[bot]'
6161
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
6262
pnpm i --frozen-lockfile
63-
# `pnpm version patch` bumps package.json, makes a commit, and creates
64-
# a `v<new-version>` tag. Capture the new tag name from package.json
65-
# rather than parsing pnpm's output, which has historically varied.
66-
pnpm version patch
63+
# pnpm's `version patch` silently stopped creating the git tag on
64+
# some pnpm pre-release channels that pnpm/action-setup@v6 ends
65+
# up installing even when `version: 10.x` is requested
66+
# (see pnpm/action-setup#225). Do the bump ourselves so the tag
67+
# is always created.
68+
pnpm version patch --no-git-tag-version --no-commit-hooks
6769
NEW_TAG="v$(node -p "require('./package.json').version")"
70+
git add package.json pnpm-lock.yaml
71+
git commit -m "${NEW_TAG}"
72+
git tag -a "${NEW_TAG}" -m "${NEW_TAG}"
6873
# CRITICAL: use --atomic so the branch update and the tag update
6974
# succeed (or fail) as a single transaction on the server. The old
7075
# `git push --follow-tags` was non-atomic per ref: if a concurrent

0 commit comments

Comments
 (0)