Merge pull request #4 from darksaid98/feat/aarch64-unknown-linux-gnu

chore(ci): tweak builds
This commit is contained in:
darksaid98 authored and GitHub committed 2024-05-10 16:46:22 +02:00
commit a270884101
1 file changed
+30 -45
+30 -45
View File
@@ -27,11 +27,9 @@ jobs:
settings: settings:
- host: macos-latest - host: macos-latest
target: x86_64-apple-darwin target: x86_64-apple-darwin
build: | build: yarn build --target x86_64-apple-darwin
yarn build
strip -x *.node
- host: windows-latest - host: windows-latest
build: yarn build build: yarn build --target x86_64-pc-windows-msvc
target: x86_64-pc-windows-msvc target: x86_64-pc-windows-msvc
- host: windows-latest - host: windows-latest
build: | build: |
@@ -41,19 +39,14 @@ jobs:
- host: ubuntu-latest - host: ubuntu-latest
target: x86_64-unknown-linux-gnu target: x86_64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
build: |- build: yarn build --target x86_64-unknown-linux-gnu
set -e && - host: ubuntu-latest
yarn build --target x86_64-unknown-linux-gnu && target: x86_64-unknown-linux-musl
strip *.node docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
# - host: ubuntu-latest build: yarn build --target x86_64-unknown-linux-musl
# target: x86_64-unknown-linux-musl
# docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
# build: set -e && yarn build && strip *.node
- host: macos-latest - host: macos-latest
target: aarch64-apple-darwin target: aarch64-apple-darwin
build: | build: yarn build --target aarch64-apple-darwin
yarn build --target aarch64-apple-darwin
strip -x *.node
- host: ubuntu-latest - host: ubuntu-latest
target: aarch64-unknown-linux-gnu target: aarch64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64 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 sudo apt-get install gcc-arm-linux-gnueabihf -y
build: | build: |
yarn build --target armv7-unknown-linux-gnueabihf yarn build --target armv7-unknown-linux-gnueabihf
arm-linux-gnueabihf-strip *.node
- host: ubuntu-latest - host: ubuntu-latest
target: aarch64-linux-android target: aarch64-linux-android
build: | build: yarn build --target aarch64-linux-android
yarn build --target aarch64-linux-android - host: ubuntu-latest
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip *.node target: armv7-linux-androideabi
# - host: ubuntu-latest build: yarn build --target armv7-linux-androideabi
# 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
- host: ubuntu-latest - host: ubuntu-latest
target: aarch64-unknown-linux-musl target: aarch64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
@@ -105,7 +93,7 @@ jobs:
toolchain: stable toolchain: stable
targets: ${{ matrix.settings.target }} targets: ${{ matrix.settings.target }}
- name: Cache cargo - name: Cache cargo
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: | path: |
~/.cargo/registry/index/ ~/.cargo/registry/index/
@@ -117,7 +105,7 @@ jobs:
- uses: goto-bus-stop/setup-zig@v2 - uses: goto-bus-stop/setup-zig@v2
if: ${{ matrix.settings.target == 'armv7-unknown-linux-gnueabihf' }} if: ${{ matrix.settings.target == 'armv7-unknown-linux-gnueabihf' }}
with: with:
version: 0.10.1 version: 0.12.0
- name: Setup toolchain - name: Setup toolchain
run: ${{ matrix.settings.setup }} run: ${{ matrix.settings.setup }}
if: ${{ matrix.settings.setup }} if: ${{ matrix.settings.setup }}
@@ -147,46 +135,42 @@ jobs:
if: ${{ !matrix.settings.docker }} if: ${{ !matrix.settings.docker }}
shell: bash shell: bash
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: bindings-${{ matrix.settings.target }} name: bindings-${{ matrix.settings.target }}
path: ${{ env.APP_NAME }}.*.node path: ${{ env.APP_NAME }}.*.node
if-no-files-found: error if-no-files-found: error
build-freebsd: build-freebsd:
runs-on: macos-12 runs-on: macos-13
name: Build FreeBSD name: Build FreeBSD
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with:
submodules: true
- name: Build - name: Build
id: build id: build
uses: vmactions/freebsd-vm@v0 uses: cross-platform-actions/[email protected].0
env: env:
DEBUG: napi:* DEBUG: napi:*
RUSTUP_HOME: /usr/local/rustup
CARGO_HOME: /usr/local/cargo
RUSTUP_IO_THREADS: 1 RUSTUP_IO_THREADS: 1
with: with:
envs: DEBUG RUSTUP_HOME CARGO_HOME RUSTUP_IO_THREADS operating_system: freebsd
usesh: true version: '13.2'
mem: 3000 memory: 8G
prepare: | cpu_count: 3
pkg install -y -f curl node libnghttp2 llvm cmake # Install the llvm package to fix the libclang error environment_variables: 'DEBUG RUSTUP_IO_THREADS'
curl -qL https://www.npmjs.com/install.sh | sh shell: bash
npm install --location=global --ignore-scripts yarn 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 curl https://sh.rustup.rs -sSf --output rustup.sh
sh rustup.sh -y --profile minimal --default-toolchain beta sh rustup.sh -y --profile minimal --default-toolchain beta
rustup component add rustfmt rustup component add rustfmt
export PATH="/usr/local/cargo/bin:$PATH" source "$HOME/.cargo/env"
echo "~~~~ rustc --version ~~~~" echo "~~~~ rustc --version ~~~~"
rustc --version rustc --version
echo "~~~~ node -v ~~~~" echo "~~~~ node -v ~~~~"
node -v node -v
echo "~~~~ yarn --version ~~~~" echo "~~~~ yarn --version ~~~~"
yarn --version yarn --version
run: |
export PATH="/usr/local/cargo/bin:$PATH"
pwd pwd
ls -lah ls -lah
whoami whoami
@@ -194,13 +178,12 @@ jobs:
freebsd-version freebsd-version
yarn install yarn install
yarn build yarn build
strip -x *.node
yarn test yarn test
rm -rf node_modules rm -rf node_modules
rm -rf target rm -rf target
rm -rf .yarn/cache rm -rf .yarn/cache
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: bindings-freebsd name: bindings-freebsd
path: ${{ env.APP_NAME }}.*.node path: ${{ env.APP_NAME }}.*.node
@@ -235,6 +218,7 @@ jobs:
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
cache: yarn cache: yarn
architecture: ${{ matrix.settings.architecture }}
- name: Install dependencies - name: Install dependencies
run: yarn install run: yarn install
- name: Download artifacts - name: Download artifacts
@@ -485,6 +469,7 @@ jobs:
shell: bash shell: bash
- name: Publish - name: Publish
run: | run: |
npm config set provenance true
if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$"; if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$";
then then
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc