Skip to content

Commit

Permalink
fix(*): libc fields in package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Mar 6, 2022
1 parent 0dd30ff commit b4de8de
Show file tree
Hide file tree
Showing 26 changed files with 138 additions and 62 deletions.
125 changes: 64 additions & 61 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: CI
env:
DEBUG: 'napi:*'
MACOSX_DEPLOYMENT_TARGET: '10.13'
NODE_OPTIONS: '--max-old-space-size=3072'

on:
push:
Expand Down Expand Up @@ -32,9 +33,9 @@ jobs:
- host: windows-latest
architecture: x86
build: |
yarn global add lerna
lerna exec "yarn build --target i686-pc-windows-msvc" --concurrency 1 --stream --no-prefix
yarn test
yarn config set supportedArchitectures.cpu "arm64"
yarn lerna exec "yarn build --target i686-pc-windows-msvc" --concurrency 1 --stream --no-prefix
yarn test -s
target: 'i686-pc-windows-msvc'
- host: ubuntu-latest
architecture: x64
Expand All @@ -45,8 +46,7 @@ jobs:
set -e &&
rustup toolchain install $(cat ./rust-toolchain) &&
rustup target add x86_64-unknown-linux-gnu &&
yarn global add lerna &&
lerna exec "yarn build --target x86_64-unknown-linux-gnu --zig --zig-abi-suffix 2.12" --concurrency 1 --stream --no-prefix &&
yarn lerna exec "yarn build --target x86_64-unknown-linux-gnu --zig --zig-abi-suffix 2.12" --concurrency 1 --stream --no-prefix &&
llvm-strip -x packages/*/*.node
- host: ubuntu-latest
architecture: x64
Expand All @@ -62,8 +62,7 @@ jobs:
export CXX=$(xcrun -f clang++);
SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
yarn global add lerna
lerna exec "yarn build --target aarch64-apple-darwin" --concurrency 1 --stream --no-prefix
yarn lerna exec "yarn build --target aarch64-apple-darwin" --concurrency 1 --stream --no-prefix
strip -x packages/*/*.node
- host: ubuntu-latest
architecture: x64
Expand All @@ -73,18 +72,15 @@ jobs:
set -e &&
rustup toolchain install $(cat ./rust-toolchain) &&
rustup target add aarch64-unknown-linux-gnu &&
yarn global add lerna &&
lerna exec "yarn build --target aarch64-unknown-linux-gnu --zig --zig-abi-suffix 2.17" --concurrency 1 --stream --no-prefix &&
yarn lerna exec "yarn build --target aarch64-unknown-linux-gnu --zig --zig-abi-suffix 2.17" --concurrency 1 --stream --no-prefix &&
llvm-strip -x packages/*/*.node
- host: ubuntu-18.04
architecture: x64
target: 'armv7-unknown-linux-gnueabihf'
setup: |
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y
build: |
yarn global add lerna
lerna exec "yarn build --target armv7-unknown-linux-gnueabihf" --concurrency 1 --stream --no-prefix
build: yarn lerna exec "yarn build --target armv7-unknown-linux-gnueabihf" --concurrency 1 --stream --no-prefix
- host: ubuntu-latest
architecture: x64
target: aarch64-linux-android
Expand All @@ -93,8 +89,7 @@ jobs:
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 PATH="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}"
yarn global add lerna
lerna exec "yarn build --target aarch64-linux-android" --concurrency 1 --stream --no-prefix
yarn lerna exec "yarn build --target aarch64-linux-android" --concurrency 1 --stream --no-prefix
- host: ubuntu-latest
architecture: x64
target: armv7-linux-androideabi
Expand All @@ -103,8 +98,7 @@ jobs:
export CC="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang"
export CXX="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang++"
export PATH="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}"
yarn global add lerna
lerna exec "yarn build --target armv7-linux-androideabi" --concurrency 1 --stream --no-prefix
yarn lerna exec "yarn build --target armv7-linux-androideabi" --concurrency 1 --stream --no-prefix
- host: ubuntu-latest
architecture: x64
target: 'aarch64-unknown-linux-musl'
Expand All @@ -114,23 +108,20 @@ jobs:
set -e &&
rustup toolchain install $(cat ./rust-toolchain) &&
rustup target add aarch64-unknown-linux-musl &&
yarn global add lerna &&
lerna exec "yarn build --target aarch64-unknown-linux-musl" --concurrency 1 --stream --no-prefix
yarn lerna exec "yarn build --target aarch64-unknown-linux-musl" --concurrency 1 --stream --no-prefix
- host: windows-latest
architecture: x64
target: 'aarch64-pc-windows-msvc'
build: |
yarn global add lerna
lerna exec "yarn build --target aarch64-pc-windows-msvc" --concurrency 1 --stream --no-prefix
build: yarn lerna exec "yarn build --target aarch64-pc-windows-msvc" --concurrency 1 --stream --no-prefix

name: stable - ${{ matrix.settings.target }} - node@16
runs-on: ${{ matrix.settings.host }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
if: ${{ !matrix.settings.docker }}
with:
node-version: 16
Expand Down Expand Up @@ -176,7 +167,7 @@ jobs:
shell: bash

- name: 'Install dependencies'
run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
run: yarn install --immutable --mode=skip-build --network-timeout 300000

- name: 'Build TypeScript'
run: yarn build:ts
Expand All @@ -195,19 +186,20 @@ jobs:
shell: bash

- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: bindings-${{ matrix.settings.target }}
path: packages/*/*.node
if-no-files-found: error

