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
8ac3254d
Commit
8ac3254d
authored
Aug 11, 2021
by
Tim Neutkens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Next swc publish flow (#27932)"
This reverts commit
94fc6f08
.
parent
6014b6e0
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
103 additions
and
252 deletions
+103
-252
build_native.yml
.github/workflows/build_native.yml
+99
-27
build_test_deploy.yml
.github/workflows/build_test_deploy.yml
+3
-90
README.md
packages/next/build/swc/npm/next-swc-darwin-arm64/README.md
+0
-3
package.json
...ges/next/build/swc/npm/next-swc-darwin-arm64/package.json
+0
-18
README.md
packages/next/build/swc/npm/next-swc-darwin-x64/README.md
+0
-3
package.json
packages/next/build/swc/npm/next-swc-darwin-x64/package.json
+0
-18
README.md
packages/next/build/swc/npm/next-swc-linux-x64-gnu/README.md
+0
-3
package.json
...es/next/build/swc/npm/next-swc-linux-x64-gnu/package.json
+0
-18
README.md
...ages/next/build/swc/npm/next-swc-win32-x64-msvc/README.md
+0
-3
package.json
...s/next/build/swc/npm/next-swc-win32-x64-msvc/package.json
+0
-18
next-swc.darwin-arm64.node
packages/next/native/next-swc.darwin-arm64.node
+0
-0
next-swc.darwin-x64.node
packages/next/native/next-swc.darwin-x64.node
+0
-0
package.json
packages/next/package.json
+1
-1
prepublish-native.js
scripts/prepublish-native.js
+0
-50
No files found.
.github/workflows/build_native.yml
View file @
8ac3254d
on
:
workflow_dispatch
on
:
workflow_dispatch
:
pull_request
:
types
:
[
opened
,
synchronize
]
paths
:
-
'
packages/next/build/swc/**'
name
:
Build next-swc native binaries
name
:
Build next-swc native binaries
jobs
:
jobs
:
build
-native
:
build
:
strategy
:
strategy
:
matrix
:
matrix
:
os
:
[
ubuntu-18.04
,
macos-latest
,
windows-latest
]
os
:
[
ubuntu-18.04
,
macos-latest
,
windows-latest
]
description
:
[
default
]
include
:
name
:
stable - ${{ matrix.os }} - node@14
-
os
:
ubuntu-18.04
target
:
x86_64-unknown-linux-gnu
-
os
:
windows-latest
target
:
x86_64-pc-windows-msvc
-
os
:
macos-latest
target
:
x86_64-apple-darwin
-
os
:
macos-latest
target
:
aarch64-apple-darwin
description
:
m1
name
:
next-swc - ${{ matrix.os }} - ${{ matrix.target }} - node@14
runs-on
:
${{ matrix.os }}
runs-on
:
${{ matrix.os }}
steps
:
steps
:
-
uses
:
actions/checkout@v2
-
uses
:
actions/checkout@v2
-
name
:
Setup node
-
name
:
Setup node
uses
:
actions/setup-node@v2
uses
:
actions/setup-node@v2
with
:
with
:
node-version
:
14
node-version
:
14
check-latest
:
true
check-latest
:
true
-
name
:
Install
-
name
:
Install
uses
:
actions-rs/toolchain@v1
uses
:
actions-rs/toolchain@v1
with
:
with
:
toolchain
:
stable
profile
:
minimal
profile
:
minimal
toolchain
:
nightly-2021-03-25
target
:
${{ matrix.target }}
-
name
:
Cache cargo registry
-
name
:
Cache cargo registry
uses
:
actions/cache@v1
uses
:
actions/cache@v1
with
:
with
:
path
:
~/.cargo/registry
path
:
~/.cargo/registry
key
:
stable-${{ matrix.os }}-node@14-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
key
:
stable-${{ matrix.os }}-node@14-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
-
name
:
Cache cargo index
-
name
:
Cache cargo index
uses
:
actions/cache@v1
uses
:
actions/cache@v1
with
:
with
:
path
:
~/.cargo/git
path
:
~/.cargo/git
key
:
stable-${{ matrix.os }}-node@14-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
key
:
stable-${{ matrix.os }}-node@14-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
-
name
:
Cache native binary
id
:
binary-cache
-
name
:
Cache NPM dependencies
uses
:
actions/cache@v
2
uses
:
actions/cache@v
1
with
:
with
:
path
:
packages/next/native/**
path
:
node_modules
key
:
next-swc-nightly-2021-03-25-${{ matrix.target }}-${{ hashFiles('packages/next/build/swc/**') }}
key
:
npm-cache-${{ matrix.os }}-node@14-${{ hashFiles('yarn.lock') }}
-
name
:
'
Install
dependencies'
run
:
yarn install --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
-
name
:
'
Build'
-
name
:
'
Build'
if
:
steps.binary-cache.outputs.cache-hit !=
true
run
:
yarn --cwd packages/next build-native
run
:
yarn build-native --target ${{ matrix.target }}
env
:
env
:
MACOSX_DEPLOYMENT_TARGET
:
'
10.13'
MACOSX_DEPLOYMENT_TARGET
:
'
10.13'
working-directory
:
packages/next
-
name
:
Upload artifact
uses
:
actions/upload-artifact@v2
with
:
name
:
next-swc-binaries
path
:
packages/next/native
-
name
:
Clear the cargo caches
run
:
|
cargo install cargo-cache --no-default-features --features ci-autoclean
cargo-cache
build-apple-silicon
:
name
:
stable - aarch64-apple-darwin - node@14
runs-on
:
macos-latest
steps
:
-
uses
:
actions/checkout@v2
-
name
:
Setup node
uses
:
actions/setup-node@v2
with
:
node-version
:
14
-
name
:
Install Rust
uses
:
actions-rs/toolchain@v1
with
:
profile
:
minimal
override
:
true
toolchain
:
nightly-2021-03-25
target
:
aarch64-apple-darwin
-
name
:
Install dependencies
run
:
yarn install --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
-
name
:
Cross build aarch64
run
:
yarn --cwd packages/next build-native --target aarch64-apple-darwin
-
name
:
Upload artifact
-
name
:
Upload artifact
uses
:
actions/upload-artifact@v2
uses
:
actions/upload-artifact@v2
with
:
with
:
name
:
next-swc-binaries
name
:
next-swc-binaries
path
:
packages/next/native/next-swc.*.node
path
:
packages/next/native
-
name
:
Clear the cargo caches
-
name
:
Clear the cargo caches
run
:
|
run
:
|
cargo install cargo-cache --no-default-features --features ci-autoclean
cargo install cargo-cache --no-default-features --features ci-autoclean
cargo-cache
cargo-cache
commit
:
commit
:
needs
:
build-native
needs
:
[
build
,
build-apple-silicon
]
runs-on
:
ubuntu-18.04
runs-on
:
ubuntu-18.04
steps
:
steps
:
-
uses
:
actions/checkout@v2
-
uses
:
actions/checkout@v2
if
:
${{ github.event_name == 'workflow_dispatch' }}
-
uses
:
actions/download-artifact@v2
-
uses
:
actions/download-artifact@v2
with
:
with
:
name
:
next-swc-binaries
name
:
next-swc-binaries
path
:
packages/next/native
path
:
packages/next/native
if
:
${{ github.event_name == 'workflow_dispatch' }}
-
uses
:
EndBug/add-and-commit@v7
-
uses
:
EndBug/add-and-commit@v7
with
:
with
:
add
:
'
packages/next/native
--force'
add
:
'
packages/next/native
--force'
message
:
'
Build
next-swc
binaries'
message
:
'
Build
next-swc
binaries'
if
:
${{ github.event_name == 'workflow_dispatch' }}
check
:
needs
:
[
build
,
build-apple-silicon
]
runs-on
:
ubuntu-18.04
steps
:
-
uses
:
actions/checkout@v2
if
:
${{ github.event_name == 'pull_request' }}
-
uses
:
actions/download-artifact@v2
with
:
name
:
next-swc-binaries
path
:
packages/next/native
if
:
${{ github.event_name == 'pull_request' }}
-
run
:
git diff --exit-code
if
:
${{ github.event_name == 'pull_request' }}
test
:
runs-on
:
ubuntu-18.04
steps
:
-
uses
:
actions/checkout@v2
if
:
${{ github.event_name == 'pull_request' }}
-
name
:
Install
if
:
${{ github.event_name == 'pull_request' }}
uses
:
actions-rs/toolchain@v1
with
:
toolchain
:
nightly-2021-03-25
profile
:
minimal
-
run
:
cd packages/next/build/swc && cargo test
if
:
${{ github.event_name == 'pull_request' }}
.github/workflows/build_test_deploy.yml
View file @
8ac3254d
on
:
on
:
push
:
push
:
branches
:
[
canary
]
branches
:
[
canary
]
tags
:
[
v*
]
pull_request
:
pull_request
:
types
:
[
opened
,
synchronize
]
types
:
[
opened
,
synchronize
]
...
@@ -47,7 +46,7 @@ jobs:
...
@@ -47,7 +46,7 @@ jobs:
checkPrecompiled
:
checkPrecompiled
:
name
:
Check Pre-compiled
name
:
Check Pre-compiled
runs-on
:
ubuntu-latest
runs-on
:
ubuntu-latest
needs
:
[
build
,
build-native
]
needs
:
build
env
:
env
:
NEXT_TELEMETRY_DISABLED
:
1
NEXT_TELEMETRY_DISABLED
:
1
steps
:
steps
:
...
@@ -57,10 +56,6 @@ jobs:
...
@@ -57,10 +56,6 @@ jobs:
with
:
with
:
path
:
./*
path
:
./*
key
:
${{ github.sha }}
key
:
${{ github.sha }}
-
uses
:
actions/download-artifact@v2
with
:
name
:
next-swc-binaries
path
:
packages/next/native
-
run
:
./scripts/check-pre-compiled.sh
-
run
:
./scripts/check-pre-compiled.sh
if
:
${{needs.build.outputs.docsChange != 'docs only change'}}
if
:
${{needs.build.outputs.docsChange != 'docs only change'}}
...
@@ -245,10 +240,9 @@ jobs:
...
@@ -245,10 +240,9 @@ jobs:
if
:
${{needs.build.outputs.docsChange != 'docs only change'}}
if
:
${{needs.build.outputs.docsChange != 'docs only change'}}
publishRelease
:
publishRelease
:
if
:
${{ startsWith(github.ref, 'refs/tags/v') }}
name
:
Potentially publish release
name
:
Potentially publish release
runs-on
:
ubuntu-latest
runs-on
:
ubuntu-latest
needs
:
[
build
,
build-native
]
needs
:
build
env
:
env
:
NPM_TOKEN
:
${{ secrets.NPM_TOKEN }}
NPM_TOKEN
:
${{ secrets.NPM_TOKEN }}
steps
:
steps
:
...
@@ -257,11 +251,7 @@ jobs:
...
@@ -257,11 +251,7 @@ jobs:
with
:
with
:
path
:
./*
path
:
./*
key
:
${{ github.sha }}
key
:
${{ github.sha }}
-
uses
:
actions/download-artifact@v2
with
:
name
:
next-swc-binaries
path
:
packages/next/native
-
run
:
./scripts/prepublish-native.js
-
run
:
./scripts/publish-release.sh
-
run
:
./scripts/publish-release.sh
releaseStats
:
releaseStats
:
...
@@ -278,80 +268,3 @@ jobs:
...
@@ -278,80 +268,3 @@ jobs:
-
uses
:
./.github/actions/next-stats-action
-
uses
:
./.github/actions/next-stats-action
env
:
env
:
PR_STATS_COMMENT_TOKEN
:
${{ secrets.PR_STATS_COMMENT_TOKEN }}
PR_STATS_COMMENT_TOKEN
:
${{ secrets.PR_STATS_COMMENT_TOKEN }}
build-native
:
strategy
:
matrix
:
os
:
[
ubuntu-18.04
,
macos-latest
,
windows-latest
]
description
:
[
default
]
include
:
-
os
:
ubuntu-18.04
target
:
x86_64-unknown-linux-gnu
-
os
:
windows-latest
target
:
x86_64-pc-windows-msvc
-
os
:
macos-latest
target
:
x86_64-apple-darwin
-
os
:
macos-latest
target
:
aarch64-apple-darwin
description
:
m1
name
:
next-swc - ${{ matrix.os }} - ${{ matrix.target }} - node@14
runs-on
:
${{ matrix.os }}
steps
:
-
uses
:
actions/checkout@v2
-
name
:
Setup node
uses
:
actions/setup-node@v2
with
:
node-version
:
14
check-latest
:
true
-
name
:
Install
uses
:
actions-rs/toolchain@v1
with
:
profile
:
minimal
toolchain
:
nightly-2021-03-25
target
:
${{ matrix.target }}
-
name
:
Cache cargo registry
uses
:
actions/cache@v1
with
:
path
:
~/.cargo/registry
key
:
stable-${{ matrix.os }}-node@14-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
-
name
:
Cache cargo index
uses
:
actions/cache@v1
with
:
path
:
~/.cargo/git
key
:
stable-${{ matrix.os }}-node@14-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
-
name
:
Cache native binary
id
:
binary-cache
uses
:
actions/cache@v2
with
:
path
:
packages/next/native/**
key
:
next-swc-nightly-2021-03-25-${{ matrix.target }}-${{ hashFiles('packages/next/build/swc/**') }}
-
name
:
'
Build'
if
:
steps.binary-cache.outputs.cache-hit !=
true
run
:
yarn build-native --target ${{ matrix.target }}
env
:
MACOSX_DEPLOYMENT_TARGET
:
'
10.13'
working-directory
:
packages/next
-
name
:
Upload artifact
uses
:
actions/upload-artifact@v2
with
:
name
:
next-swc-binaries
path
:
packages/next/native/next-swc.*.node
-
name
:
Clear the cargo caches
run
:
|
cargo install cargo-cache --no-default-features --features ci-autoclean
cargo-cache
test-native
:
name
:
Unit Test Native Code
runs-on
:
ubuntu-18.04
steps
:
-
uses
:
actions/checkout@v2
-
name
:
Install
uses
:
actions-rs/toolchain@v1
with
:
toolchain
:
nightly-2021-03-25
profile
:
minimal
-
run
:
cd packages/next/build/swc && cargo test
packages/next/build/swc/npm/next-swc-darwin-arm64/README.md
deleted
100644 → 0
View file @
6014b6e0
# `next-swc-darwin-arm64`
This is the
**aarch64-apple-darwin**
binary for
`next-swc`
packages/next/build/swc/npm/next-swc-darwin-arm64/package.json
deleted
100644 → 0
View file @
6014b6e0
{
"name"
:
"next-swc-darwin-arm64"
,
"version"
:
"0.0.0"
,
"os"
:
[
"darwin"
],
"cpu"
:
[
"arm64"
],
"main"
:
"next-swc.darwin-arm64.node"
,
"files"
:
[
"next-swc.darwin-arm64.node"
],
"license"
:
"MIT"
,
"engines"
:
{
"node"
:
">= 10"
}
}
packages/next/build/swc/npm/next-swc-darwin-x64/README.md
deleted
100644 → 0
View file @
6014b6e0
# `next-swc-darwin-x64`
This is the
**x86_64-apple-darwin**
binary for
`next-swc`
packages/next/build/swc/npm/next-swc-darwin-x64/package.json
deleted
100644 → 0
View file @
6014b6e0
{
"name"
:
"next-swc-darwin-x64"
,
"version"
:
"0.0.0"
,
"os"
:
[
"darwin"
],
"cpu"
:
[
"x64"
],
"main"
:
"next-swc.darwin-x64.node"
,
"files"
:
[
"next-swc.darwin-x64.node"
],
"license"
:
"MIT"
,
"engines"
:
{
"node"
:
">= 10"
}
}
packages/next/build/swc/npm/next-swc-linux-x64-gnu/README.md
deleted
100644 → 0
View file @
6014b6e0
# `next-swc-linux-x64-gnu`
This is the
**x86_64-unknown-linux-gnu**
binary for
`next-swc`
packages/next/build/swc/npm/next-swc-linux-x64-gnu/package.json
deleted
100644 → 0
View file @
6014b6e0
{
"name"
:
"next-swc-linux-x64-gnu"
,
"version"
:
"0.0.0"
,
"os"
:
[
"linux"
],
"cpu"
:
[
"x64"
],
"main"
:
"next-swc.linux-x64-gnu.node"
,
"files"
:
[
"next-swc.linux-x64-gnu.node"
],
"license"
:
"MIT"
,
"engines"
:
{
"node"
:
">= 10"
}
}
packages/next/build/swc/npm/next-swc-win32-x64-msvc/README.md
deleted
100644 → 0
View file @
6014b6e0
# `next-swc-win32-x64-msvc`
This is the
**x86_64-pc-windows-msvc**
binary for
`next-swc`
packages/next/build/swc/npm/next-swc-win32-x64-msvc/package.json
deleted
100644 → 0
View file @
6014b6e0
{
"name"
:
"next-swc-win32-x64-msvc"
,
"version"
:
"0.0.0"
,
"os"
:
[
"win32"
],
"cpu"
:
[
"x64"
],
"main"
:
"next-swc.win32-x64-msvc.node"
,
"files"
:
[
"next-swc.win32-x64-msvc.node"
],
"license"
:
"MIT"
,
"engines"
:
{
"node"
:
">= 10"
}
}
packages/next/native/next-swc.darwin-arm64.node
View file @
8ac3254d
No preview for this file type
packages/next/native/next-swc.darwin-x64.node
View file @
8ac3254d
No preview for this file type
packages/next/package.json
View file @
8ac3254d
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
"types"
:
"tsc --declaration --emitDeclarationOnly --declarationDir dist"
,
"types"
:
"tsc --declaration --emitDeclarationOnly --declarationDir dist"
,
"typescript"
:
"tsc --noEmit --declaration"
,
"typescript"
:
"tsc --noEmit --declaration"
,
"ncc-compiled"
:
"ncc cache clean && taskr ncc"
,
"ncc-compiled"
:
"ncc cache clean && taskr ncc"
,
"build-native"
:
"n
px -p @napi-rs/cli n
api build --platform --release --cargo-cwd build/swc native"
"build-native"
:
"napi build --platform --release --cargo-cwd build/swc native"
},
},
"taskr"
:
{
"taskr"
:
{
"requires"
:
[
"requires"
:
[
...
...
scripts/prepublish-native.js
deleted
100755 → 0
View file @
6014b6e0
#!/usr/bin/env node
const
path
=
require
(
'path'
)
const
{
readFile
,
readdir
,
writeFile
}
=
require
(
'fs/promises'
)
const
{
copy
}
=
require
(
'fs-extra'
)
const
cwd
=
process
.
cwd
()
;(
async
function
()
{
let
version
=
JSON
.
parse
(
await
readFile
(
path
.
join
(
cwd
,
'lerna.json'
))).
version
// Copy binaries to package folders, update version, and copy package folders to packages directory
let
nativePackagesDir
=
path
.
join
(
cwd
,
'packages/next/build/swc/npm'
)
let
nativePackages
=
await
readdir
(
nativePackagesDir
)
for
(
let
nativePackage
of
nativePackages
)
{
let
binaryName
=
`next-swc.
${
nativePackage
.
substr
(
9
)}
.node`
await
copy
(
path
.
join
(
cwd
,
'packages/next/native'
,
binaryName
),
path
.
join
(
nativePackagesDir
,
nativePackage
,
binaryName
)
)
let
pkg
=
JSON
.
parse
(
await
readFile
(
path
.
join
(
nativePackagesDir
,
nativePackage
,
'package.json'
)
)
)
pkg
.
version
=
version
await
writeFile
(
path
.
join
(
nativePackagesDir
,
nativePackage
,
'package.json'
),
JSON
.
stringify
(
pkg
,
null
,
2
)
)
}
await
copy
(
path
.
join
(
cwd
,
'packages/next/build/swc/npm'
),
path
.
join
(
cwd
,
'packages'
)
)
// Update optional dependencies versions
let
nextPkg
=
JSON
.
parse
(
await
readFile
(
path
.
join
(
cwd
,
'packages/next/package.json'
))
)
for
(
let
name
of
nativePackages
)
{
let
optionalDependencies
=
nextPkg
.
optionalDependencies
||
{}
optionalDependencies
[
name
]
=
version
nextPkg
.
optionalDependencies
=
optionalDependencies
}
await
writeFile
(
path
.
join
(
path
.
join
(
cwd
,
'packages/next/package.json'
)),
JSON
.
stringify
(
nextPkg
,
null
,
2
)
)
})()
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