Skip to content

Commit d618df0

Browse files
committed
Build x86_64-freebsd SWC binary
1 parent e05a95a commit d618df0

File tree

3 files changed

+81
-0
lines changed

3 files changed

+81
-0
lines changed

.github/workflows/build_test_deploy.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,6 +1303,66 @@ jobs:
13031303
name: next-swc-binaries
13041304
path: packages/next-swc/native/next-swc.*.node
13051305

1306+
build-native-freebsd:
1307+
if: ${{ needs.build.outputs.isRelease == 'true' }}
1308+
needs: build
1309+
name: stable - x86_64-unknown-freebsd - node@16
1310+
runs-on: macos-10.15
1311+
steps:
1312+
- name: tune mac network
1313+
run: sudo sysctl -w net.link.generic.system.hwcksum_tx=0 && sudo sysctl -w net.link.generic.system.hwcksum_rx=0
1314+
- uses: actions/checkout@v3
1315+
- name: Delete useless files
1316+
run: |
1317+
rm -rf bench
1318+
rm -rf docs
1319+
rm -rf errors
1320+
rm -rf examples
1321+
rm -rf scripts
1322+
rm -rf test
1323+
- name: Build
1324+
id: build
1325+
uses: vmactions/[email protected]
1326+
env:
1327+
DEBUG: napi:*
1328+
RUSTUP_HOME: /usr/local/rustup
1329+
CARGO_HOME: /usr/local/cargo
1330+
RUSTUP_IO_THREADS: 1
1331+
# Disable LTO, or the lld may crash with OOM
1332+
CARGO_PROFILE_RELEASE_LTO: false
1333+
with:
1334+
envs: DEBUG RUSTUP_HOME CARGO_HOME RUSTUP_IO_THREADS CARGO_PROFILE_RELEASE_LTO NAPI_CLI_VERSION TURBO_VERSION RUST_TOOLCHAIN
1335+
usesh: true
1336+
mem: 6000
1337+
prepare: |
1338+
pkg install -y curl node14
1339+
curl -qL https://www.npmjs.com/install.sh | sh
1340+
npm install -g yarn
1341+
curl https://sh.rustup.rs -sSf --output rustup.sh
1342+
sh rustup.sh -y --profile minimal --default-toolchain stable
1343+
export PATH="/usr/local/cargo/bin:$PATH"
1344+
echo "~~~~ rustc --version ~~~~"
1345+
rustc --version
1346+
echo "~~~~ node -v ~~~~"
1347+
node -v
1348+
run: |
1349+
export PATH="/usr/local/cargo/bin:$PATH"
1350+
pwd
1351+
ls -lah
1352+
whoami
1353+
env
1354+
freebsd-version
1355+
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}"
1356+
yarn --cwd packages/next-swc build-native --release --target x86_64-unknown-freebsd
1357+
rm -rf node_modules
1358+
rm -rf packages/next-swc/target
1359+
- name: Upload artifact
1360+
uses: actions/upload-artifact@v3
1361+
with:
1362+
name: next-swc-binaries
1363+
path: packages/next-swc/native/next-swc.*.node
1364+
if-no-files-found: error
1365+
13061366
build-wasm:
13071367
needs: build
13081368
if: ${{ needs.build.outputs.isRelease == 'true' }}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# `@next/swc-freebsd-x64`
2+
3+
This is the **x86_64-unknown-freebsd** binary for `@next/swc`
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "@next/swc-freebsd-x64",
3+
"version": "0.0.0",
4+
"os": [
5+
"freebsd"
6+
],
7+
"cpu": [
8+
"x64"
9+
],
10+
"main": "next-swc.freebsd-x64.node",
11+
"files": [
12+
"next-swc.freebsd-x64.node"
13+
],
14+
"license": "MIT",
15+
"engines": {
16+
"node": ">= 10"
17+
}
18+
}

0 commit comments

Comments
 (0)