Skip to content

Commit 08e2db0

Browse files
committed
CI:macOS 和 iOS 都用 Xcode 27.2 编译,和开发时一致
上一个提交把 iOS 换到了 macos-26(Xcode 26.6),但那次运行 iOS 一直在排队、没有编译;开发用的是 Xcode 27.2, 桌面版还在 macos-15 的 Xcode 16.4(macOS 15.5 SDK)上编译,发布的包和本机测过的不是同一套工具链。 - release.yml:macOS 两个 job 和 iOS 都改用 xcode-27 机器(Xcode 27 的正式版镜像,2026-10-15 起,macOS 27, 只有 Apple 芯片),开头的 XCODE_VERSION 选 27.2(镜像默认 27.1),每个 job 先 xcode-select 并打印版本 - macOS Intel 版没有 Intel 机器可用(Xcode 27 不能在 Intel Mac 上运行),改为在 Apple 芯片上交叉编译: tauri build --target x86_64-apple-darwin。Xcode 27 的 SDK 仍然能编 x86_64(部署目标低于 macOS 27 即可, 这里是 13);opus 由 cmake-rs 编,它按目标设 CMAKE_OSX_ARCHITECTURES。两个架构都带 --target,产物在 target/<目标>/release/bundle/dmg - docs/ios.md、ios.zh-CN.md:构建要求改为 Xcode 27 或更新(只能装在 Apple 芯片、macOS 26.6 或更新的 Mac 上), 装好的应用仍然支持 iOS 17 及以上 actionlint 只是还不认识 xcode-27 这个机器名,把它加进标签列表后检查通过;交叉编译的 Intel 版还没在 CI 上跑过。
1 parent 040a27a commit 08e2db0

3 files changed

Lines changed: 24 additions & 12 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ env:
4646
AIRHAND_SERVER: ${{ vars.AIRHAND_SERVER }}
4747
AIRHAND_SERVER_FP: ${{ vars.AIRHAND_SERVER_FP }}
4848
CARGO_TERM_COLOR: always
49+
# macOS / iOS 用的 Xcode(xcode-27 机器上装着的版本之一),和开发时用的一致
50+
XCODE_VERSION: "27.2"
4951

5052
defaults:
5153
run:
@@ -216,23 +218,32 @@ jobs:
216218
matrix:
217219
include:
218220
- arch: arm64
219-
runner: macos-15
221+
target: aarch64-apple-darwin
220222
- arch: x64
221-
runner: macos-15-intel
222-
runs-on: ${{ matrix.runner }}
223+
target: x86_64-apple-darwin
224+
# Xcode 27 只有 Apple 芯片的机器:Intel 版在上面交叉编译。Xcode 27 的 SDK 仍然能编 x86_64(部署目标低于
225+
# macOS 27 即可,这里是 13);C 依赖由 cc / cmake 按 --target 编(cmake-rs 会设 CMAKE_OSX_ARCHITECTURES)
226+
runs-on: xcode-27
223227
timeout-minutes: 90
224228
env:
225229
VERSION: ${{ needs.prepare.outputs.version }}
226230
steps:
227231
- uses: actions/checkout@v6
228232

233+
- name: Select Xcode
234+
run: |
235+
sudo xcode-select -s "/Applications/Xcode_${XCODE_VERSION}.app"
236+
xcodebuild -version
237+
229238
- uses: actions/setup-node@v6
230239
with:
231240
node-version: 24
232241
cache: npm
233242
cache-dependency-path: client/package-lock.json
234243

235244
- uses: dtolnay/rust-toolchain@stable
245+
with:
246+
targets: ${{ matrix.target }}
236247

237248
- name: Set version
238249
run: node .github/scripts/set-version.mjs "$VERSION"
@@ -242,12 +253,12 @@ jobs:
242253
working-directory: client
243254
run: |
244255
npm ci --no-audit --no-fund
245-
npx tauri build
256+
npx tauri build --target ${{ matrix.target }}
246257
247258
- name: Collect
248259
run: |
249260
mkdir -p dist
250-
cp client/src-tauri/target/release/bundle/dmg/*.dmg "dist/Airhand_${VERSION}_macos-${{ matrix.arch }}.dmg"
261+
cp client/src-tauri/target/${{ matrix.target }}/release/bundle/dmg/*.dmg "dist/Airhand_${VERSION}_macos-${{ matrix.arch }}.dmg"
251262
ls -l dist
252263
253264
- uses: actions/upload-artifact@v7
@@ -325,17 +336,18 @@ jobs:
325336
ios:
326337
name: iOS
327338
needs: prepare
328-
# 要 Xcode 26 或更新(代码用到了 iOS 26 SDK 的接口,如 allowBluetoothHFP):macos-15 默认是 Xcode 16.4,
329-
# macos-26 默认是 Xcode 26
330-
runs-on: macos-26
339+
# 代码用到了新 SDK 的接口(如 allowBluetoothHFP),macos-15 默认的 Xcode 16.4 编不过;和开发时一样用 Xcode 27
340+
runs-on: xcode-27
331341
timeout-minutes: 60
332342
env:
333343
VERSION: ${{ needs.prepare.outputs.version }}
334344
steps:
335345
- uses: actions/checkout@v6
336346

337-
- name: Xcode version
338-
run: xcodebuild -version
347+
- name: Select Xcode
348+
run: |
349+
sudo xcode-select -s "/Applications/Xcode_${XCODE_VERSION}.app"
350+
xcodebuild -version
339351
340352
- uses: dtolnay/rust-toolchain@stable
341353
with:

‎docs/ios.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Settings, saved devices, the end-to-end identity, control code, pairing state an
6868

6969
## Building
7070

71-
On a Mac with Xcode 26+ (the code uses iOS 26 SDK names; the app still runs on iOS 17+), Rust with `rustup target add aarch64-apple-ios aarch64-apple-ios-sim`, and [XcodeGen](https://github.com/yonaskolb/XcodeGen):
71+
On a Mac with Xcode 27+ (which needs Apple silicon and macOS 26.6 or later; the app still runs on iOS 17+), Rust with `rustup target add aarch64-apple-ios aarch64-apple-ios-sim`, and [XcodeGen](https://github.com/yonaskolb/XcodeGen):
7272

7373
```bash
7474
cd ios

‎docs/ios.zh-CN.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282

8383
需要一台 Mac:
8484

85-
- Xcode 26 或更新(带 iOS SDK;代码用到了 iOS 26 SDK 的接口,装好的应用仍然支持 iOS 17 及以上)
85+
- Xcode 27 或更新(带 iOS SDK;只能装在 Apple 芯片、macOS 26.6 或更新的 Mac 上;装好的应用仍然支持 iOS 17 及以上)
8686
- Rust([rustup](https://rustup.rs))和两个目标:`rustup target add aarch64-apple-ios aarch64-apple-ios-sim`
8787
- [XcodeGen](https://github.com/yonaskolb/XcodeGen)(`brew install xcodegen`,或者下载它的发布包):`ios/project.yml` 生成 Xcode 工程
8888

0 commit comments

Comments
 (0)