Skip to content

Commit

Permalink
update publish
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Oct 25, 2022
1 parent bee5215 commit 47e5ebe
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 14 deletions.
35 changes: 27 additions & 8 deletions scripts/publish-native.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
6 changes: 0 additions & 6 deletions scripts/publish-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 47e5ebe

Please sign in to comment.