Skip to content

Commit 849d8c6

Browse files
committed
fix(ci): split macos build into separate x64 and arm64 jobs
Split the macOS build workflow into two separate matrix jobs: - x64 builds on macos-15 (Intel runner) - arm64 builds on macos-14 (Apple Silicon runner) This fixes the x64 macOS build which was failing because the ARM64 sqlite3 native module was being copied to both builds when building on a single ARM64 runner. Each architecture now builds on its native runner, ensuring the correct native modules are compiled/downloaded for each target. MAS (Mac App Store) universal builds are only built on the arm64 runner. Artifacts are now uploaded separately per architecture: - macos-builds-x64 - macos-builds-arm64
1 parent 7001541 commit 849d8c6

File tree

1 file changed

+34
-15
lines changed

1 file changed

+34
-15
lines changed

.github/workflows/pipeline-build-macos.yml

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,17 @@ on:
2525

2626
jobs:
2727
build:
28-
name: Build macos
29-
runs-on: macos-14
28+
name: Build macos (${{ matrix.arch }})
29+
runs-on: ${{ matrix.runner }}
3030
environment: ${{ inputs.environment }}
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
include:
35+
- arch: x64
36+
runner: macos-15
37+
- arch: arm64
38+
runner: macos-14
3139
steps:
3240
- uses: actions/checkout@v4
3341

@@ -62,9 +70,16 @@ jobs:
6270
run: |
6371
unset CSC_LINK
6472
65-
yarn package:prod
66-
yarn package:mas
73+
yarn package:prod --mac --${{ matrix.arch }}
6774
rm -rf release/mac
75+
76+
# Build MAS only on arm64 runner (universal build)
77+
- name: Build macos MAS (prod)
78+
if: vars.ENV == 'production' && inputs.target == vars.ALL && matrix.arch == 'arm64'
79+
run: |
80+
unset CSC_LINK
81+
82+
yarn package:mas
6883
mv release/mas-universal/Redis-Insight-mac-universal-mas.pkg release/Redis-Insight-mac-universal-mas.pkg
6984
7085
- name: Build macos dmg (staging)
@@ -75,9 +90,16 @@ jobs:
7590
echo $APP_BUNDLE_VERSION
7691
echo $CSC_KEYCHAIN
7792
78-
yarn package:stage && yarn package:mas
93+
yarn package:stage --mac --${{ matrix.arch }}
7994
rm -rf release/mac
8095
96+
# Build MAS only on arm64 runner (universal build)
97+
- name: Build macos MAS (staging)
98+
if: (vars.ENV == 'staging' || vars.ENV == 'development') && inputs.target == vars.ALL && matrix.arch == 'arm64'
99+
run: |
100+
unset CSC_LINK
101+
102+
yarn package:mas
81103
mv release/mas-universal/Redis-Insight-mac-universal-mas.pkg release/Redis-Insight-mac-universal-mas.pkg
82104
83105
# handle manual builds
@@ -88,29 +110,26 @@ jobs:
88110
target=$(echo "${{inputs.target}}" | grep -oE 'build_macos_[^ ]+' | sed 's/build_macos_/dmg:/' | paste -sd ' ' -)
89111
90112
if [ "${{ vars.ENV == 'production' }}" == "true" ]; then
91-
yarn package:prod --mac $target
113+
yarn package:prod --mac $target --${{ matrix.arch }}
92114
else
93-
yarn package:stage --mac $target
115+
yarn package:stage --mac $target --${{ matrix.arch }}
94116
fi
95117
96118
rm -rf release/mac
97119
98120
- name: Repack dmg to tar
99121
if: vars.ENV == 'production' && inputs.target == vars.ALL
100122
run: |
101-
ARCH=x64 ./.github/redisstack/dmg.repack.sh
102-
ARCH=arm64 ./.github/redisstack/dmg.repack.sh
123+
ARCH=${{ matrix.arch }} ./.github/redisstack/dmg.repack.sh
103124
104125
- name: Upload macos packages
105126
uses: actions/upload-artifact@v4
106127
with:
107-
name: macos-builds
128+
name: macos-builds-${{ matrix.arch }}
108129
path: |
109-
./release/Redis-Insight*x64.dmg
110-
./release/Redis-Insight*x64.dmg.blockmap
111-
./release/Redis-Insight*.zip
112-
./release/Redis-Insight*arm64.dmg
113-
./release/Redis-Insight*arm64.dmg.blockmap
130+
./release/Redis-Insight*${{ matrix.arch }}.dmg
131+
./release/Redis-Insight*${{ matrix.arch }}.dmg.blockmap
132+
./release/Redis-Insight*${{ matrix.arch }}.zip
114133
./release/Redis-Insight*.pkg
115134
./release/*-mac.yml
116135
./release/redisstack

0 commit comments

Comments
 (0)