Skip to content

Commit

Permalink
Build x86_64-freebsd SWC binary (#36826)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed May 11, 2022
1 parent 334d42c commit 6f344e6
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/build_test_deploy.yml
Expand Up @@ -873,6 +873,7 @@ jobs:
- build
- build-wasm
- build-native
- build-native-freebsd
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
steps:
Expand Down Expand Up @@ -1303,6 +1304,66 @@ jobs:
name: next-swc-binaries
path: packages/next-swc/native/next-swc.*.node

build-native-freebsd:
if: ${{ needs.build.outputs.isRelease == 'true' }}
needs: build
name: stable - x86_64-unknown-freebsd - node@16
runs-on: macos-10.15
steps:
- name: tune mac network
run: sudo sysctl -w net.link.generic.system.hwcksum_tx=0 && sudo sysctl -w net.link.generic.system.hwcksum_rx=0
- uses: actions/checkout@v3
- name: Delete useless files
run: |
rm -rf bench
rm -rf docs
rm -rf errors
rm -rf examples
rm -rf scripts
rm -rf test
- name: Build
id: build
uses: vmactions/freebsd-vm@v0.1.6
env:
DEBUG: napi:*
RUSTUP_HOME: /usr/local/rustup
CARGO_HOME: /usr/local/cargo
RUSTUP_IO_THREADS: 1
# Disable LTO, or the lld may crash with OOM
CARGO_PROFILE_RELEASE_LTO: false
with:
envs: DEBUG RUSTUP_HOME CARGO_HOME RUSTUP_IO_THREADS CARGO_PROFILE_RELEASE_LTO NAPI_CLI_VERSION TURBO_VERSION RUST_TOOLCHAIN
usesh: true
mem: 6000
prepare: |
pkg install -y curl node14
curl -qL https://www.npmjs.com/install.sh | sh
npm install -g yarn
curl https://sh.rustup.rs -sSf --output rustup.sh
sh rustup.sh -y --profile minimal --default-toolchain stable
export PATH="/usr/local/cargo/bin:$PATH"
echo "~~~~ rustc --version ~~~~"
rustc --version
echo "~~~~ node -v ~~~~"
node -v
run: |
export PATH="/usr/local/cargo/bin:$PATH"
pwd
ls -lah
whoami
env
freebsd-version
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}"
yarn --cwd packages/next-swc build-native --release --target x86_64-unknown-freebsd
rm -rf node_modules
rm -rf packages/next-swc/target
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: next-swc-binaries
path: packages/next-swc/native/next-swc.*.node
if-no-files-found: error

build-wasm:
needs: build
if: ${{ needs.build.outputs.isRelease == 'true' }}
Expand Down
3 changes: 3 additions & 0 deletions packages/next-swc/crates/napi/npm/freebsd-x64/README.md
@@ -0,0 +1,3 @@
# `@next/swc-freebsd-x64`

This is the **x86_64-unknown-freebsd** binary for `@next/swc`
18 changes: 18 additions & 0 deletions packages/next-swc/crates/napi/npm/freebsd-x64/package.json
@@ -0,0 +1,18 @@
{
"name": "@next/swc-freebsd-x64",
"version": "0.0.0",
"os": [
"freebsd"
],
"cpu": [
"x64"
],
"main": "next-swc.freebsd-x64.node",
"files": [
"next-swc.freebsd-x64.node"
],
"license": "MIT",
"engines": {
"node": ">= 10"
}
}

0 comments on commit 6f344e6

Please sign in to comment.