Unverified Commit d1b7e7f6 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Update swc builds (#37285)

* Update swc builds

* test builds

* use alias for now

* fix typo

* handle existing case

* update windows and bsd

* fix

* re-add publish check
parent 0d2121db
...@@ -1165,10 +1165,12 @@ jobs: ...@@ -1165,10 +1165,12 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
settings: settings:
# pnpm is aliased here temporarily until the build docker
# image is updated past Node.js v14.19 (current 14.18.1)
- host: macos-latest - host: macos-latest
target: 'x86_64-apple-darwin' target: 'x86_64-apple-darwin'
build: | build: |
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" "pnpm@${PNPM_VERSION}" npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi
turbo run build-native --cache-dir=".turbo" -- --release turbo run build-native --cache-dir=".turbo" -- --release
strip -x packages/next-swc/native/next-swc.*.node strip -x packages/next-swc/native/next-swc.*.node
- host: windows-latest - host: windows-latest
...@@ -1189,7 +1191,7 @@ jobs: ...@@ -1189,7 +1191,7 @@ jobs:
rustup toolchain install "${RUST_TOOLCHAIN}" && rustup toolchain install "${RUST_TOOLCHAIN}" &&
rustup default "${RUST_TOOLCHAIN}" && rustup default "${RUST_TOOLCHAIN}" &&
rustup target add x86_64-unknown-linux-gnu && rustup target add x86_64-unknown-linux-gnu &&
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" "pnpm@${PNPM_VERSION}" && npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi &&
turbo run build-native --cache-dir=".turbo" -- --release --target x86_64-unknown-linux-gnu && turbo run build-native --cache-dir=".turbo" -- --release --target x86_64-unknown-linux-gnu &&
strip packages/next-swc/native/next-swc.*.node strip packages/next-swc/native/next-swc.*.node
- host: ubuntu-latest - host: ubuntu-latest
...@@ -1200,7 +1202,7 @@ jobs: ...@@ -1200,7 +1202,7 @@ jobs:
rustup toolchain install "${RUST_TOOLCHAIN}" && rustup toolchain install "${RUST_TOOLCHAIN}" &&
rustup default "${RUST_TOOLCHAIN}" && rustup default "${RUST_TOOLCHAIN}" &&
rustup target add x86_64-unknown-linux-musl && rustup target add x86_64-unknown-linux-musl &&
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" "pnpm@${PNPM_VERSION}" && npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi &&
turbo run build-native --cache-dir=".turbo" -- --release --target x86_64-unknown-linux-musl && turbo run build-native --cache-dir=".turbo" -- --release --target x86_64-unknown-linux-musl &&
strip packages/next-swc/native/next-swc.*.node strip packages/next-swc/native/next-swc.*.node
- host: macos-latest - host: macos-latest
...@@ -1211,7 +1213,7 @@ jobs: ...@@ -1211,7 +1213,7 @@ jobs:
export CXX=$(xcrun -f clang++); export CXX=$(xcrun -f clang++);
SYSROOT=$(xcrun --sdk macosx --show-sdk-path); SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT"; export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" "pnpm@${PNPM_VERSION}" npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi
turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-apple-darwin turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-apple-darwin
strip -x packages/next-swc/native/next-swc.*.node strip -x packages/next-swc/native/next-swc.*.node
- host: ubuntu-latest - host: ubuntu-latest
...@@ -1222,7 +1224,7 @@ jobs: ...@@ -1222,7 +1224,7 @@ jobs:
rustup toolchain install "${RUST_TOOLCHAIN}" && rustup toolchain install "${RUST_TOOLCHAIN}" &&
rustup default "${RUST_TOOLCHAIN}" && rustup default "${RUST_TOOLCHAIN}" &&
rustup target add aarch64-unknown-linux-gnu && rustup target add aarch64-unknown-linux-gnu &&
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" "pnpm@${PNPM_VERSION}" && npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi &&
export CC_aarch64_unknown_linux_gnu=/usr/aarch64-unknown-linux-gnu/bin/aarch64-unknown-linux-gnu-gcc && export CC_aarch64_unknown_linux_gnu=/usr/aarch64-unknown-linux-gnu/bin/aarch64-unknown-linux-gnu-gcc &&
turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-unknown-linux-gnu && turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-unknown-linux-gnu &&
llvm-strip -x packages/next-swc/native/next-swc.*.node llvm-strip -x packages/next-swc/native/next-swc.*.node
...@@ -1232,7 +1234,7 @@ jobs: ...@@ -1232,7 +1234,7 @@ jobs:
sudo apt-get update sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y
build: | build: |
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" "pnpm@${PNPM_VERSION}" npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi
turbo run build-native-no-plugin --cache-dir=".turbo" -- --release --target armv7-unknown-linux-gnueabihf turbo run build-native-no-plugin --cache-dir=".turbo" -- --release --target armv7-unknown-linux-gnueabihf
arm-linux-gnueabihf-strip packages/next-swc/native/next-swc.*.node arm-linux-gnueabihf-strip packages/next-swc/native/next-swc.*.node
- host: ubuntu-latest - host: ubuntu-latest
...@@ -1242,7 +1244,7 @@ jobs: ...@@ -1242,7 +1244,7 @@ jobs:
export CC="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang" export CC="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang"
export CXX="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang++" export CXX="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang++"
export PATH="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}" export PATH="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}"
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" "pnpm@${PNPM_VERSION}" npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi
turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-linux-android turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-linux-android
${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip packages/next-swc/native/next-swc.*.node ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip packages/next-swc/native/next-swc.*.node
- host: ubuntu-latest - host: ubuntu-latest
...@@ -1260,7 +1262,7 @@ jobs: ...@@ -1260,7 +1262,7 @@ jobs:
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: >- build: >-
set -e && set -e &&
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" "pnpm@${PNPM_VERSION}" && npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi &&
rustup toolchain install "${RUST_TOOLCHAIN}" && rustup toolchain install "${RUST_TOOLCHAIN}" &&
rustup default "${RUST_TOOLCHAIN}" && rustup default "${RUST_TOOLCHAIN}" &&
rustup target add aarch64-unknown-linux-musl && rustup target add aarch64-unknown-linux-musl &&
...@@ -1415,8 +1417,8 @@ jobs: ...@@ -1415,8 +1417,8 @@ jobs:
whoami whoami
env env
freebsd-version freebsd-version
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" "pnpm@${PNPM_VERSION}" npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi
pnpm --filter=@next/swc build-native --release --target x86_64-unknown-freebsd yarn --cwd=packages/next-swc build-native --release --target x86_64-unknown-freebsd
rm -rf node_modules rm -rf node_modules
rm -rf packages/next-swc/target rm -rf packages/next-swc/target
- name: Upload artifact - name: Upload artifact
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment