|
@@ -41,33 +41,32 @@ jobs:
|
|
|
architecture: x86
|
|
|
- host: ubuntu-latest
|
|
|
target: x86_64-unknown-linux-gnu
|
|
|
- architecture: x64
|
|
|
- docker: |
|
|
|
- docker pull $DOCKER_REGISTRY_URL/napi-rs/napi-rs/nodejs-rust:lts-debian
|
|
|
- docker tag $DOCKER_REGISTRY_URL/napi-rs/napi-rs/nodejs-rust:lts-debian builder
|
|
|
- build: |
|
|
|
- docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/build -w /build builder yarn build --target x86_64-unknown-linux-gnu && strip *.node
|
|
|
+ docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
|
|
|
+ build: |-
|
|
|
+ set -e &&
|
|
|
+ yarn build --target x86_64-unknown-linux-gnu &&
|
|
|
+ strip *.node
|
|
|
- host: ubuntu-latest
|
|
|
target: x86_64-unknown-linux-musl
|
|
|
- architecture: x64
|
|
|
- docker: |
|
|
|
- docker pull $DOCKER_REGISTRY_URL/napi-rs/napi-rs/nodejs-rust:lts-alpine
|
|
|
- docker tag $DOCKER_REGISTRY_URL/napi-rs/napi-rs/nodejs-rust:lts-alpine builder
|
|
|
- build: docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/build -w /build builder yarn build && strip *.node
|
|
|
+ docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
|
|
|
+ build: set -e && yarn build && strip *.node
|
|
|
- host: macos-latest
|
|
|
target: aarch64-apple-darwin
|
|
|
build: |
|
|
|
- yarn build --target=aarch64-apple-darwin
|
|
|
+ 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
|
|
|
- host: ubuntu-latest
|
|
|
- architecture: x64
|
|
|
target: aarch64-unknown-linux-gnu
|
|
|
- setup: |
|
|
|
- sudo apt-get update
|
|
|
- sudo apt-get install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu -y
|
|
|
- build: |
|
|
|
- yarn build --target=aarch64-unknown-linux-gnu
|
|
|
- aarch64-linux-gnu-strip *.node
|
|
|
+ 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
|
|
|
- host: ubuntu-latest
|
|
|
architecture: x64
|
|
|
target: armv7-unknown-linux-gnueabihf
|
|
@@ -100,12 +99,12 @@ jobs:
|
|
|
- host: ubuntu-latest
|
|
|
architecture: x64
|
|
|
target: aarch64-unknown-linux-musl
|
|
|
- downloadTarget: aarch64-unknown-linux-musl
|
|
|
- docker: |
|
|
|
- docker pull ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
|
|
|
- docker tag ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine builder
|
|
|
- build: |
|
|
|
- docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/build -w /build builder sh -c "yarn build --target=aarch64-unknown-linux-musl && /aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node"
|
|
|
+ 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
|
|
|
- host: windows-latest
|
|
|
architecture: x64
|
|
|
target: aarch64-pc-windows-msvc
|
|
@@ -113,9 +112,10 @@ jobs:
|
|
|
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
|
|
|
check-latest: true
|
|
@@ -123,46 +123,48 @@ jobs:
|
|
|
architecture: ${{ matrix.settings.architecture }}
|
|
|
- name: Install
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
+ if: ${{ !matrix.settings.docker }}
|
|
|
with:
|
|
|
profile: minimal
|
|
|
override: true
|
|
|
toolchain: stable
|
|
|
target: ${{ matrix.settings.target }}
|
|
|
- - name: Generate Cargo.lock
|
|
|
- uses: actions-rs/cargo@v1
|
|
|
+ - name: Cache cargo
|
|
|
+ uses: actions/cache@v3
|
|
|
with:
|
|
|
- command: generate-lockfile
|
|
|
- - name: Cache cargo registry
|
|
|
- uses: actions/cache@v2
|
|
|
- with:
|
|
|
- path: ~/.cargo/registry
|
|
|
- key: ${{ matrix.settings.target }}-node@16-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
|
|
|
- - name: Cache cargo index
|
|
|
- uses: actions/cache@v2
|
|
|
- with:
|
|
|
- path: ~/.cargo/git
|
|
|
- key: ${{ matrix.settings.target }}-node@16-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
|
|
|
+ path: |
|
|
|
+ ~/.cargo/registry/index/
|
|
|
+ ~/.cargo/registry/cache/
|
|
|
+ ~/.cargo/git/db/
|
|
|
+ .cargo-cache/registry/index/
|
|
|
+ .cargo-cache/registry/cache/
|
|
|
+ .cargo-cache/git/db/
|
|
|
+ target/
|
|
|
+ key: ${{ matrix.settings.target }}-cargo-registry
|
|
|
- name: Cache NPM dependencies
|
|
|
- uses: actions/cache@v2
|
|
|
+ uses: actions/cache@v3
|
|
|
with:
|
|
|
path: node_modules
|
|
|
- key: npm-cache-${{ matrix.settings.target }}-node@16-${{ hashFiles('yarn.lock') }}
|
|
|
- - name: Pull latest image
|
|
|
- run: ${{ matrix.settings.docker }}
|
|
|
- env:
|
|
|
- DOCKER_REGISTRY_URL: ghcr.io
|
|
|
- if: ${{ matrix.settings.docker }}
|
|
|
+ key: npm-cache-build-${{ matrix.settings.target }}-node@16
|
|
|
- name: Setup toolchain
|
|
|
run: ${{ matrix.settings.setup }}
|
|
|
if: ${{ matrix.settings.setup }}
|
|
|
shell: bash
|
|
|
- name: Install dependencies
|
|
|
run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
|
|
|
+ - name: Build in docker
|
|
|
+ uses: addnab/docker-run-action@v3
|
|
|
+ if: ${{ matrix.settings.docker }}
|
|
|
+ with:
|
|
|
+ image: ${{ matrix.settings.docker }}
|
|
|
+ options: --user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/root/.cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/root/.cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/root/.cargo/registry/index -v ${{ github.workspace }}:/build -w /build
|
|
|
+ run: ${{ matrix.settings.build }}
|
|
|
- name: Build
|
|
|
run: ${{ matrix.settings.build }}
|
|
|
+ if: ${{ !matrix.settings.docker }}
|
|
|
shell: bash
|
|
|
- name: Upload artifact
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
+ uses: actions/upload-artifact@v3
|
|
|
with:
|
|
|
name: bindings-${{ matrix.settings.target }}
|
|
|
path: ${{ env.APP_NAME }}.*.node
|
|
@@ -171,10 +173,10 @@ jobs:
|
|
|
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
|
|
@@ -211,7 +213,7 @@ jobs:
|
|
|
rm -rf node_modules
|
|
|
rm -rf target
|
|
|
- name: Upload artifact
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
+ uses: actions/upload-artifact@v3
|
|
|
with:
|
|
|
name: bindings-freebsd
|
|
|
path: ${{ env.APP_NAME }}.*.node
|
|
@@ -227,27 +229,27 @@ jobs:
|
|
|
- host: windows-latest
|
|
|
target: x86_64-pc-windows-msvc
|
|
|
node:
|
|
|
- - '12'
|
|
|
- '14'
|
|
|
- '16'
|
|
|
+ - '18'
|
|
|
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
|
|
|
with:
|
|
|
node-version: ${{ matrix.node }}
|
|
|
check-latest: true
|
|
|
cache: yarn
|
|
|
- name: Cache NPM dependencies
|
|
|
- uses: actions/cache@v2
|
|
|
+ uses: actions/cache@v3
|
|
|
with:
|
|
|
path: node_modules
|
|
|
- key: npm-cache-test-${{ matrix.settings.target }}-${{ matrix.node }}-${{ hashFiles('yarn.lock') }}
|
|
|
+ key: npm-cache-test-${{ matrix.settings.target }}-${{ matrix.node }}
|
|
|
- name: Install dependencies
|
|
|
run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
|
|
|
- name: Download artifacts
|
|
|
- uses: actions/download-artifact@v2
|
|
|
+ uses: actions/download-artifact@v3
|
|
|
with:
|
|
|
name: bindings-${{ matrix.settings.target }}
|
|
|
path: .
|
|
@@ -264,27 +266,27 @@ jobs:
|
|
|
fail-fast: false
|
|
|
matrix:
|
|
|
node:
|
|
|
- - '12'
|
|
|
- '14'
|
|
|
- '16'
|
|
|
+ - '18'
|
|
|
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: Cache NPM dependencies
|
|
|
- uses: actions/cache@v2
|
|
|
+ uses: actions/cache@v3
|
|
|
with:
|
|
|
path: node_modules
|
|
|
- key: npm-cache-test-linux-x64-gnu-${{ matrix.node }}-${{ hashFiles('yarn.lock') }}
|
|
|
+ key: npm-cache-test-linux-x64-gnu-${{ matrix.node }}
|
|
|
- name: Install dependencies
|
|
|
run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --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: .
|
|
@@ -301,27 +303,27 @@ jobs:
|
|
|
fail-fast: false
|
|
|
matrix:
|
|
|
node:
|
|
|
- - '12'
|
|
|
- '14'
|
|
|
- '16'
|
|
|
+ - '18'
|
|
|
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: Cache NPM dependencies
|
|
|
- uses: actions/cache@v2
|
|
|
+ uses: actions/cache@v3
|
|
|
with:
|
|
|
path: node_modules
|
|
|
- key: npm-cache-test-x86_64-unknown-linux-musl-${{ matrix.node }}-${{ hashFiles('yarn.lock') }}
|
|
|
+ key: npm-cache-test-x86_64-unknown-linux-musl-${{ matrix.node }}
|
|
|
- name: Install dependencies
|
|
|
run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
|
|
|
- name: Download artifacts
|
|
|
- uses: actions/download-artifact@v2
|
|
|
+ uses: actions/download-artifact@v3
|
|
|
with:
|
|
|
name: bindings-x86_64-unknown-linux-musl
|
|
|
path: .
|
|
@@ -338,15 +340,15 @@ jobs:
|
|
|
fail-fast: false
|
|
|
matrix:
|
|
|
node:
|
|
|
- - '12'
|
|
|
- '14'
|
|
|
- '16'
|
|
|
+ - '18'
|
|
|
runs-on: ubuntu-latest
|
|
|
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: .
|
|
@@ -354,10 +356,10 @@ jobs:
|
|
|
run: ls -R .
|
|
|
shell: bash
|
|
|
- name: Cache NPM dependencies
|
|
|
- uses: actions/cache@v2
|
|
|
+ uses: actions/cache@v3
|
|
|
with:
|
|
|
path: node_modules
|
|
|
- key: npm-cache-test-linux-aarch64-gnu-${{ matrix.node }}-${{ hashFiles('yarn.lock') }}
|
|
|
+ key: npm-cache-test-linux-aarch64-gnu-${{ matrix.node }}
|
|
|
- name: Install dependencies
|
|
|
run: yarn install --ignore-scripts --ignore-platform --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
|
|
|
- name: Setup and run tests
|
|
@@ -376,9 +378,9 @@ jobs:
|
|
|
runs-on: ubuntu-latest
|
|
|
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-musl
|
|
|
path: .
|
|
@@ -386,10 +388,10 @@ jobs:
|
|
|
run: ls -R .
|
|
|
shell: bash
|
|
|
- name: Cache NPM dependencies
|
|
|
- uses: actions/cache@v2
|
|
|
+ uses: actions/cache@v3
|
|
|
with:
|
|
|
path: node_modules
|
|
|
- key: npm-cache-test-linux-aarch64-musl-${{ matrix.node }}-${{ hashFiles('yarn.lock') }}
|
|
|
+ key: npm-cache-test-linux-aarch64-musl-${{ matrix.node }}
|
|
|
- name: Install dependencies
|
|
|
run: yarn install --ignore-scripts --ignore-platform --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
|
|
|
- name: Setup and run tests
|
|
@@ -409,15 +411,15 @@ jobs:
|
|
|
fail-fast: false
|
|
|
matrix:
|
|
|
node:
|
|
|
- - '12'
|
|
|
- '14'
|
|
|
- '16'
|
|
|
+ - '18'
|
|
|
runs-on: ubuntu-latest
|
|
|
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-armv7-unknown-linux-gnueabihf
|
|
|
path: .
|
|
@@ -425,10 +427,10 @@ jobs:
|
|
|
run: ls -R .
|
|
|
shell: bash
|
|
|
- name: Cache NPM dependencies
|
|
|
- uses: actions/cache@v2
|
|
|
+ uses: actions/cache@v3
|
|
|
with:
|
|
|
path: node_modules
|
|
|
- key: npm-cache-test-linux-arm-gnueabihf-${{ matrix.node }}-${{ hashFiles('yarn.lock') }}
|
|
|
+ key: npm-cache-test-linux-arm-gnueabihf-${{ matrix.node }}
|
|
|
- name: Install dependencies
|
|
|
run: yarn install --ignore-scripts --ignore-platform --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
|
|
|
- name: Setup and run tests
|
|
@@ -452,24 +454,24 @@ jobs:
|
|
|
- test-linux-aarch64-musl-binding
|
|
|
- test-linux-arm-gnueabihf-binding
|
|
|
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: 16
|
|
|
check-latest: true
|
|
|
cache: yarn
|
|
|
- name: Cache NPM dependencies
|
|
|
- uses: actions/cache@v2
|
|
|
+ uses: actions/cache@v3
|
|
|
with:
|
|
|
path: node_modules
|
|
|
- key: npm-cache-ubuntu-latest-${{ hashFiles('yarn.lock') }}
|
|
|
+ key: npm-cache-ubuntu-latest-publish
|
|
|
restore-keys: |
|
|
|
npm-cache-
|
|
|
- name: Install dependencies
|
|
|
run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
|
|
|
- name: Download all artifacts
|
|
|
- uses: actions/download-artifact@v2
|
|
|
+ uses: actions/download-artifact@v3
|
|
|
with:
|
|
|
path: artifacts
|
|
|
- name: Move artifacts
|