Skip to content

Commit b59f621

Browse files
committed
fix: update version to 5.0.0-beta.3 and enhance npm publish workflow
1 parent 27a92f2 commit b59f621

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

.github/workflows/npmpublish.yml

+11-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,17 @@ jobs:
4242
npm install
4343
npm run build
4444
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
45-
npm publish
45+
# print the NPM user name for validation
46+
npm whoami
47+
VERSION=$(node -p "require('./package.json').version" )
48+
# Only publish stable versions to the latest tag
49+
if [[ "$VERSION" =~ ^[^-]+$ ]]; then
50+
NPM_TAG="latest"
51+
else
52+
NPM_TAG="beta"
53+
fi
54+
echo "Publishing $VERSION with $NPM_TAG tag."
55+
npm publish --tag $NPM_TAG --access public
4656
env:
4757
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
4858
CI: true

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@imagekit/javascript",
3-
"version": "5.0.0-beta.2",
3+
"version": "5.0.0-beta.3",
44
"description": "ImageKit Javascript SDK",
55
"main": "dist/imagekit.cjs.js",
66
"module": "dist/imagekit.esm.js",

0 commit comments

Comments
 (0)