Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
bb25edfd
Unverified
Commit
bb25edfd
authored
Dec 08, 2023
by
OJ Kwon
Committed by
GitHub
Dec 08, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ci(workflow): restore publish wasm binary (#59414)
parent
daa207bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
54 deletions
+49
-54
publish-native.js
scripts/publish-native.js
+49
-54
No files found.
scripts/publish-native.js
View file @
bb25edfd
...
...
@@ -73,60 +73,55 @@ const cwd = process.cwd()
)
// Update name/version of wasm packages and publish
// const pkgDirectory = 'packages/next-swc/crates/wasm'
// let wasmDir = path.join(cwd, pkgDirectory)
// await Promise.all(
// ['web', 'nodejs'].map(async (wasmTarget) => {
// await publishSema.acquire()
// let wasmPkg = JSON.parse(
// await readFile(path.join(wasmDir, `pkg-${wasmTarget}/package.json`))
// )
// wasmPkg.name = `@next/swc-wasm-${wasmTarget}`
// wasmPkg.version = version
// wasmPkg.repository = {
// type: 'git',
// url: 'https://github.com/vercel/next.js',
// directory: pkgDirectory,
// }
// await writeFile(
// path.join(wasmDir, `pkg-${wasmTarget}/package.json`),
// JSON.stringify(wasmPkg, null, 2)
// )
// try {
// await execa(
// `npm`,
// [
// 'publish',
// `${path.join(wasmDir, `pkg-${wasmTarget}`)}`,
// '--access',
// 'public',
// ...(version.includes('canary') ? ['--tag', 'canary'] : []),
// ],
// { stdio: 'inherit' }
// )
// } catch (err) {
// // don't block publishing other versions on single platform error
// console.error(`Failed to publish`, wasmTarget, err)
// if (
// err.message &&
// err.message.includes(
// 'You cannot publish over the previously published versions'
// )
// ) {
// console.error('Ignoring already published error', wasmTarget)
// } else {
// // throw err
// }
// } finally {
// publishSema.release()
// }
// })
// )
const
pkgDirectory
=
'packages/next-swc/crates/wasm'
let
wasmDir
=
path
.
join
(
cwd
,
pkgDirectory
)
await
Promise
.
all
(
[
'web'
,
'nodejs'
].
map
(
async
(
wasmTarget
)
=>
{
await
publishSema
.
acquire
()
let
wasmPkg
=
JSON
.
parse
(
await
readFile
(
path
.
join
(
wasmDir
,
`pkg-
${
wasmTarget
}
/package.json`
))
)
wasmPkg
.
name
=
`@next/swc-wasm-
${
wasmTarget
}
`
wasmPkg
.
version
=
version
wasmPkg
.
repository
=
{
type
:
'git'
,
url
:
'https://github.com/vercel/next.js'
,
directory
:
pkgDirectory
,
}
await
writeFile
(
path
.
join
(
wasmDir
,
`pkg-
${
wasmTarget
}
/package.json`
),
JSON
.
stringify
(
wasmPkg
,
null
,
2
)
)
try
{
await
execa
(
`npm`
,
[
'publish'
,
`
${
path
.
join
(
wasmDir
,
`pkg-
${
wasmTarget
}
`
)}
`
,
'--access'
,
'public'
,
...(
version
.
includes
(
'canary'
)
?
[
'--tag'
,
'canary'
]
:
[]),
],
{
stdio
:
'inherit'
}
)
}
catch
(
err
)
{
// don't block publishing other versions on single platform error
console
.
error
(
`Failed to publish`
,
wasmTarget
,
err
)
if
(
err
.
message
&&
err
.
message
.
includes
(
'You cannot publish over the previously published versions'
)
)
{
console
.
error
(
'Ignoring already published error'
,
wasmTarget
)
}
else
{
// throw err
}
}
finally
{
publishSema
.
release
()
}
})
)
// Update optional dependencies versions
let
nextPkg
=
JSON
.
parse
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment