Skip to content

Commit

Permalink
fix: downgrade semantic-release (#1344)
Browse files Browse the repository at this point in the history
To prevent mixed ESM/CJS imports
  • Loading branch information
achingbrain committed Jul 31, 2023
1 parent 900d7e7 commit 2a09f6c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 11 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
"@semantic-release/commit-analyzer": "^10.0.1",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^9.0.3",
"@semantic-release/npm": "^10.0.4",
"@semantic-release/npm": "^9.0.2",
"@semantic-release/release-notes-generator": "^11.0.4",
"@types/chai": "^4.2.16",
"@types/chai-as-promised": "^7.1.3",
Expand Down Expand Up @@ -302,7 +302,7 @@
"react-native-test-runner": "^5.0.0",
"read-pkg-up": "^10.0.0",
"rimraf": "^5.0.0",
"semantic-release": "^21.0.7",
"semantic-release": "^20.1.3",
"semantic-release-monorepo": "^7.0.5",
"semver": "^7.3.8",
"source-map-support": "^0.5.20",
Expand Down
42 changes: 33 additions & 9 deletions src/release-rc.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,23 @@ async function releaseMonorepoRcs (commit, ctx) {

await retry(async () => {
console.info(`npm publish --tag ${ctx.tag} --dry-run ${!process.env.CI}`)
await execa('npm', ['publish', '--tag', ctx.tag, '--dry-run', `${!process.env.CI}`], {
stdout: 'inherit',
stderr: 'inherit',
cwd: project.dir
})

try {
await execa('npm', ['publish', '--tag', ctx.tag, '--dry-run', `${!process.env.CI}`], {
stdout: 'inherit',
stderr: 'inherit',
cwd: project.dir,
all: true
})
} catch (/** @type {any} */ err) {
if (err.all?.includes('You cannot publish over the previously published versions')) {
// this appears to be a bug in npm, sometimes you publish successfully but it also
// returns an error
return
}

throw err
}
}, {
retries: ctx.retries
})
Expand All @@ -107,10 +119,22 @@ async function releaseRc (commit, ctx) {

await retry(async () => {
console.info(`npm publish --tag ${ctx.tag} --dry-run ${!process.env.CI}`)
await execa('npm', ['publish', '--tag', ctx.tag, '--dry-run', `${!process.env.CI}`], {
stdout: 'inherit',
stderr: 'inherit'
})

try {
await execa('npm', ['publish', '--tag', ctx.tag, '--dry-run', `${!process.env.CI}`], {
stdout: 'inherit',
stderr: 'inherit',
all: true
})
} catch (/** @type {any} */ err) {
if (err.all?.includes('You cannot publish over the previously published versions')) {
// this appears to be a bug in npm, sometimes you publish successfully but it also
// returns an error
return
}

throw err
}
}, {
retries: ctx.retries
})
Expand Down

0 comments on commit 2a09f6c

Please sign in to comment.