build-freebsd:
runs-on: macos-10.15
name: Build FreeBSD
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build
id: build
uses: vmactions/freebsd-vm@v0.1.5
uses: vmactions/freebsd-vm@v0.1.6
env:
DEBUG: 'napi:*'
RUSTUP_HOME: /usr/local/rustup
Expand Down Expand Up @@ -237,18 +229,19 @@ jobs:
whoami
env
freebsd-version
yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
yarn install --immutable --mode=skip-build --network-timeout 300000
yarn build:ts
yarn build
yarn test
rm -rf node_modules
rm -rf target
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: bindings-freebsd-amd64
path: packages/*/*.node
if-no-files-found: error

test-macOS-windows-binding:
name: Test bindings on ${{ matrix.settings.target }} - node@${{ matrix.node }}
Expand All @@ -266,22 +259,22 @@ jobs:
runs-on: ${{ matrix.settings.host }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: true

- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
check-latest: true
cache: yarn

- name: Install dependencies
run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
run: yarn install --immutable --mode=skip-build --network-timeout 300000

- name: Download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: bindings-${{ matrix.settings.target }}
path: artifacts
Expand All @@ -307,20 +300,20 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
check-latest: true
cache: yarn

- name: Install dependencies
run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
run: yarn install --immutable --mode=skip-build --network-timeout 300000

- name: Download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: bindings-x86_64-unknown-linux-gnu
path: artifacts
Expand All @@ -342,7 +335,7 @@ jobs:
image: node:${{ matrix.node }}-slim
options: -v ${{ github.workspace }}:/build -w /build
run: |
npx lerna link
yarn lerna link
yarn test
test-linux-x64-centos-7:
Expand All @@ -353,17 +346,17 @@ jobs:
container:
image: centos:7
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install dependencies
run: |
curl -sL https://rpm.nodesource.com/setup_16.x | bash -
yum install nodejs -y
npm install -g yarn
yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
yarn install --immutable --mode=skip-build --network-timeout 300000
- name: Download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: bindings-x86_64-unknown-linux-gnu
path: artifacts
Expand All @@ -381,7 +374,7 @@ jobs:

- name: Test bindings
run: |
npx lerna link
yarn lerna link
yarn test
test-linux-x64-musl-binding:
Expand All @@ -395,23 +388,25 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
check-latest: true
cache: yarn

- name: Install dependencies
run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
run: |
yarn config set supportedArchitectures.libc "musl"
yarn install --immutable --mode=skip-build --network-timeout 300000
- name: Build TypeScript
run: yarn build:ts

- name: Download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: bindings-x86_64-unknown-linux-musl
path: artifacts
Expand All @@ -430,7 +425,7 @@ jobs:
image: node:${{ matrix.node }}-alpine
options: -v ${{ github.workspace }}:/build -w /build
run: |
npx lerna link
yarn lerna link
yarn test
test-linux-aarch64-gnu-binding:
Expand All @@ -446,16 +441,19 @@ jobs:
steps:
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset

- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: bindings-aarch64-unknown-linux-gnu
path: artifacts

- name: Install dependencies
run: yarn install --ignore-scripts --ignore-platform --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
run: |
yarn config set supportedArchitectures.cpu "arm64"
yarn config set supportedArchitectures.libc "glibc"
yarn install --immutable --mode=skip-build --network-timeout 300000
- name: Move artifacts
run: yarn artifacts
Expand Down Expand Up @@ -486,13 +484,16 @@ jobs:
steps:
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset

- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install dependencies
run: yarn install --ignore-scripts --frozen-lockfile --ignore-platform --registry https://registry.npmjs.org --network-timeout 300000
run: |
yarn config set supportedArchitectures.cpu "arm64"
yarn config set supportedArchitectures.libc "musl"
yarn install --immutable --mode=skip-build --network-timeout 300000
- name: Download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: bindings-aarch64-unknown-linux-musl
path: packages
Expand Down Expand Up @@ -529,13 +530,15 @@ jobs:
steps:
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset

- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Install dependencies
run: yarn install --ignore-scripts --ignore-platform --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
run: |
yarn config set supportedArchitectures.cpu "arm"
yarn install --immutable --mode=skip-build --network-timeout 300000
- name: Download artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: bindings-armv7-unknown-linux-gnueabihf
path: artifacts
Expand Down Expand Up @@ -571,10 +574,10 @@ jobs:
- test-linux-arm-gnueabihf-binding
- test-macOS-windows-binding
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v2-beta
uses: actions/setup-node@v3
with:
node-version: 16
check-latest: true
Expand All @@ -587,10 +590,10 @@ jobs:
key: npm-cache-ubuntu-latest-publish-${{ hashFiles('yarn.lock') }}

- name: 'Install dependencies'
run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
run: yarn install --immutable --mode=skip-build --network-timeout 300000

- name: Download all artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
path: artifacts

Expand All @@ -613,7 +616,7 @@ jobs:
run: |
find ./packages/ -type d -maxdepth 1 -exec cp LICENSE {} \;
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
npx lerna publish from-package --no-verify-access --yes
yarn lerna publish from-package --no-verify-access --yes
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
yarnPath: .yarn/releases/yarn-3.2.0.cjs
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.2.0.cjs
Loading

0 comments on commit b4de8de

Please sign in to comment.