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
d43e05c6
Unverified
Commit
d43e05c6
authored
Oct 28, 2021
by
JJ Kasper
Committed by
GitHub
Oct 28, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use fallback SWC version when binary publish fails (#30568)
parent
63024d32
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
publish-native.js
scripts/publish-native.js
+11
-1
No files found.
scripts/publish-native.js
View file @
d43e05c6
...
@@ -19,6 +19,11 @@ const cwd = process.cwd()
...
@@ -19,6 +19,11 @@ const cwd = process.cwd()
let
platforms
=
(
await
readdir
(
nativePackagesDir
)).
filter
(
let
platforms
=
(
await
readdir
(
nativePackagesDir
)).
filter
(
(
name
)
=>
!
name
.
startsWith
(
'.'
)
(
name
)
=>
!
name
.
startsWith
(
'.'
)
)
)
const
publishedPkgs
=
new
Set
()
// TODO: update to latest version where all pacakges were
// successfully published
const
fallbackVersion
=
`12.0.1`
for
(
let
platform
of
platforms
)
{
for
(
let
platform
of
platforms
)
{
try
{
try
{
let
binaryName
=
`next-swc.
${
platform
}
.node`
let
binaryName
=
`next-swc.
${
platform
}
.node`
...
@@ -42,6 +47,7 @@ const cwd = process.cwd()
...
@@ -42,6 +47,7 @@ const cwd = process.cwd()
gitref
.
includes
(
'canary'
)
?
' --tag canary'
:
''
gitref
.
includes
(
'canary'
)
?
' --tag canary'
:
''
}
`
}
`
)
)
publishedPkgs
.
add
(
platform
)
}
catch
(
err
)
{
}
catch
(
err
)
{
// don't block publishing other versions on single platform error
// don't block publishing other versions on single platform error
console
.
error
(
`Failed to publish`
,
platform
,
err
)
console
.
error
(
`Failed to publish`
,
platform
,
err
)
...
@@ -62,7 +68,11 @@ const cwd = process.cwd()
...
@@ -62,7 +68,11 @@ const cwd = process.cwd()
)
)
for
(
let
platform
of
platforms
)
{
for
(
let
platform
of
platforms
)
{
let
optionalDependencies
=
nextPkg
.
optionalDependencies
||
{}
let
optionalDependencies
=
nextPkg
.
optionalDependencies
||
{}
optionalDependencies
[
'@next/swc-'
+
platform
]
=
version
optionalDependencies
[
'@next/swc-'
+
platform
]
=
publishedPkgs
.
has
(
platform
)
?
version
:
fallbackVersion
nextPkg
.
optionalDependencies
=
optionalDependencies
nextPkg
.
optionalDependencies
=
optionalDependencies
}
}
await
writeFile
(
await
writeFile
(
...
...
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