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()
...
@@ -73,60 +73,55 @@ const cwd = process.cwd()
)
)
// Update name/version of wasm packages and publish
// Update name/version of wasm packages and publish
// const pkgDirectory = 'packages/next-swc/crates/wasm'
const
pkgDirectory
=
'packages/next-swc/crates/wasm'
// let wasmDir = path.join(cwd, pkgDirectory)
let
wasmDir
=
path
.
join
(
cwd
,
pkgDirectory
)
await
Promise
.
all
(
// await Promise.all(
[
'web'
,
'nodejs'
].
map
(
async
(
wasmTarget
)
=>
{
// ['web', 'nodejs'].map(async (wasmTarget) => {
await
publishSema
.
acquire
()
// await publishSema.acquire()
let
wasmPkg
=
JSON
.
parse
(
await
readFile
(
path
.
join
(
wasmDir
,
`pkg-
${
wasmTarget
}
/package.json`
))
// let wasmPkg = JSON.parse(
)
// await readFile(path.join(wasmDir, `pkg-${wasmTarget}/package.json`))
wasmPkg
.
name
=
`@next/swc-wasm-
${
wasmTarget
}
`
// )
wasmPkg
.
version
=
version
// wasmPkg.name = `@next/swc-wasm-${wasmTarget}`
wasmPkg
.
repository
=
{
// wasmPkg.version = version
type
:
'git'
,
// wasmPkg.repository = {
url
:
'https://github.com/vercel/next.js'
,
// type: 'git',
directory
:
pkgDirectory
,
// url: 'https://github.com/vercel/next.js',
}
// directory: pkgDirectory,
await
writeFile
(
// }
path
.
join
(
wasmDir
,
`pkg-
${
wasmTarget
}
/package.json`
),
JSON
.
stringify
(
wasmPkg
,
null
,
2
)
// await writeFile(
)
// path.join(wasmDir, `pkg-${wasmTarget}/package.json`),
try
{
// JSON.stringify(wasmPkg, null, 2)
await
execa
(
// )
`npm`
,
[
// try {
'publish'
,
// await execa(
`
${
path
.
join
(
wasmDir
,
`pkg-
${
wasmTarget
}
`
)}
`
,
// `npm`,
'--access'
,
// [
'public'
,
// 'publish',
...(
version
.
includes
(
'canary'
)
?
[
'--tag'
,
'canary'
]
:
[]),
// `${path.join(wasmDir, `pkg-${wasmTarget}`)}`,
],
// '--access',
{
stdio
:
'inherit'
}
// 'public',
)
// ...(version.includes('canary') ? ['--tag', 'canary'] : []),
}
catch
(
err
)
{
// ],
// don't block publishing other versions on single platform error
// { stdio: 'inherit' }
console
.
error
(
`Failed to publish`
,
wasmTarget
,
err
)
// )
if
(
// } catch (err) {
err
.
message
&&
// // don't block publishing other versions on single platform error
err
.
message
.
includes
(
// console.error(`Failed to publish`, wasmTarget, err)
'You cannot publish over the previously published versions'
)
// if (
)
{
// err.message &&
console
.
error
(
'Ignoring already published error'
,
wasmTarget
)
// err.message.includes(
}
else
{
// 'You cannot publish over the previously published versions'
// throw err
// )
}
// ) {
}
finally
{
// console.error('Ignoring already published error', wasmTarget)
publishSema
.
release
()
// } else {
}
// // throw err
})
// }
)
// } finally {
// publishSema.release()
// }
// })
// )
// Update optional dependencies versions
// Update optional dependencies versions
let
nextPkg
=
JSON
.
parse
(
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