Skip to content

Commit a77fd3e

Browse files
committed
ci: fix macOS Intel build by using macos-13 runner
The x86_64-apple-darwin build was failing because macos-latest now resolves to ARM64 runners which can't natively build x86_64 Tauri apps. Switch to macos-13 (last Intel runner) and add explicit --target flag. Also add a test workflow to validate all release builds. Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
1 parent 8120d55 commit a77fd3e

2 files changed

Lines changed: 128 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
- os: macos-latest
8989
target: aarch64-apple-darwin
9090
artifact: macos-arm
91-
- os: macos-latest
91+
- os: macos-13
9292
target: x86_64-apple-darwin
9393
artifact: macos-intel
9494

@@ -129,7 +129,7 @@ jobs:
129129
# strings as present (Some("")), so we must completely omit the env var.
130130
# Instead we import the cert here and only pass APPLE_SIGNING_IDENTITY.
131131
- name: Import Apple certificate
132-
if: matrix.os == 'macos-latest' || matrix.os == 'macos-15'
132+
if: runner.os == 'macOS'
133133
id: apple-cert
134134
env:
135135
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
@@ -182,6 +182,7 @@ jobs:
182182
# Upload to the existing draft release
183183
releaseId: ${{ needs.release-please.outputs.release_id }}
184184
updaterJsonKeepUniversal: true
185+
args: --target ${{ matrix.target }}
185186

186187
# ─────────────────────────────────────────────────────────────
187188
# Publish Release: Flip draft → published after all artifacts
@@ -289,7 +290,7 @@ jobs:
289290
SHA_ARM64=$(shasum -a 256 arm64.dmg | cut -d' ' -f1)
290291
echo "ARM64 SHA256: $SHA_ARM64"
291292
292-
# x64 DMG is optional (macos-latest runs on ARM; cross-compiled targets don't produce DMGs)
293+
# x64 DMG (built on macos-13 Intel runner)
293294
HAS_X64=false
294295
if curl -fSL "${BASE_URL}/McpMux_${VERSION}_x64.dmg" -o x64.dmg 2>/dev/null; then
295296
SHA_X64=$(shasum -a 256 x64.dmg | cut -d' ' -f1)
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: Test Release Builds
2+
3+
on:
4+
workflow_dispatch:
5+
6+
env:
7+
CARGO_TERM_COLOR: always
8+
9+
jobs:
10+
build:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
include:
15+
- os: ubuntu-latest
16+
target: x86_64-unknown-linux-gnu
17+
artifact: linux
18+
- os: windows-latest
19+
target: x86_64-pc-windows-msvc
20+
artifact: windows
21+
- os: macos-latest
22+
target: aarch64-apple-darwin
23+
artifact: macos-arm
24+
- os: macos-13
25+
target: x86_64-apple-darwin
26+
artifact: macos-intel
27+
28+
runs-on: ${{ matrix.os }}
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Install Linux deps
33+
if: matrix.os == 'ubuntu-latest'
34+
uses: ./.github/actions/install-linux-deps
35+
with:
36+
verify_glib: 'false'
37+
38+
- uses: dtolnay/rust-toolchain@stable
39+
with:
40+
targets: ${{ matrix.target }}
41+
env:
42+
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
43+
44+
- uses: Swatinem/rust-cache@v2
45+
with:
46+
key: ${{ matrix.target }}-test-release
47+
env:
48+
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
49+
50+
- uses: pnpm/action-setup@v4
51+
- uses: actions/setup-node@v4
52+
with:
53+
node-version: 20
54+
cache: 'pnpm'
55+
56+
- run: pnpm install --frozen-lockfile
57+
58+
- name: Import Apple certificate
59+
if: runner.os == 'macOS'
60+
id: apple-cert
61+
env:
62+
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
63+
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
64+
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
65+
run: |
66+
if [ -z "$APPLE_CERTIFICATE" ] || [ -z "$KEYCHAIN_PASSWORD" ]; then
67+
echo "No Apple certificate configured — using ad-hoc signing"
68+
echo "identity=-" >> "$GITHUB_OUTPUT"
69+
exit 0
70+
fi
71+
echo "$APPLE_CERTIFICATE" | base64 --decode > certificate.p12
72+
if [ ! -s certificate.p12 ]; then
73+
echo "Certificate decode produced empty file — using ad-hoc signing"
74+
rm -f certificate.p12
75+
echo "identity=-" >> "$GITHUB_OUTPUT"
76+
exit 0
77+
fi
78+
security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
79+
security default-keychain -s build.keychain
80+
security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
81+
if ! security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign; then
82+
echo "Certificate import failed — using ad-hoc signing"
83+
rm -f certificate.p12
84+
echo "identity=-" >> "$GITHUB_OUTPUT"
85+
exit 0
86+
fi
87+
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain
88+
rm certificate.p12
89+
echo "identity=${{ secrets.APPLE_SIGNING_IDENTITY }}" >> "$GITHUB_OUTPUT"
90+
91+
# Same as release but without releaseId (no upload to GitHub release)
92+
- name: Build Tauri app
93+
uses: tauri-apps/tauri-action@v0
94+
env:
95+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96+
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
97+
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
98+
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
99+
APPLE_SIGNING_IDENTITY: ${{ steps.apple-cert.outputs.identity }}
100+
with:
101+
projectPath: apps/desktop
102+
args: --target ${{ matrix.target }}
103+
104+
- name: List build artifacts
105+
shell: bash
106+
run: |
107+
echo "=== Target: ${{ matrix.target }} ==="
108+
echo "=== Runner arch: $(uname -m) ==="
109+
echo ""
110+
echo "=== Bundle output ==="
111+
find target/${{ matrix.target }}/release/bundle -type f 2>/dev/null | head -30 || echo "No bundle directory found"
112+
113+
- name: Upload artifacts
114+
uses: actions/upload-artifact@v4
115+
with:
116+
name: build-${{ matrix.artifact }}
117+
path: |
118+
target/${{ matrix.target }}/release/bundle/dmg/*.dmg
119+
target/${{ matrix.target }}/release/bundle/deb/*.deb
120+
target/${{ matrix.target }}/release/bundle/rpm/*.rpm
121+
target/${{ matrix.target }}/release/bundle/appimage/*.AppImage
122+
target/${{ matrix.target }}/release/bundle/nsis/*.exe
123+
target/${{ matrix.target }}/release/bundle/msi/*.msi
124+
if-no-files-found: warn

0 commit comments

Comments
 (0)