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
da73555f
Commit
da73555f
authored
Mar 28, 2025
by
JJ Kasper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lock swc binaries version
parent
a4e7a948
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
277 additions
and
276 deletions
+277
-276
build_test_deploy.yml
.github/workflows/build_test_deploy.yml
+241
-241
publish-native.js
scripts/publish-native.js
+36
-35
No files found.
.github/workflows/build_test_deploy.yml
View file @
da73555f
This diff is collapsed.
Click to expand it.
scripts/publish-native.js
View file @
da73555f
...
...
@@ -2,7 +2,7 @@
const
path
=
require
(
'path'
)
const
{
readFile
,
readdir
,
writeFile
}
=
require
(
'fs/promises'
)
const
{
copy
}
=
require
(
'fs-extra'
)
//
const { copy } = require('fs-extra')
const
{
execSync
}
=
require
(
'child_process'
)
const
cwd
=
process
.
cwd
()
...
...
@@ -12,6 +12,7 @@ const cwd = process.cwd()
let
version
=
JSON
.
parse
(
await
readFile
(
path
.
join
(
cwd
,
'lerna.json'
))
).
version
let
lockedNativeVersion
=
'12.3.4'
let
gitref
=
process
.
argv
.
slice
(
2
)[
0
]
// Copy binaries to package folders, update version, and publish
...
...
@@ -25,46 +26,46 @@ const cwd = process.cwd()
for
(
let
platform
of
platforms
)
{
try
{
let
binaryName
=
`next-swc.
${
platform
}
.node`
await
copy
(
path
.
join
(
cwd
,
'packages/next-swc/native'
,
binaryName
),
path
.
join
(
nativePackagesDir
,
platform
,
binaryName
)
)
let
pkg
=
JSON
.
parse
(
await
readFile
(
path
.
join
(
nativePackagesDir
,
platform
,
'package.json'
))
)
pkg
.
version
=
version
await
writeFile
(
path
.
join
(
nativePackagesDir
,
platform
,
'package.json'
),
JSON
.
stringify
(
pkg
,
null
,
2
)
)
execSync
(
`npm publish
${
path
.
join
(
nativePackagesDir
,
platform
)}
--access public
${
gitref
.
includes
(
'canary'
)
?
' --tag next-12-3-2'
:
'--tag next-12-3-2'
}
`
)
//
let binaryName = `next-swc.${platform}.node`
//
await copy(
//
path.join(cwd, 'packages/next-swc/native', binaryName),
//
path.join(nativePackagesDir, platform, binaryName)
//
)
//
let pkg = JSON.parse(
//
await readFile(path.join(nativePackagesDir, platform, 'package.json'))
//
)
//
pkg.version = version
//
await writeFile(
//
path.join(nativePackagesDir, platform, 'package.json'),
//
JSON.stringify(pkg, null, 2)
//
)
//
execSync(
//
`npm publish ${path.join(
//
nativePackagesDir,
//
platform
//
)} --access public ${
//
gitref.includes('canary')
//
? ' --tag next-12-3-2'
//
: '--tag next-12-3-2'
//
}`
//
)
let
optionalDependencies
=
nextPkg
.
optionalDependencies
||
{}
optionalDependencies
[
'@next/swc-'
+
platform
]
=
v
ersion
optionalDependencies
[
'@next/swc-'
+
platform
]
=
lockedNativeV
ersion
nextPkg
.
optionalDependencies
=
optionalDependencies
}
catch
(
err
)
{
// don't block publishing other versions on single platform error
console
.
error
(
`Failed to publish`
,
platform
)
// throw err
//
//
don't block publishing other versions on single platform error
//
console.error(`Failed to publish`, platform)
//
//
throw err
}
// lerna publish in next step will fail if git status is not clean
execSync
(
`git update-index --skip-worktree
${
path
.
join
(
nativePackagesDir
,
platform
,
'package.json'
)}
`
)
//
execSync(
//
`git update-index --skip-worktree ${path.join(
//
nativePackagesDir,
//
platform,
//
'package.json'
//
)}`
//
)
}
// Update name/version of wasm packages and publish
...
...
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