Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS arm64 build #8

Merged
merged 6 commits into from
Oct 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,38 @@ jobs:
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, 19]

steps:
- uses: actions/checkout@v2

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest

- name: Use Node.js 14
uses: actions/setup-node@v1
with:
node-version: 14
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use matrix.target-node

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's only the node version that is used for running the build script and doesn't matter as long as its new enough to run it. No need to vary it per target-node.

Copy link
Member

@robertsLando robertsLando Oct 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least use 18/20 as it's the currently lts

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Probably should update this for all the jobs.


- run: yarn install --ignore-engines

- run: yarn start --node-range node${{ matrix.target-node }} --arch arm64 --output dist

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this work? Is it actually compiling the node binary?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's what the scripts in this package do. As far as I remember.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that script coming from the https://github.com/actions/setup-node/tree/main/src. I'm not super familiar with GitHub Actions, where can I find the source for what the actual script is?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g. https://github.com/yao-pkg/pkg-fetch/blob/main/lib/build.ts, with the actual entry point defined in package.json.

This entire repo is essentially a script/package to build and fetch patched node binaries suitable for pkg.


- name: Check if binary is compiled
id: check_file
run: |
(test -f dist/*.sha256sum && echo ::set-output name=EXISTS::true) || echo ::set-output name=EXISTS::false

- uses: actions/upload-artifact@v2
if: steps.check_file.outputs.EXISTS == 'true'
with:
name: node${{ matrix.target-node }}-macos-arm64
path: dist/*