Build - Mac M1 #2
This file contains hidden or 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 - Mac M1 | |
on: | |
workflow_dispatch: | |
# push: | |
# tags: | |
# - v* | |
permissions: | |
contents: write | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
jobs: | |
build-macos: | |
runs-on: macos-13 | |
strategy: | |
matrix: | |
node-version: [18] | |
steps: | |
- name: Fail if branch is not master | |
if: github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/master' | |
run: | | |
echo "This workflow should not be triggered with workflow_dispatch on a branch other than master" | |
exit 1 | |
- uses: actions/checkout@v4 | |
- name: Install OpenSSL | |
run: | | |
wget https://mac.r-project.org/bin/darwin20/arm64/openssl-1.1.1t-darwin.20-arm64.tar.xz | |
tar -xf openssl-1.1.1t-darwin.20-arm64.tar.xz -C /tmp | |
rm -rf openssl-1.1.1t-darwin.20-arm64.tar.xz | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Build | |
run: | | |
npm install --ignore-scripts | |
node_modules/.bin/prebuild -r napi --backend cmake-js --arch arm64 --upload -u ${{ secrets.GITHUB_TOKEN }} -- --CDCMAKE_OSX_ARCHITECTURES="arm64" | |
env: | |
CI: true | |
OPENSSL_ROOT_DIR: /tmp/opt/R/arm64 | |
OPENSSL_LIBRARIES: /tmp/opt/R/arm64/lib |