Skip to content

Commit a532d38

Browse files
authored
Merge branch 'canary' into cms-builder-io-example
2 parents 045374f + 738a964 commit a532d38

File tree

243 files changed

+2804
-6358
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

243 files changed

+2804
-6358
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @timneutkens @ijjk @shuding @huozhi
55
/.github/ @timneutkens @ijjk @shuding @styfle @huozhi @padmaia
66
/docs/ @timneutkens @ijjk @shuding @styfle @huozhi @padmaia @leerob @lfades @molebox
7-
/examples/ @timneutkens @ijjk @shuding @leerob @lfades
7+
/examples/ @timneutkens @ijjk @shuding @leerob @lfades @steven-tey
88

99
# SWC Build (@padmaia)
1010

.github/workflows/build_test_deploy.yml

Lines changed: 113 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
outputs:
2828
docsChange: ${{ steps.docs-change.outputs.DOCS_CHANGE }}
2929
isRelease: ${{ steps.check-release.outputs.IS_RELEASE }}
30+
weekNum: ${{ steps.get-week.outputs.WEEK }}
3031
steps:
3132
- name: Setup node
3233
uses: actions/setup-node@v2
@@ -59,6 +60,9 @@ jobs:
5960
else
6061
echo "::set-output name=IS_RELEASE::false"
6162
fi
63+
# We use week in the turbo cache key to keep the cache from infinitely growing
64+
- id: get-week
65+
run: echo ::set-output name=WEEK::$(date +%U)
6266

6367
- uses: actions/cache@v2
6468
id: cache-build
@@ -655,13 +659,20 @@ jobs:
655659
path: ~/.cargo/git
656660
key: stable-ubuntu-18.04-node@14-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
657661

