Skip to content

Commit 2f95d70

Browse files
committed
fix: don't publish beta as latest
Hard to undo since key is only in CI, but for future beta deploys
1 parent 6c5c49e commit 2f95d70

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

.github/workflows/deploy-package.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,24 @@ jobs:
6868

6969
- name: Create .npmrc for NPM
7070
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPMJS_NPM_MATTERLABS_AUTOMATION_TOKEN }}" > ~/.npmrc
71+
72+
- name: Determine npm publish tag
73+
id: npm_tag
74+
run: |
75+
VERSION="${{ github.event.inputs.version }}"
76+
if [[ "$VERSION" =~ -([a-zA-Z0-9]+) ]]; then
77+
TAG="${BASH_REMATCH[1]}"
78+
else
79+
TAG="latest"
80+
fi
7181
7282
- name: Publish SDK to NPM
7383
working-directory: packages/sdk
74-
run: npm publish --access public
84+
run: npm publish --access public --tag ${{ steps.npm_tag.outputs.tag }}
7585

7686
- name: Publish connector-export to NPM
7787
working-directory: packages/connector-export
78-
run: npm publish --access public
88+
run: npm publish --access public --tag ${{ steps.npm_tag.outputs.tag }}
7989

8090
- name: Create .npmrc for GitHub Packages
8191
run: |
@@ -88,11 +98,11 @@ jobs:
8898
run: |
8999
# Update package name for GitHub Packages to be scoped to the organization
90100
npm pkg set name="@matter-labs/zksync-sso"
91-
npm publish --registry=https://npm.pkg.github.com
101+
npm publish --registry=https://npm.pkg.github.com --tag ${{ steps.npm_tag.outputs.tag }}
92102
93103
- name: Publish connector-export to GitHub Packages
94104
working-directory: packages/connector-export
95105
run: |
96106
# Update package name for GitHub Packages to be scoped to the organization
97107
npm pkg set name="@matter-labs/zksync-sso-connector-export"
98-
npm publish --registry=https://npm.pkg.github.com
108+
npm publish --registry=https://npm.pkg.github.com --tag ${{ steps.npm_tag.outputs.tag }}

0 commit comments

Comments
 (0)