From 672b27893def3afc8c14573238a00395dfb37f37 Mon Sep 17 00:00:00 2001 From: robert Date: Thu, 23 Nov 2023 22:12:22 +0100 Subject: [PATCH 1/3] Correct npmrc --- .npmrc | 2 +- scripts/publish.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.npmrc b/.npmrc index fa779ae..bd3327a 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1 @@ -//registry.npmjs.org/:_authToken=$NPM_TOKEN +//registry.npmjs.org/:_authToken=${NPM_TOKEN} \ No newline at end of file diff --git a/scripts/publish.ts b/scripts/publish.ts index 8d78cd4..e3c304d 100644 --- a/scripts/publish.ts +++ b/scripts/publish.ts @@ -557,12 +557,13 @@ async function run() { // Publish each package changedPackages.map((pkg) => { const packageDir = path.join(rootDir, 'packages', pkg.packageDir) - const cmd = `npm login && cd ${packageDir} && npm publish --tag ${npmTag} --access=public --no-git-checks` + const cmd = `cd ${packageDir} && npm publish --tag ${npmTag} --access=public --no-git-checks` console.info( ` Publishing ${pkg.name}@${version} to npm with tag "${npmTag}"...`, ) - execSync(`${cmd} --token ${process.env.NPM_TOKEN}`) + // execSync(`${cmd} --token ${process.env.NPM_TOKEN}`) + execSync(cmd) }) console.info() From 40c09cf51e5eb841ce0f354221dd24ef9ef922cb Mon Sep 17 00:00:00 2001 From: robert Date: Thu, 23 Nov 2023 22:12:46 +0100 Subject: [PATCH 2/3] Add newline --- .npmrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.npmrc b/.npmrc index bd3327a..ae64359 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1 @@ -//registry.npmjs.org/:_authToken=${NPM_TOKEN} \ No newline at end of file +//registry.npmjs.org/:_authToken=${NPM_TOKEN} From 74f1547fb53607120d7763530d8b9a5c9848fc0e Mon Sep 17 00:00:00 2001 From: robert Date: Thu, 23 Nov 2023 22:15:12 +0100 Subject: [PATCH 3/3] Move login to CI step --- .github/workflows/ci.yml | 3 ++- .npmrc | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 .npmrc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1ddabb..f42af24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,8 @@ jobs: key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-pnpm-store- - + - name: Set deployment token + run: pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" - name: Publish run: | pnpm install --no-frozen-lockfile diff --git a/.npmrc b/.npmrc deleted file mode 100644 index ae64359..0000000 --- a/.npmrc +++ /dev/null @@ -1 +0,0 @@ -//registry.npmjs.org/:_authToken=${NPM_TOKEN}