diff --git a/scripts/publish-native.js b/scripts/publish-native.js index 491cca53b2ef486..f8ad52eba7a624a 100755 --- a/scripts/publish-native.js +++ b/scripts/publish-native.js @@ -55,10 +55,10 @@ const cwd = process.cwd() ) { console.error('Ignoring already published error', platform) } 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( `git update-index --skip-worktree ${path.join( nativePackagesDir, @@ -81,12 +81,31 @@ const cwd = process.cwd() path.join(wasmDir, `pkg-${wasmTarget}/package.json`), JSON.stringify(wasmPkg, null, 2) ) - execSync( - `npm publish ${path.join( - wasmDir, - `pkg-${wasmTarget}` - )} --access public ${gitref.includes('canary') ? ' --tag canary' : ''}` - ) + + try { + execSync( + `npm publish ${path.join( + 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 diff --git a/scripts/publish-release.js b/scripts/publish-release.js index 2cc606e06800164..22a02bbcfeb4a13 100755 --- a/scripts/publish-release.js +++ b/scripts/publish-release.js @@ -34,12 +34,6 @@ const cwd = process.cwd() } 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 packageDirs = await readdir(packagesDir)