Build #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: workflow_dispatch | |
env: | |
DEBUG: 'napi:*' | |
MACOSX_DEPLOYMENT_TARGET: '10.13' | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- name: Check formatting | |
run: cargo fmt --all --check | |
- name: Clippy | |
run: cargo clippy | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
targets: x86_64-pc-windows-msvc, x86_64-unknown-linux-gnu | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo install cargo-xwin | |
- name: Node install | |
run: npm ci | |
- name: Build Linux | |
run: npm run build -- --target x86_64-unknown-linux-gnu | |
- name: Build Windows | |
run: npm run build -- --target x86_64-pc-windows-msvc | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Windows-Linux binaries | |
path: dist | |
if-no-files-found: error | |
build-mac: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
targets: x86_64-apple-darwin, aarch64-apple-darwin | |
- uses: Swatinem/rust-cache@v2 | |
- name: Node install | |
run: npm ci | |
- name: Build Mac x64 | |
run: npm run build -- --target x86_64-apple-darwin | |
- name: Build Mac arm64 | |
run: npm run build -- --target aarch64-apple-darwin | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macOS binaries | |
path: dist | |
if-no-files-found: error |