From 9d62db47e89f78e94a713ead6978637f1158e3d8 Mon Sep 17 00:00:00 2001 From: Segev Finer Date: Tue, 14 Nov 2023 14:00:07 +0200 Subject: [PATCH] chore(cli): simplify publish step in ci-template (#1812) * Simplify publish step in ci-template * Update ci-template.ts --- cli/src/api/templates/ci-template.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cli/src/api/templates/ci-template.ts b/cli/src/api/templates/ci-template.ts index 0c12e72b..176aeab5 100644 --- a/cli/src/api/templates/ci-template.ts +++ b/cli/src/api/templates/ci-template.ts @@ -543,6 +543,7 @@ jobs: with: node-version: 18 cache: 'yarn' + registry-url: 'https://registry.npmjs.org' - name: 'Install dependencies' run: yarn install @@ -561,19 +562,16 @@ jobs: - name: Publish run: | - npm config set provenance true if git log -1 --pretty=%B | grep "^[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+$"; then - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - npm publish --access public + npm publish --access public --provenance elif git log -1 --pretty=%B | grep "^[0-9]\\+\\.[0-9]\\+\\.[0-9]\\+"; then - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc - npm publish --tag next --access public + npm publish --tag next --access public --provenance else echo "Not a release, skipping publish" fi env: GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: \${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: \${{ secrets.NPM_TOKEN }} `