Skip to content

Build Node binaries for macOS #1

Build Node binaries for macOS

Build Node binaries for macOS #1

Workflow file for this run

name: Build Node binaries for macOS
on:
workflow_dispatch:
workflow_call:
jobs:
macos-x64:
runs-on: macos-11.0
strategy:
fail-fast: false
matrix:
target-node: [14, 16, 18, 20]
steps:
- uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
- run: yarn install --ignore-engines
- run: yarn start --node-range node${{ matrix.target-node }} --output dist
- name: Check if binary is compiled, skip if download only
id: check_file
run: |
ls -l dist
(test -f dist/*.sha256sum && echo "EXISTS=true" >> $GITHUB_OUTPUT) || echo "EXISTS=false" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v3
if: steps.check_file.outputs.EXISTS == 'true'
with:
name: node${{ matrix.target-node }}-macos-x64
path: dist/*
macos-arm64:
runs-on: macos-11.0
strategy:
fail-fast: false
matrix:
target-node: [14, 16, 18, 20]
steps:
- uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest
- name: Use Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
- run: yarn install --ignore-engines
- run: yarn start --node-range node${{ matrix.target-node }} --arch arm64 --output dist
env:
CC: clang -arch arm64
CXX: clang++ -arch arm64
CC_host: clang
CXX_host: clang++
- name: Check if binary is compiled
id: check_file
run: |
(test -f dist/*.sha256sum && echo "EXISTS=true" >> $GITHUB_OUTPUT) || echo "EXISTS=false" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v4
if: steps.check_file.outputs.EXISTS == 'true'
with:
name: node${{ matrix.target-node }}-macos-arm64
path: dist/*