workflow: use explicit registry when publishing

This commit is contained in:
Evan You 2024-08-12 07:05:06 +08:00
parent a1ee8b719f
commit 119a0b3832
No known key found for this signature in database
GPG Key ID: 00E9AB7A6704CE0A
2 changed files with 5 additions and 1 deletions

View File

@ -34,6 +34,6 @@ jobs:
- name: Build and publish
id: publish
run: |
pnpm release 0.0.0-${{ github.event.workflow_run.head_commit }} --tag ${{ github.event.workflow_run.head_branch }} --publishOnly
pnpm release 0.0.0-${{ github.event.workflow_run.head_commit.id }} --tag ${{ github.event.workflow_run.head_branch }} --registry https://npm.pkg.github.com --publishOnly
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -58,6 +58,9 @@ const { values: args, positionals } = parseArgs({
publishOnly: {
type: 'boolean',
},
registry: {
type: 'string',
},
},
})
@ -545,6 +548,7 @@ async function publishPackage(pkgName, version, additionalFlags) {
...(releaseTag ? ['--tag', releaseTag] : []),
'--access',
'public',
...(args.registry ? ['--registry', args.registry] : []),
...additionalFlags,
],
{