Skip to content

winmac

winmac #6

Workflow file for this run

name: winmac
on:
workflow_dispatch:
env:
FORCE_COLOR: 1
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- windows-latest
host:
- x64
target:
- x64
node:
- 24
include:
- os: windows-latest
node: 24
host: x86
target: x86
- os: macos-latest
node: 24
host: arm64
target: arm64
name: ${{ matrix.os }} (node=${{ matrix.node }}, host=${{ matrix.host }}, target=${{ matrix.target }})
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
architecture: ${{ matrix.host }}
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v3
if: contains(matrix.os, 'windows')
with:
msbuild-architecture: ${{ matrix.target }}
- name: Add env vars
shell: bash
run: |
echo "V=1" >> $GITHUB_ENV
if [ "${{ matrix.target }}" = "x86" ]; then
echo "TARGET=ia32" >> $GITHUB_ENV
else
echo "TARGET=${{ matrix.target }}" >> $GITHUB_ENV
fi
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Print build toolchain
run: npx node-gyp --version
- name: Configure build
run: node node_modules/@mapbox/node-pre-gyp/bin/node-pre-gyp configure --target_arch=${{ env.TARGET }}
- name: Build binaries
run: node node_modules/@mapbox/node-pre-gyp/bin/node-pre-gyp build --target_arch=${{ env.TARGET }}
- name: Package prebuilt binaries
run: node node_modules/@mapbox/node-pre-gyp/bin/node-pre-gyp package --target_arch=${{ env.TARGET }}
- name: Upload binaries to commit artifacts
uses: actions/upload-artifact@v7
if: matrix.node == 24
with:
name: prebuilt-binaries-${{ matrix.os }}-${{ matrix.target }}
path: build/stage/*/*
retention-days: 7
- name: Upload binaries to GitHub Release
run: npx node-pre-gyp-github publish
if: matrix.node == 24
env:
NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.API_TOKEN }}