-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f9d52e1
commit a6b03fb
Showing
1 changed file
with
12 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,10 +17,20 @@ jobs: | |
node-version: 20 | ||
registry-url: https://registry.npmjs.org/ | ||
- run: pnpm install | ||
- run: pnpm --filter=babel-plugin-canyon publish -f --no-git-checks --access=public --filter | ||
- run: | | ||
# 获取当前的版本号 | ||
VERSION=$(jq -r '.version' package.json) | ||
# 检查该版本是否已经发布 | ||
if npm show babel-plugin-canyon@$VERSION; then | ||
echo "Version $VERSION already published. Skipping publish." | ||
else | ||
pnpm --filter=babel-plugin-canyon publish -f --no-git-checks --access=public | ||
fi | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}} | ||
- run: | | ||
pnpm dist-tag add [email protected] latest | ||
# 如果发布成功,则添加 dist-tag | ||
VERSION=$(jq -r '.version' package.json) | ||
pnpm dist-tag add babel-plugin-canyon@$VERSION latest | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}} |