diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 70b01cf..d632213 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -27,11 +27,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: | @@ -41,19 +39,14 @@ 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 - # - 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-gnu + - host: ubuntu-latest + target: x86_64-unknown-linux-musl + docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine + build: yarn build --target x86_64-unknown-linux-musl - host: macos-latest target: aarch64-apple-darwin - build: | - 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 @@ -65,17 +58,12 @@ jobs: 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 - # - 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 aarch64-linux-android + - host: ubuntu-latest + target: armv7-linux-androideabi + 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 @@ -105,7 +93,7 @@ jobs: toolchain: stable targets: ${{ matrix.settings.target }} - name: Cache cargo - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.cargo/registry/index/ @@ -117,7 +105,7 @@ jobs: - uses: goto-bus-stop/setup-zig@v2 if: ${{ matrix.settings.target == 'armv7-unknown-linux-gnueabihf' }} with: - version: 0.10.1 + version: 0.12.0 - name: Setup toolchain run: ${{ matrix.settings.setup }} if: ${{ matrix.settings.setup }} @@ -147,46 +135,42 @@ jobs: if: ${{ !matrix.settings.docker }} shell: bash - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: bindings-${{ matrix.settings.target }} path: ${{ env.APP_NAME }}.*.node if-no-files-found: error build-freebsd: - runs-on: macos-12 + runs-on: macos-13 name: Build FreeBSD steps: - uses: actions/checkout@v4 - with: - submodules: true - name: Build id: build - uses: vmactions/freebsd-vm@v0 + uses: cross-platform-actions/action@v0.24.0 env: DEBUG: napi:* - RUSTUP_HOME: /usr/local/rustup - CARGO_HOME: /usr/local/cargo RUSTUP_IO_THREADS: 1 with: - envs: DEBUG RUSTUP_HOME CARGO_HOME RUSTUP_IO_THREADS - usesh: true - mem: 3000 - prepare: | - pkg install -y -f curl node libnghttp2 llvm cmake # Install the llvm package to fix the libclang error - curl -qL https://www.npmjs.com/install.sh | sh - npm install --location=global --ignore-scripts yarn + operating_system: freebsd + version: '13.2' + memory: 8G + cpu_count: 3 + environment_variables: 'DEBUG RUSTUP_IO_THREADS' + shell: bash + run: | + sudo pkg install -y -f curl node libnghttp2 npm llvm cmake # Install the llvm package to fix the libclang error + sudo npm install -g yarn --ignore-scripts curl https://sh.rustup.rs -sSf --output rustup.sh sh rustup.sh -y --profile minimal --default-toolchain beta rustup component add rustfmt - export PATH="/usr/local/cargo/bin:$PATH" + source "$HOME/.cargo/env" echo "~~~~ rustc --version ~~~~" rustc --version echo "~~~~ node -v ~~~~" node -v echo "~~~~ yarn --version ~~~~" yarn --version - run: | - export PATH="/usr/local/cargo/bin:$PATH" pwd ls -lah whoami @@ -194,13 +178,12 @@ jobs: freebsd-version yarn install yarn build - strip -x *.node yarn test rm -rf node_modules rm -rf target rm -rf .yarn/cache - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: bindings-freebsd path: ${{ env.APP_NAME }}.*.node @@ -235,6 +218,7 @@ jobs: with: node-version: ${{ matrix.node }} cache: yarn + architecture: ${{ matrix.settings.architecture }} - name: Install dependencies run: yarn install - name: Download artifacts @@ -485,6 +469,7 @@ jobs: shell: bash - name: Publish run: | + npm config set provenance true if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$"; then echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc