Skip to content

Commit

Permalink
[ci] Deploy a universal binary to support Apple M1
Browse files Browse the repository at this point in the history
  • Loading branch information
lpinca committed Sep 26, 2021
1 parent c81c7da commit 45439cc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
- 14
- 16
os:
- macOS-latest
- macos-11
- ubuntu-18.04
- windows-latest
exclude:
- arch: x86
os: macOS-latest
os: macos-11
- arch: x86
os: ubuntu-18.04
steps:
Expand All @@ -34,7 +34,13 @@ jobs:
- run: npm install
- run: npm test
- run: npm run prebuild
if: matrix.node == 14 && startsWith(github.ref, 'refs/tags/')
if:
matrix.node == 14 && matrix.os != 'macos-11' && startsWith(github.ref,
'refs/tags/')
- run: npm run prebuild-darwin-x64+arm64
if:
matrix.node == 14 && matrix.os == 'macos-11' && startsWith(github.ref,
'refs/tags/')
- run: npm run prebuild-linux-arm
if:
matrix.node == 14 && matrix.os == 'ubuntu-18.04' &&
Expand All @@ -57,8 +63,8 @@ jobs:
- run: echo ::set-output name=version::$(git describe --tags)
id: get_version
- run:
tar -cvf "${{ steps.get_version.outputs.version }}-darwin-x64.tar" -C
"prebuilds/macOS-latest" .
tar -cvf "${{ steps.get_version.outputs.version
}}-darwin-x64+arm64.tar" -C "prebuilds/macos-11" .
- run:
tar -cvf "${{ steps.get_version.outputs.version }}-linux-arm.tar" -C
"prebuilds/ubuntu-18.04" linux-arm
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"scripts": {
"install": "node-gyp-build",
"prebuild": "prebuildify --napi --strip",
"prebuild-darwin-x64+arm64": "prebuildify --arch x64+arm64 --napi --strip",
"prebuild-linux-arm": "prebuildify-cross -i linux-armv6 -i linux-armv7 -i linux-arm64 --napi --strip",
"test": "mocha"
},
Expand Down

0 comments on commit 45439cc

Please sign in to comment.