Skip to content

Commit

Permalink
ci: fix macos x86 build and update components (#364)
Browse files Browse the repository at this point in the history
* ci: add target to macos x86 build

* update ci template

---------

Co-authored-by: LongYinan <[email protected]>
  • Loading branch information
lsndr and Brooooooklyn authored Apr 28, 2024
1 parent fb6686c commit 299e2a6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 36 deletions.
55 changes: 20 additions & 35 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ jobs:
settings:
- host: macos-latest
target: x86_64-apple-darwin
build: |
yarn build
strip -x *.node
build: yarn build --target x86_64-apple-darwin
- host: windows-latest
build: yarn build
build: yarn build --target x86_64-pc-windows-msvc
target: x86_64-pc-windows-msvc
- host: windows-latest
build: |
Expand All @@ -44,57 +42,38 @@ jobs:
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
build: |-
set -e &&
yarn build --target x86_64-unknown-linux-gnu &&
strip *.node
build: yarn build --target x86_64-unknown-linux-gnu
- host: ubuntu-latest
target: x86_64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: set -e && yarn build && strip *.node
build: yarn build --target x86_64-unknown-linux-musl
- host: macos-latest
target: aarch64-apple-darwin
build: |
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*;
export CC=$(xcrun -f clang);
export CXX=$(xcrun -f clang++);
SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
yarn build --target aarch64-apple-darwin
strip -x *.node
build: yarn build --target aarch64-apple-darwin
- host: ubuntu-latest
target: aarch64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
build: |-
set -e &&
yarn build --target aarch64-unknown-linux-gnu &&
aarch64-unknown-linux-gnu-strip *.node
build: yarn build --target aarch64-unknown-linux-gnu
- host: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
setup: |
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf -y
build: |
yarn build --target armv7-unknown-linux-gnueabihf
arm-linux-gnueabihf-strip *.node
- host: ubuntu-latest
target: aarch64-linux-android
build: |
yarn build --target aarch64-linux-android
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip *.node
build: yarn build --target aarch64-linux-android
- host: ubuntu-latest
target: armv7-linux-androideabi
build: |
yarn build --target armv7-linux-androideabi
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip *.node
build: yarn build --target armv7-linux-androideabi
- host: ubuntu-latest
target: aarch64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: |-
set -e &&
rustup target add aarch64-unknown-linux-musl &&
yarn build --target aarch64-unknown-linux-musl &&
/aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node
yarn build --target aarch64-unknown-linux-musl
- host: windows-latest
target: aarch64-pc-windows-msvc
build: yarn build --target aarch64-pc-windows-msvc
Expand All @@ -106,7 +85,7 @@ jobs:
uses: actions/setup-node@v4
if: ${{ !matrix.settings.docker }}
with:
node-version: 18
node-version: 20
cache: yarn
- name: Install
uses: dtolnay/rust-toolchain@stable
Expand All @@ -127,7 +106,7 @@ jobs:
- uses: goto-bus-stop/setup-zig@v2
if: ${{ matrix.settings.target == 'armv7-unknown-linux-gnueabihf' }}
with:
version: 0.11.0
version: 0.12.0
- name: Setup toolchain
run: ${{ matrix.settings.setup }}
if: ${{ matrix.settings.setup }}
Expand All @@ -142,7 +121,7 @@ jobs:
uses: actions/setup-node@v4
if: matrix.settings.target == 'i686-pc-windows-msvc'
with:
node-version: 18
node-version: 20
cache: yarn
architecture: x86
- name: Build in docker
Expand Down Expand Up @@ -176,7 +155,7 @@ jobs:
with:
operating_system: freebsd
version: '13.2'
memory: 13G
memory: 8G
cpu_count: 3
environment_variables: 'DEBUG RUSTUP_IO_THREADS'
shell: bash
Expand Down Expand Up @@ -218,8 +197,13 @@ jobs:
settings:
- host: windows-latest
target: x86_64-pc-windows-msvc
architecture: x64
- host: macos-latest
target: aarch64-apple-darwin
architecture: arm64
- host: macos-latest
target: x86_64-apple-darwin
architecture: x64
node:
- '18'
- '20'
Expand All @@ -231,6 +215,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
cache: yarn
architecture: ${{ matrix.settings.architecture }}
- name: Install dependencies
run: yarn install
- name: Download artifacts
Expand Down Expand Up @@ -433,7 +418,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: yarn
- name: Install dependencies
run: yarn install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: 'yarn'

- name: Install
Expand Down

0 comments on commit 299e2a6

Please sign in to comment.