From fd495fd080466e27b79f8b4d0fb4c81c2a643ed5 Mon Sep 17 00:00:00 2001 From: Kayshen-X Date: Tue, 5 May 2026 22:30:00 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20drop=20macos-13=20(deprecated)=20?= =?UTF-8?q?=E2=80=94=20cross-compile=20x86=5F64-apple-darwin=20from=20Appl?= =?UTF-8?q?e=20Silicon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GitHub Actions deprecated macos-13 Intel runners. Apple Silicon (macos-latest) can cargo build/check x86_64-apple-darwin out of the box (no cross tool needed). - rust-multiplatform.yml: macos-x86_64 job uses macos-latest + check_only=true (binary arch ≠ host arch so no test runs; cargo check verifies the workspace type-checks for x86_64 Macs) - rust-release.yml: macos-x86_64 job uses macos-latest, cargo build --release cross-compiles to x86_64; archive packaged as before --- .github/workflows/rust-multiplatform.yml | 15 +++++++++++---- .github/workflows/rust-release.yml | 5 ++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rust-multiplatform.yml b/.github/workflows/rust-multiplatform.yml index ff54c7197..6b1c8fac3 100644 --- a/.github/workflows/rust-multiplatform.yml +++ b/.github/workflows/rust-multiplatform.yml @@ -36,10 +36,14 @@ jobs: runner: macos-latest target: aarch64-apple-darwin cross: false + # macos-13 (Intel runners) deprecated; build x86_64-apple-darwin via + # cross-compile from Apple Silicon. cargo build/check run; no test + # since binary arch ≠ host arch. - label: macos-x86_64 - runner: macos-13 + runner: macos-latest target: x86_64-apple-darwin cross: false + check_only: true - label: linux-x86_64 runner: ubuntu-latest target: x86_64-unknown-linux-gnu @@ -78,8 +82,11 @@ jobs: if: matrix.cross == true run: cargo install cross --locked --version 0.2.5 - name: Build (host) - if: matrix.cross == false + if: matrix.cross == false && matrix.check_only != true run: cargo build --workspace --target ${{ matrix.target }} --release + - name: Check (cross-arch host, e.g. macos-x86_64 from Apple Silicon) + if: matrix.check_only == true + run: cargo check --workspace --target ${{ matrix.target }} - name: Build (cross) if: matrix.cross == true run: cross build --workspace --target ${{ matrix.target }} --release @@ -99,10 +106,10 @@ jobs: # than the headless DRI fallback that fails `eglInitialize`. run: xvfb-run -a cargo test --workspace --target ${{ matrix.target }} - name: Test (host, macOS / Windows) - if: matrix.cross == false && runner.os != 'Linux' + if: matrix.cross == false && matrix.check_only != true && runner.os != 'Linux' run: cargo test --workspace --target ${{ matrix.target }} - name: Upload openpencil-app binary - if: matrix.cross == false + if: matrix.cross == false && matrix.check_only != true uses: actions/upload-artifact@v4 with: name: openpencil-app-${{ matrix.label }} diff --git a/.github/workflows/rust-release.yml b/.github/workflows/rust-release.yml index d6214a74c..03ac8ac74 100644 --- a/.github/workflows/rust-release.yml +++ b/.github/workflows/rust-release.yml @@ -22,8 +22,11 @@ jobs: runner: macos-latest target: aarch64-apple-darwin archive: tar.gz + # macos-13 (Intel) deprecated; cross-compile x86_64-apple-darwin + # from Apple Silicon (cargo supports cross-compile to host's other + # arch out of the box, no `cross` needed). - label: macos-x86_64 - runner: macos-13 + runner: macos-latest target: x86_64-apple-darwin archive: tar.gz - label: linux-x86_64