File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Release
22
33on :
4- workflow_dispatch :
5- inputs :
6- tag_name :
7- description : Release tag name (e.g., v1.0.0-beta.1)
8- type : string
9- default : ' '
104 workflow_call :
115 inputs :
126 tag_name :
13- description : Release tag name (e.g., v1.0 .0-beta.1)
7+ description : Release tag name (e.g., v0.12 .0-beta.1)
148 type : string
159 default : ' '
1610
3226 registry-url : ' https://registry.npmjs.org'
3327 cache : pnpm
3428
35- - name : Remove token auth from npmrc (use OIDC instead)
36- run : sed -i '/_authToken/d' "$NPM_CONFIG_USERCONFIG"
37-
3829 - name : Install
3930 run : pnpm install
4031
@@ -46,13 +37,20 @@ jobs:
4637 env :
4738 TAG_NAME : ${{ inputs.tag_name }}
4839 run : |
49- if [[ "$TAG_NAME" == *"-"* ]]; then
40+ VERSION="${TAG_NAME#v}"
41+
42+ if [[ -z "$VERSION" ]]; then
43+ VERSION="$(node -p "require('./package.json').version")"
44+ fi
45+
46+ if [[ "$VERSION" == *"-"* ]]; then
5047 echo "tag=beta" >> "$GITHUB_OUTPUT"
5148 else
5249 echo "tag=latest" >> "$GITHUB_OUTPUT"
5350 fi
5451
5552 - name : Publish
5653 run : |
54+ sed -i '/_authToken/d' "$NPM_CONFIG_USERCONFIG"
5755 unset NODE_AUTH_TOKEN
5856 pnpm publish --tag ${{ steps.npm-tag.outputs.tag }} --access public --no-git-checks --provenance
You can’t perform that action at this time.
0 commit comments