Skip to content

Commit 7982fc2

Browse files
committed
chore: update macOS build process and configuration
- Modified GitHub Actions workflow to support multiple macOS architectures (aarch64 and x86_64). - Enhanced Tauri build script to accommodate new signing identity handling. - Updated tauri.conf.json to include macOS entitlements and minimum system version requirements. - Adjusted TypeScript environment imports for consistency.
1 parent 4c255ff commit 7982fc2

4 files changed

Lines changed: 40 additions & 15 deletions

File tree

.github/workflows/release.yml

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ jobs:
7070
7171
build-macos:
7272
runs-on: macos-latest
73+
strategy:
74+
matrix:
75+
include:
76+
- target: aarch64-apple-darwin
77+
arch: aarch64
78+
- target: x86_64-apple-darwin
79+
arch: x86_64
7380
steps:
7481
- uses: actions/checkout@v4
7582
with:
@@ -85,6 +92,8 @@ jobs:
8592
cache: 'pnpm'
8693

8794
- uses: dtolnay/rust-toolchain@stable
95+
with:
96+
targets: ${{ matrix.target }}
8897

8998
- uses: Swatinem/rust-cache@v2
9099
with:
@@ -99,28 +108,40 @@ jobs:
99108
- name: Verify version sync
100109
run: node scripts/sync-versions.mjs --check
101110

102-
- name: Build Tauri (macOS)
103-
run: cargo-tauri build --bundles dmg
104-
env:
105-
CI: true
106-
107-
- name: Sign and notarize (if credentials available)
111+
- name: Import Apple Developer Certificate
108112
if: env.APPLE_CERTIFICATE != ''
109113
env:
110114
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
111115
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
116+
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
117+
run: |
118+
echo "$APPLE_CERTIFICATE" | base64 --decode > certificate.p12
119+
security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
120+
security default-keychain -s build.keychain
121+
security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
122+
security set-keychain-settings -t 3600 -u build.keychain
123+
security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
124+
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain
125+
IDENTITY=$(security find-identity -v -p codesigning build.keychain | head -1 | awk -F'"' '{print $2}')
126+
echo "APPLE_SIGNING_IDENTITY=$IDENTITY" >> "$GITHUB_ENV"
127+
echo "Certificate imported: $IDENTITY"
128+
rm certificate.p12
129+
130+
- name: Build Tauri (macOS ${{ matrix.arch }})
131+
run: cargo-tauri build --target ${{ matrix.target }} --bundles dmg
132+
env:
133+
CI: true
134+
APPLE_SIGNING_IDENTITY: ${{ env.APPLE_SIGNING_IDENTITY || '-' }}
112135
APPLE_ID: ${{ secrets.APPLE_ID }}
136+
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
113137
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
114-
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
115-
run: |
116-
echo "Signing credentials found — signing will be handled by Tauri bundle config"
117138

118139
- name: Upload macOS artifacts
119140
uses: actions/upload-artifact@v4
120141
with:
121-
name: macos-builds
142+
name: macos-builds-${{ matrix.arch }}
122143
path: |
123-
src-tauri/target/release/bundle/dmg/*.dmg
144+
src-tauri/target/${{ matrix.target }}/release/bundle/dmg/*.dmg
124145
125146
build-windows:
126147
runs-on: windows-latest

next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
import "./.next/dev/types/routes.d.ts";
3+
import "./.next/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

scripts/sign-and-deploy.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@ if [ "$SKIP_BUILD" = false ]; then
150150
rustup target add aarch64-apple-darwin 2>/dev/null || true
151151

152152
APPLE_SIGNING_IDENTITY="$APPLE_SIGNING_IDENTITY" \
153-
APPLE_ID="$APPLE_ID" \
153+
APPLE_ID="${APPLE_ID:-}" \
154154
APPLE_TEAM_ID="$APPLE_TEAM_ID" \
155-
APPLE_APP_SPECIFIC_PASSWORD="$APPLE_APP_SPECIFIC_PASSWORD" \
156-
pnpm tauri build --target aarch64-apple-darwin
155+
APPLE_PASSWORD="${APPLE_APP_SPECIFIC_PASSWORD:-}" \
156+
npx @tauri-apps/cli build --target aarch64-apple-darwin
157157

158158
ok "Tauri build complete"
159159
else

src-tauri/tauri.conf.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
"icons/icon.icns",
4040
"icons/icon.ico"
4141
],
42+
"macOS": {
43+
"entitlements": "Entitlements.plist",
44+
"minimumSystemVersion": "10.15"
45+
},
4246
"iOS": {
4347
"minimumSystemVersion": "17.0",
4448
"infoPlist": "Info.ios.plist",

0 commit comments

Comments
 (0)