update publish

parent bee52154
...@@ -55,10 +55,10 @@ const cwd = process.cwd() ...@@ -55,10 +55,10 @@ const cwd = process.cwd()
) { ) {
console.error('Ignoring already published error', platform) console.error('Ignoring already published error', platform)
} else { } else {
throw err // throw err
} }
} }
// lerna publish in next step will fail if git status is not clean // lerna publish in next step sill fail if git status is not clean
execSync( execSync(
`git update-index --skip-worktree ${path.join( `git update-index --skip-worktree ${path.join(
nativePackagesDir, nativePackagesDir,
...@@ -81,12 +81,31 @@ const cwd = process.cwd() ...@@ -81,12 +81,31 @@ const cwd = process.cwd()
path.join(wasmDir, `pkg-${wasmTarget}/package.json`), path.join(wasmDir, `pkg-${wasmTarget}/package.json`),
JSON.stringify(wasmPkg, null, 2) JSON.stringify(wasmPkg, null, 2)
) )
execSync(
`npm publish ${path.join( try {
wasmDir, execSync(
`pkg-${wasmTarget}` `npm publish ${path.join(
)} --access public ${gitref.includes('canary') ? ' --tag canary' : ''}` wasmDir,
) `pkg-${wasmTarget}`
)} --access public ${
gitref.includes('canary') ? ' --tag canary' : ''
}`
)
} catch (err) {
// don't block publishing other versions on single platform error
console.error(`Failed to publish`, wasmTarget)
if (
err.message &&
err.message.includes(
'You cannot publish over the previously published versions'
)
) {
console.error('Ignoring already published error', wasmTarget)
} else {
// throw err
}
}
} }
// Update optional dependencies versions // Update optional dependencies versions
......
...@@ -34,12 +34,6 @@ const cwd = process.cwd() ...@@ -34,12 +34,6 @@ const cwd = process.cwd()
} }
console.log(`Publishing ${isCanary ? 'canary' : 'stable'}`) console.log(`Publishing ${isCanary ? 'canary' : 'stable'}`)
// TODO: remove after testing, this is a safe guard to ensure we
// don't publish stable unexpectedly
if (!isCanary) {
return
}
const packagesDir = path.join(cwd, 'packages') const packagesDir = path.join(cwd, 'packages')
const packageDirs = await readdir(packagesDir) const packageDirs = await readdir(packagesDir)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment