Skip to content

Commit 04081d8

Browse files
committed
ci(mac): add step to build and release macos arm64 binary
1 parent 0e207e8 commit 04081d8

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

.github/workflows/build-cli.yml

+13-12
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,14 @@ jobs:
6161
6262
6363
cli:
64-
name: "${{ matrix.os.base }} - ${{ matrix.license_type.readable }}"
64+
name: "${{ matrix.os.base }}${{ matrix.os.target_suffix }} - ${{ matrix.license_type.readable }}"
6565
strategy:
6666
matrix:
6767
os:
6868
[
69-
{ base: "linux", distro: "ubuntu-22.04" },
70-
{ base: "mac", distro: "macos-13" }
69+
{ base: "linux", distro: "ubuntu-22.04", target_suffix: "" },
70+
{ base: "mac", distro: "macos-13", target_suffix: "" },
71+
{ base: "mac", distro: "macos-14", target_suffix: "-arm64" }
7172
]
7273
license_type:
7374
[
@@ -108,12 +109,12 @@ jobs:
108109

109110
- name: Zip Unix
110111
run: |
111-
cd ./dist/${{ matrix.license_type.build_prefix }}/${{ env.LOWER_RUNNER_OS }}
112-
zip ../../bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-${{ env._PACKAGE_VERSION }}.zip ./bw
112+
cd ./dist/${{ matrix.license_type.build_prefix }}/${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}
113+
zip ../../bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-${{ env._PACKAGE_VERSION }}.zip ./bw
113114
114115
- name: Version Test
115116
run: |
116-
unzip "./dist/bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-${{ env._PACKAGE_VERSION }}.zip" -d "./test"
117+
unzip "./dist/bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-${{ env._PACKAGE_VERSION }}.zip" -d "./test"
117118
testVersion=$(./test/bw -v)
118119
echo "version: $_PACKAGE_VERSION"
119120
echo "testVersion: $testVersion"
@@ -125,22 +126,22 @@ jobs:
125126
- name: Create checksums Unix
126127
run: |
127128
cd ./dist
128-
shasum -a 256 bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-${{ env._PACKAGE_VERSION }}.zip \
129+
shasum -a 256 bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-${{ env._PACKAGE_VERSION }}.zip \
129130
| awk '{split($0, a); print a[1]}' > bw${{
130-
matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-sha256-${{ env._PACKAGE_VERSION }}.txt
131+
matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-sha256-${{ env._PACKAGE_VERSION }}.txt
131132
132133
- name: Upload unix zip asset
133134
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
134135
with:
135-
name: bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-${{ env._PACKAGE_VERSION }}.zip
136-
path: apps/cli/dist/bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-${{ env._PACKAGE_VERSION }}.zip
136+
name: bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-${{ env._PACKAGE_VERSION }}.zip
137+
path: apps/cli/dist/bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-${{ env._PACKAGE_VERSION }}.zip
137138
if-no-files-found: error
138139

139140
- name: Upload unix checksum asset
140141
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
141142
with:
142-
name: bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-sha256-${{ env._PACKAGE_VERSION }}.txt
143-
path: apps/cli/dist/bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}-sha256-${{ env._PACKAGE_VERSION }}.txt
143+
name: bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-sha256-${{ env._PACKAGE_VERSION }}.txt
144+
path: apps/cli/dist/bw${{ matrix.license_type.artifact_prefix }}-${{ env.LOWER_RUNNER_OS }}${{ matrix.os.target_suffix }}-sha256-${{ env._PACKAGE_VERSION }}.txt
144145
if-no-files-found: error
145146

146147
cli-windows:

apps/cli/package.json

+4
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,19 @@
3232
"build:bit:prod:watch": "cross-env NODE_ENV=production npm run build:bit:watch",
3333
"dist:oss:win": "npm run build:oss:prod && npm run clean && npm run package:oss:win",
3434
"dist:oss:mac": "npm run build:oss:prod && npm run clean && npm run package:oss:mac",
35+
"dist:oss:mac-arm64": "npm run build:oss:prod && npm run clean && npm run package:oss:mac-arm64",
3536
"dist:oss:lin": "npm run build:oss:prod && npm run clean && npm run package:oss:lin",
3637
"dist:bit:win": "npm run build:bit:prod && npm run clean && npm run package:bit:win",
3738
"dist:bit:mac": "npm run build:bit:prod && npm run clean && npm run package:bit:mac",
39+
"dist:bit:mac-arm64": "npm run build:bit:prod && npm run clean && npm run package:bit:mac-arm64",
3840
"dist:bit:lin": "npm run build:bit:prod && npm run clean && npm run package:bit:lin",
3941
"package:oss:win": "pkg . --targets win-x64 --output ./dist/oss/windows/bw.exe",
4042
"package:oss:mac": "pkg . --targets macos-x64 --output ./dist/oss/macos/bw",
43+
"package:oss:mac-arm64": "pkg . --targets macos-arm64 --output ./dist/oss/macos-arm64/bw",
4144
"package:oss:lin": "pkg . --targets linux-x64 --output ./dist/oss/linux/bw",
4245
"package:bit:win": "pkg . --targets win-x64 --output ./dist/bit/windows/bw.exe",
4346
"package:bit:mac": "pkg . --targets macos-x64 --output ./dist/bit/macos/bw",
47+
"package:bit:mac-arm64": "pkg . --targets macos-arm64 --output ./dist/bit/macos-arm64/bw",
4448
"package:bit:lin": "pkg . --targets linux-x64 --output ./dist/bit/linux/bw",
4549
"test": "jest",
4650
"test:watch": "jest --watch",

0 commit comments

Comments
 (0)