File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,19 +69,20 @@ jobs:
6969 cache : pnpm
7070 registry-url : https://registry.npmjs.org/
7171 -
72- name : Bump version (patch )
72+ name : Tag the version in package.json (if not already tagged )
7373 run : |
74- LATEST_TAG=$(git describe --tags --abbrev=0) || exit 1
75- NEW_COMMITS=$(git rev-list --count "${LATEST_TAG}"..) || exit 1
76- [ "${NEW_COMMITS}" -gt 0 ] || exit 0
74+ PKG_VER=$(node -p "require('./package.json').version")
75+ if git rev-parse -q --verify "refs/tags/v${PKG_VER}" >/dev/null; then
76+ echo "v${PKG_VER} already tagged; nothing to do."
77+ exit 0
78+ fi
7779 git config user.name 'github-actions[bot]'
7880 git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
79- pnpm i
80- pnpm version patch
81- git push --follow-tags
81+ git tag "v${PKG_VER}"
82+ git push origin "v${PKG_VER}"
8283 -
83- run : pnpm i
84+ run : pnpm i --frozen-lockfile
8485 -
85- run : pnpm publish
86+ run : pnpm publish --no-git-checks
8687 env :
8788 NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
You can’t perform that action at this time.
0 commit comments