Skip to content

Commit 47e5ebe

Browse files
committed
update publish
1 parent bee5215 commit 47e5ebe

File tree

2 files changed

+27
-14
lines changed

2 files changed

+27
-14
lines changed

scripts/publish-native.js

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ const cwd = process.cwd()
5555
) {
5656
console.error('Ignoring already published error', platform)
5757
} else {
58-
throw err
58+
// throw err
5959
}
6060
}
61-
// lerna publish in next step will fail if git status is not clean
61+
// lerna publish in next step sill fail if git status is not clean
6262
execSync(
6363
`git update-index --skip-worktree ${path.join(
6464
nativePackagesDir,
@@ -81,12 +81,31 @@ const cwd = process.cwd()
8181
path.join(wasmDir, `pkg-${wasmTarget}/package.json`),
8282
JSON.stringify(wasmPkg, null, 2)
8383
)
84-
execSync(
85-
`npm publish ${path.join(
86-
wasmDir,
87-
`pkg-${wasmTarget}`
88-
)} --access public ${gitref.includes('canary') ? ' --tag canary' : ''}`
89-
)
84+
85+
try {
86+
execSync(
87+
`npm publish ${path.join(
88+
wasmDir,
89+
`pkg-${wasmTarget}`
90+
)} --access public ${
91+
gitref.includes('canary') ? ' --tag canary' : ''
92+
}`
93+
)
94+
} catch (err) {
95+
// don't block publishing other versions on single platform error
96+
console.error(`Failed to publish`, wasmTarget)
97+
98+
if (
99+
err.message &&
100+
err.message.includes(
101+
'You cannot publish over the previously published versions'
102+
)
103+
) {
104+
console.error('Ignoring already published error', wasmTarget)
105+
} else {
106+
// throw err
107+
}
108+
}
90109
}
91110

92111
// Update optional dependencies versions

scripts/publish-release.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ const cwd = process.cwd()
3434
}
3535
console.log(`Publishing ${isCanary ? 'canary' : 'stable'}`)
3636

37-
// TODO: remove after testing, this is a safe guard to ensure we
38-
// don't publish stable unexpectedly
39-
if (!isCanary) {
40-
return
41-
}
42-
4337
const packagesDir = path.join(cwd, 'packages')
4438
const packageDirs = await readdir(packagesDir)
4539

0 commit comments

Comments
 (0)