should fix publishing to npm
This commit is contained in:
parent
153101fa6f
commit
dbd4058912
2 changed files with 12 additions and 1 deletions
4
.github/workflows/publish.yml
vendored
4
.github/workflows/publish.yml
vendored
|
|
@ -47,6 +47,10 @@ jobs:
|
|||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: .vercel/output/static
|
||||
force_orphan: true
|
||||
- name: Set publishing config
|
||||
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
- run: pnpm tsx scripts/buildNpmReact.ts ${{ steps.release.outputs.tag }}
|
||||
if: steps.release.outputs.tag
|
||||
env:
|
||||
|
|
|
|||
|
|
@ -148,6 +148,13 @@ fs.promises.readdir(path.resolve(__dirname, '../src/react')).then(async (files)
|
|||
fs.copyFileSync(path.resolve(__dirname, '../README.NPM.MD'), path.resolve(__dirname, '../dist-npm/README.md'))
|
||||
|
||||
if (version !== '0.0.0-dev') {
|
||||
execSync('npm publish', { cwd: path.resolve(__dirname, '../dist-npm') })
|
||||
execSync('npm publish', {
|
||||
cwd: path.resolve(__dirname, '../dist-npm'),
|
||||
env: {
|
||||
...process.env,
|
||||
NPM_TOKEN: process.env.NPM_TOKEN,
|
||||
NODE_AUTH_TOKEN: process.env.NPM_TOKEN
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue