Unverified Commit 47c8c6fc authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[cd] Continue release train if `@next/swc-wasm-*` fails to publish (#94912)

https://github.com/vercel/next.js/pull/94622 tried to be more strict
with when a release is considered healthy. However, `@next/swc-wasm-web`
is not enrolled in Trusted Publishing and blocks the release train.

This PR restores the behavior for `@next/swc-wasm-*` packages prior to
https://github.com/vercel/next.js/pull/94622 i.e. we continue the
release train even if any `@next/swc-wasm-*` fails. Other NAPI bindings
will continue to block the release train if they fail to publish.

The bail vs no-bail behavior is controlled with a repository variable so
that we can mor easily test if `@next/swc-wasm-web` is enrolled in
Trusted Publishing.
parent 465521c5
...@@ -635,6 +635,7 @@ jobs: ...@@ -635,6 +635,7 @@ jobs:
- run: ./scripts/publish-release.js - run: ./scripts/publish-release.js
env: env:
RELEASE_GITHUB_TOKEN: ${{ steps.release-app-token.outputs.token }} RELEASE_GITHUB_TOKEN: ${{ steps.release-app-token.outputs.token }}
BAIL_ON_NATIVE_WASM_PUBLISH_FAILURE: ${{ vars.BAIL_ON_NATIVE_WASM_PUBLISH_FAILURE }}
- name: Upload pnpm publish summary - name: Upload pnpm publish summary
if: always() if: always()
......
...@@ -186,12 +186,25 @@ const publishRetryDelaySeconds = 15 ...@@ -186,12 +186,25 @@ const publishRetryDelaySeconds = 15
}) })
) )
const results = [...nativeResults, ...wasmResults] if (nativeResults.some((item) => item.status === 'rejected')) {
if (results.some((item) => item.status === 'rejected')) { console.error(
console.error(`Not all packages published successfully`, results) `Not all native packages published successfully`,
nativeResults
)
process.exit(1) process.exit(1)
} }
if (wasmResults.some((item) => item.status === 'rejected')) {
console.error(`Not all wasm packages published successfully`, wasmResults)
if (process.env.BAIL_ON_NATIVE_WASM_PUBLISH_FAILURE === 'true') {
process.exit(1)
} else {
console.warn(
'Continuing with release even though some wasm packages failed to publish because BAIL_ON_NATIVE_WASM_PUBLISH_FAILURE is not set to true'
)
}
}
// Update optional dependencies versions // Update optional dependencies versions
const nextPkg = JSON.parse( const nextPkg = JSON.parse(
await fs.readFile(path.join(cwd, 'packages/next/package.json'), { await fs.readFile(path.join(cwd, 'packages/next/package.json'), {
......
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