forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to use repo specific napi instead of npx (vercel#30914)
* Update to use repo specific napi instead of npx * download build cache * test running musl build * Ensure napi is available for build-native-dev * install globally in docker * re-add isRelease check
- Loading branch information
Showing
4 changed files
with
70 additions
and
360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -598,6 +598,10 @@ jobs: | |
restore-keys: | | ||
next-swc-cargo-cache-ubuntu-18.04 | ||
# since the repo's dependencies aren't installed we need | ||
# to install napi globally | ||
- run: npm i -g @napi-rs/[email protected] | ||
|
||
- name: Build | ||
if: ${{ steps.binary-cache.outputs.cache-hit != 'true' && steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }} | ||
run: yarn build-native | ||
|
@@ -674,9 +678,13 @@ jobs: | |
run: sudo sysctl -w net.link.generic.system.hwcksum_tx=0 && sudo sysctl -w net.link.generic.system.hwcksum_rx=0 | ||
if: ${{ matrix.os == 'macos-latest' }} | ||
|
||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v2 | ||
if: ${{needs.build.outputs.docsChange != 'docs only change'}} | ||
id: restore-build | ||
with: | ||
fetch-depth: 25 | ||
path: ./* | ||
key: ${{ github.sha }} | ||
|
||
- run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change') | ||
id: docs-change | ||
- name: Setup node | ||
|
@@ -756,7 +764,12 @@ jobs: | |
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 32 | ||
CARGO_PROFILE_RELEASE_LTO: 'false' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v2 | ||
if: ${{needs.build.outputs.docsChange != 'docs only change'}} | ||
id: restore-build | ||
with: | ||
path: ./* | ||
key: ${{ github.sha }} | ||
|
||
- run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change') | ||
id: docs-change | ||
|
@@ -812,7 +825,12 @@ jobs: | |
name: next-swc - windows-aarch64 - node@14 | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v2 | ||
if: ${{needs.build.outputs.docsChange != 'docs only change'}} | ||
id: restore-build | ||
with: | ||
path: ./* | ||
key: ${{ github.sha }} | ||
|
||
- run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change') | ||
id: docs-change | ||
|
@@ -859,7 +877,12 @@ jobs: | |
name: next-swc - linux-musl - node@lts | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v2 | ||
if: ${{needs.build.outputs.docsChange != 'docs only change'}} | ||
id: restore-build | ||
with: | ||
path: ./* | ||
key: ${{ github.sha }} | ||
|
||
- run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change') | ||
id: docs-change | ||
|
@@ -898,7 +921,7 @@ jobs: | |
- name: 'Build' | ||
if: ${{ steps.binary-cache.outputs.cache-hit != 'true' && steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }} | ||
run: | | ||
docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd)/packages/next:/build -w /build builder sh -c "yarn build-native --release --target x86_64-unknown-linux-musl" | ||
docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd)/packages/next:/build -w /build builder sh -c "npm i -g @napi-rs/[email protected] && yarn build-native --release --target x86_64-unknown-linux-musl" | ||
- name: Upload artifact | ||
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }} | ||
|
@@ -915,7 +938,12 @@ jobs: | |
steps: | ||
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset | ||
|
||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v2 | ||
if: ${{needs.build.outputs.docsChange != 'docs only change'}} | ||
id: restore-build | ||
with: | ||
path: ./* | ||
key: ${{ github.sha }} | ||
|
||
- run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change') | ||
id: docs-change | ||
|
@@ -975,7 +1003,12 @@ jobs: | |
name: next-swc - aarch64-unknown-linux-musl - node@14 | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v2 | ||
if: ${{needs.build.outputs.docsChange != 'docs only change'}} | ||
id: restore-build | ||
with: | ||
path: ./* | ||
key: ${{ github.sha }} | ||
|
||
- run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change') | ||
id: docs-change | ||
|
@@ -1037,7 +1070,12 @@ jobs: | |
steps: | ||
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset | ||
|
||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v2 | ||
if: ${{needs.build.outputs.docsChange != 'docs only change'}} | ||
id: restore-build | ||
with: | ||
path: ./* | ||
key: ${{ github.sha }} | ||
|
||
- run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change') | ||
id: docs-change | ||
|
@@ -1097,7 +1135,12 @@ jobs: | |
name: next-swc - Android - aarch64 | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v2 | ||
if: ${{needs.build.outputs.docsChange != 'docs only change'}} | ||
id: restore-build | ||
with: | ||
path: ./* | ||
key: ${{ github.sha }} | ||
|
||
- run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change') | ||
id: docs-change | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,6 +68,10 @@ jobs: | |
restore-keys: | | ||
next-swc-cargo-cache-ubuntu-18.04 | ||
# since the repo's dependencies aren't installed we need | ||
# to install napi globally | ||
- run: npm i -g @napi-rs/[email protected] | ||
|
||
- name: Build | ||
if: ${{ steps.binary-cache.outputs.cache-hit != 'true' && steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }} | ||
run: yarn build-native | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,7 +56,7 @@ | |
"types": "tsc --declaration --emitDeclarationOnly --declarationDir dist", | ||
"typescript": "tsc --noEmit --declaration", | ||
"ncc-compiled": "ncc cache clean && taskr ncc", | ||
"build-native": "npx -p @napi-rs/[email protected] napi build --platform --cargo-cwd build/swc native" | ||
"build-native": "napi build --platform --cargo-cwd build/swc native" | ||
}, | ||
"taskr": { | ||
"requires": [ | ||
|
@@ -153,7 +153,7 @@ | |
"@babel/preset-typescript": "7.15.0", | ||
"@babel/traverse": "7.15.0", | ||
"@babel/types": "7.15.0", | ||
"@napi-rs/cli": "1.1.0", | ||
"@napi-rs/cli": "1.2.1", | ||
"@next/polyfill-nomodule": "12.0.3-canary.3", | ||
"@peculiar/webcrypto": "1.1.7", | ||
"@taskr/clear": "1.1.0", | ||
|
Oops, something went wrong.