658-
- name: Cache native binary
659-
id: binary-cache
660-
uses: actions/cache@v2
661-
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
662-
with:
663-
path: packages/next-swc/native/next-swc.linux-x64-gnu.node
664-
key: dev-next-swc-nightly-2021-11-15-linux-x64-gnu-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next-swc/**') }}
662+
# We use week in the turbo cache key to keep the cache from infinitely growing
663+
- id: get-week
664+
run: echo ::set-output name=WEEK::$(date +%U)
665+
666+
# - name: Turbo Cache
667+
# id: turbo-cache
668+
# uses: actions/cache@v2
669+
# if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
670+
# with:
671+
# path: .turbo
672+
# key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ steps.get-week.outputs.WEEK }}-${{ github.sha }}
673+
# restore-keys: |
674+
# turbo-${{ github.job }}-${{ github.ref_name }}-${{ steps.get-week.outputs.WEEK }}-
675+
# turbo-${{ github.job }}-canary-${{ steps.get-week.outputs.WEEK }}-
665676

666677
# We use restore-key to pick latest cache.
667678
# We will not get exact match, but doc says
@@ -678,13 +689,17 @@ jobs:
678689
# since the repo's dependencies aren't installed we need
679690
# to install napi globally
680691
- run: npm i -g @napi-rs/[email protected]
692+
- run: npm i -g [email protected]
681693

682694
- name: Build
683-
if: ${{ steps.binary-cache.outputs.cache-hit != 'true' && steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
695+
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
696+
working-directory: packages/next-swc
684697
run: yarn build-native
685698
env:
686699
MACOSX_DEPLOYMENT_TARGET: '10.13'
687-
working-directory: packages/next-swc
700+
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
701+
TURBO_TEAM: nextjs
702+
TURBO_PROJECT: nextjs
688703

689704
- name: Upload artifact
690705
uses: actions/[email protected]
@@ -833,12 +848,15 @@ jobs:
833848
path: ~/.cargo/git
834849
key: stable-${{ matrix.os }}-node@14-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
835850

836-
- name: Cache native binary
837-
id: binary-cache
838-
uses: actions/cache@v2
839-
with:
840-
path: packages/next-swc/native/next-swc.${{ matrix.name }}.node
841-
key: next-swc-nightly-2021-11-15-${{ matrix.target }}-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next-swc/**') }}
851+
# - name: Turbo cache
852+
# id: turbo-cache
853+
# uses: actions/cache@v2
854+
# with:
855+
# path: .turbo
856+
# key: turbo-${{ github.job }}-${{ matrix.name }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }}
857+
# restore-keys: |
858+
# turbo-${{ github.job }}-${{ matrix.name }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-
859+
# turbo-${{ github.job }}-${{ matrix.name }}-canary-${{ needs.build.outputs.weekNum }}-
842860

843861
- name: Cross build aarch64 setup
844862
if: ${{ matrix.target == 'aarch64-apple-darwin' }}
@@ -861,11 +879,13 @@ jobs:
861879
next-swc-cargo-cache-${{ matrix.os }}
862880
863881
- name: 'Build'
864-
if: ${{ steps.binary-cache.outputs.cache-hit != 'true' }}
882+
working-directory: packages/next-swc
865883
run: yarn build-native --release --target ${{ matrix.target }}
866884
env:
867885
MACOSX_DEPLOYMENT_TARGET: '10.13'
868-
working-directory: packages/next-swc
886+
TURBO_TOKEN: ${{secrets.TURBO_TOKEN}}
887+
TURBO_TEAM: nextjs
888+
TURBO_PROJECT: nextjs
869889

870890
- name: Upload artifact
871891
uses: actions/[email protected]
@@ -907,7 +927,7 @@ jobs:
907927
# since the repo's dependencies aren't installed we need
908928
# to install napi globally
909929
- run: npm i -g @napi-rs/[email protected]
910-
930+
- run: npm i -g [email protected]
911931
- name: Install Rust
912932
uses: actions-rs/toolchain@v1
913933
with:
@@ -916,18 +936,20 @@ jobs:
916936
override: true
917937
target: i686-pc-windows-msvc
918938

919-
- name: Cache native binary
920-
id: binary-cache
921-
uses: actions/cache@v2
922-
with:
923-
path: packages/next-swc/native/next-swc.win32-ia32-msvc.node
924-
key: next-swc-nightly-2021-11-15-win32-ia32-msvc-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next-swc/**') }}
939+
# - name: Turbo Cache
940+
# id: turbo-cache
941+
# uses: actions/cache@v2
942+
# with:
943+
# path: .turbo
944+
# key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }}
945+
# restore-keys: |
946+
# turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-
947+
# turbo-${{ github.job }}-canary-${{ needs.build.outputs.weekNum }}-
925948

926949
- name: Build
927-
if: ${{ steps.binary-cache.outputs.cache-hit != 'true' }}
928950
shell: bash
929-
run: yarn build-native --release --target i686-pc-windows-msvc
930951
working-directory: packages/next-swc
952+
run: yarn build-native --release --target i686-pc-windows-msvc
931953

932954
- name: Upload artifact
933955
uses: actions/upload-artifact@v2
@@ -953,7 +975,7 @@ jobs:
953975
# since the repo's dependencies aren't installed we need
954976
# to install napi globally
955977
- run: npm i -g @napi-rs/[email protected]
956-
978+
- run: npm i -g [email protected]
957979
- name: Install Rust
958980
uses: actions-rs/toolchain@v1
959981
with:
@@ -962,18 +984,20 @@ jobs:
962984
override: true
963985
target: aarch64-pc-windows-msvc
964986

965-
- name: Cache native binary
966-
id: binary-cache
967-
uses: actions/cache@v2
968-
with:
969-
path: packages/next-swc/native/next-swc.win32-arm64-msvc.node
970-
key: next-swc-nightly-2021-11-15-win32-arm64-msvc-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next-swc/**') }}
987+
# - name: Turbo Cache
988+
# id: turbo-cache
989+
# uses: actions/cache@v2
990+
# with:
991+
# path: .turbo
992+
# key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }}
993+
# restore-keys: |
994+
# turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-
995+
# turbo-${{ github.job }}-canary-${{ needs.build.outputs.weekNum }}-
971996

972997
- name: Build
973-
if: ${{ steps.binary-cache.outputs.cache-hit != 'true' }}
974998
shell: bash
975-
run: yarn build-native --release --target aarch64-pc-windows-msvc
976999
working-directory: packages/next-swc
1000+
run: yarn build-native --release --target aarch64-pc-windows-msvc
9771001

9781002
- name: Upload artifact
9791003
uses: actions/upload-artifact@v2
@@ -1011,17 +1035,19 @@ jobs:
10111035
docker pull ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
10121036
docker tag ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine builder
10131037
1014-
- name: Cache native binary
1015-
id: binary-cache
1016-
uses: actions/cache@v2
1017-
with:
1018-
path: packages/next-swc/native/next-swc.linux-x64-musl.node
1019-
key: next-swc-nightly-2021-11-15-linux-x64-musl-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next-swc/**') }}
1038+
# - name: Turbo Cache
1039+
# id: turbo-cache
1040+
# uses: actions/cache@v2
1041+
# with:
1042+
# path: .turbo
1043+
# key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }}
1044+
# restore-keys: |
1045+
# turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-
1046+
# turbo-${{ github.job }}-canary-${{ needs.build.outputs.weekNum }}-
10201047

10211048
- name: 'Build'
1022-
if: ${{ steps.binary-cache.outputs.cache-hit != 'true' }}
10231049
run: |
1024-
docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd)/packages/next-swc:/build -w /build builder sh -c "npm i -g @napi-rs/[email protected] && yarn build-native --release --target x86_64-unknown-linux-musl"
1050+
docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd)/packages/next-swc:/build -w /build builder sh -c "npm i -g @napi-rs/[email protected] && npm i -g [email protected] && yarn build-native --release --target x86_64-unknown-linux-musl"
10251051
10261052
- name: Upload artifact
10271053
uses: actions/upload-artifact@v2
@@ -1049,6 +1075,7 @@ jobs:
10491075
# since the repo's dependencies aren't installed we need
10501076
# to install napi globally
10511077
- run: npm i -g @napi-rs/[email protected]
1078+
- run: npm i -g [email protected]
10521079

10531080
- name: Install Rust
10541081
uses: actions-rs/toolchain@v1
@@ -1070,17 +1097,20 @@ jobs:
10701097
sudo apt-get update
10711098
sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y
10721099
1073-
- name: Cache native binary
1074-
id: binary-cache
1075-
uses: actions/cache@v2
1076-
with:
1077-
path: packages/next-swc/native/next-swc.linux-arm64-gnu.node
1078-
key: next-swc-nightly-2021-11-15-linux-arm64-gnu-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next-swc/**') }}
1100+
# - name: Turbo Cache
1101+
# id: turbo-cache
1102+
# uses: actions/cache@v2
1103+
# with:
1104+
# path: .turbo
1105+
# key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }}
1106+
# restore-keys: |
1107+
# turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-
1108+
# turbo-${{ github.job }}-canary-${{ needs.build.outputs.weekNum }}-
10791109

10801110
- name: Cross build aarch64
1111+
working-directory: packages/next-swc
10811112
if: ${{ steps.binary-cache.outputs.cache-hit != 'true' }}
10821113
run: yarn build-native --release --target aarch64-unknown-linux-gnu
1083-
working-directory: packages/next-swc
10841114

10851115
- name: Upload artifact
10861116
uses: actions/upload-artifact@v2
@@ -1106,7 +1136,7 @@ jobs:
11061136
# since the repo's dependencies aren't installed we need
11071137
# to install napi globally
11081138
- run: npm i -g @napi-rs/[email protected]
1109-
1139+
- run: npm i -g [email protected]
11101140
- name: Install Rust
11111141
uses: actions-rs/toolchain@v1
11121142
with:
@@ -1127,17 +1157,19 @@ jobs:
11271157
sudo apt-get update
11281158
sudo apt-get install gcc-aarch64-linux-gnu -y
11291159
1130-
- name: Cache native binary
1131-
id: binary-cache
1132-
uses: actions/cache@v2
1133-
with:
1134-
path: packages/next-swc/native/next-swc.linux-arm64-musl.node
1135-
key: next-swc-nightly-2021-11-15-linux-arm64-musl-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next-swc/**') }}
1160+
# - name: Turbo Cache
1161+
# id: turbo-cache
1162+
# uses: actions/cache@v2
1163+
# with:
1164+
# path: .turbo
1165+
# key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }}
1166+
# restore-keys: |
1167+
# turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-
1168+
# turbo-${{ github.job }}-canary-${{ needs.build.outputs.weekNum }}-
11361169

11371170
- name: Cross build aarch64
1138-
if: ${{ steps.binary-cache.outputs.cache-hit != 'true' }}
1139-
run: yarn build-native --release --target aarch64-unknown-linux-musl
11401171
working-directory: packages/next-swc
1172+
run: yarn build-native --release --target aarch64-unknown-linux-musl
11411173

11421174
- name: Upload artifact
11431175
uses: actions/upload-artifact@v2
@@ -1165,6 +1197,7 @@ jobs:
11651197
# since the repo's dependencies aren't installed we need
11661198
# to install napi globally
11671199
- run: npm i -g @napi-rs/[email protected]
1200+
- run: npm i -g [email protected]
11681201

11691202
- name: Install Rust
11701203
uses: actions-rs/toolchain@v1
@@ -1186,17 +1219,19 @@ jobs:
11861219
sudo apt-get update
11871220
sudo apt-get install gcc-arm-linux-gnueabihf -y
11881221
1189-
- name: Cache native binary
1190-
id: binary-cache
1191-
uses: actions/cache@v2
1192-
with:
1193-
path: packages/next-swc/native/next-swc.linux-arm-gnueabihf.node
1194-
key: next-swc-nightly-2021-11-15-linux-arm-gnueabihf-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next-swc/**') }}
1222+
# - name: Turbo Cache
1223+
# id: turbo-cache
1224+
# uses: actions/cache@v2
1225+
# with:
1226+
# path: .turbo
1227+
# key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }}
1228+
# restore-keys: |
1229+
# turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-
1230+
# turbo-${{ github.job }}-canary-${{ needs.build.outputs.weekNum }}-
11951231

11961232
- name: Cross build aarch64
1197-
if: ${{ steps.binary-cache.outputs.cache-hit != 'true' }}
1198-
run: yarn build-native --release --target armv7-unknown-linux-gnueabihf
11991233
working-directory: packages/next-swc
1234+
run: yarn build-native --release --target armv7-unknown-linux-gnueabihf
12001235

12011236
- name: Upload artifact
12021237
uses: actions/upload-artifact@v2
@@ -1222,6 +1257,7 @@ jobs:
12221257
# since the repo's dependencies aren't installed we need
12231258
# to install napi globally
12241259
- run: npm i -g @napi-rs/[email protected]
1260+
- run: npm i -g [email protected]
12251261

12261262
- name: Install Rust
12271263
uses: actions-rs/toolchain@v1
@@ -1231,20 +1267,22 @@ jobs:
12311267
override: true
12321268
target: aarch64-linux-android
12331269

1234-
- name: Cache native binary
1235-
id: binary-cache
1236-
uses: actions/cache@v2
1237-
with:
1238-
path: packages/next-swc/native/next-swc.android-arm64.node
1239-
key: next-swc-nightly-2021-11-15-android-arm64-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next-swc/**') }}
1270+
# - name: Turbo Cache
1271+
# id: turbo-cache
1272+
# uses: actions/cache@v2
1273+
# with:
1274+
# path: .turbo
1275+
# key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }}
1276+
# restore-keys: |
1277+
# turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-
1278+
# turbo-${{ github.job }}-canary-${{ needs.build.outputs.weekNum }}-
12401279

12411280
- name: Build
1242-
if: ${{ steps.binary-cache.outputs.cache-hit != 'true' }}
12431281
shell: bash
1282+
working-directory: packages/next-swc
12441283
run: |
12451284
export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android24-clang"
12461285
yarn build-native --release --target aarch64-linux-android
1247-
working-directory: packages/next-swc
12481286
12491287
- name: Upload artifact
12501288
uses: actions/upload-artifact@v2

0 commit comments

Comments
 (0)