From 8396a78b98adca8674dbc8fb9502cdc1158058bf Mon Sep 17 00:00:00 2001 From: Loong Date: Sat, 16 Aug 2025 22:44:14 +0800 Subject: [PATCH 1/4] ci: add arm runner --- .github/workflows/ci.yml | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2d67b11..fcf02cab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,8 +54,10 @@ jobs: matrix: os: - ubuntu-22.04 + - ubuntu-22.04-arm - macos-13 # x86_64 runner - macos-latest # aarch64 runner + - windows-11-arm - windows-latest env: MAA_EXTRA_SHARE_NAME: maa-test @@ -64,6 +66,8 @@ jobs: uses: actions/checkout@v5 - name: Setup Toolchains uses: ./.github/actions/setup + with: + arch: "${{ matrix.os != 'macos-13' || endsWith(matrix.os, 'arm') ? 'arm' : 'x86_64' }}" - name: Setup Cache uses: Swatinem/rust-cache@v2 - name: Build (maa-cli) @@ -98,28 +102,6 @@ jobs: run: | cargo test -- --include-ignored - build-cross: - name: Cross Build - needs: [build] - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - - ubuntu-22.04 - - windows-latest - steps: - - name: Checkout - uses: actions/checkout@v5 - - name: Setup Toolchains - uses: ./.github/actions/setup - with: - target_arch: aarch64 - - name: Build - run: | - cargo build --package maa-cli --locked \ - --features vendored-openssl - build-no-default-features: name: Build and Test (${{ matrix.feature }}) needs: [build] From 76b80ff1be3aed9099e6a526b0dd14bde49f3c61 Mon Sep 17 00:00:00 2001 From: Loong Date: Sat, 16 Aug 2025 22:47:45 +0800 Subject: [PATCH 2/4] ci: remove setup, as we not need --- .github/workflows/ci.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fcf02cab..90a5ef26 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,10 +64,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v5 - - name: Setup Toolchains - uses: ./.github/actions/setup - with: - arch: "${{ matrix.os != 'macos-13' || endsWith(matrix.os, 'arm') ? 'arm' : 'x86_64' }}" - name: Setup Cache uses: Swatinem/rust-cache@v2 - name: Build (maa-cli) @@ -187,8 +183,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v5 - - name: Setup Toolchains - uses: ./.github/actions/setup - name: Setup Cache uses: Swatinem/rust-cache@v2 - name: Install MaaCore From 2b00eec280651e0d48c162e58f5ba1f5ff644045 Mon Sep 17 00:00:00 2001 From: Loong Date: Mon, 18 Aug 2025 19:25:26 +0800 Subject: [PATCH 3/4] Force update rust --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 90a5ef26..dac01096 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,6 +64,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v5 + - name: Update Rust + run: rustup update stable - name: Setup Cache uses: Swatinem/rust-cache@v2 - name: Build (maa-cli) From a83a1996fbf4b8a51a6d179ce1e1e21f365cfa82 Mon Sep 17 00:00:00 2001 From: Loong Date: Mon, 18 Aug 2025 21:12:32 +0800 Subject: [PATCH 4/4] Use arm runner on release --- .github/workflows/release.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c5e6c709..1400d1bf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -110,23 +110,23 @@ jobs: matrix: os: - ubuntu-22.04 + - ubuntu-22.04-arm + - macos-13 # x86_64 runner + - macos-latest # aarch64 runner + - windows-11-arm - windows-latest - target-arch: - - x86_64 - - aarch64 - # macOS can be natively built on both x86_64 and aarch64 - include: - - os: macos-13 - target-arch: x86_64 - - os: macos-latest - target-arch: aarch64 steps: - name: Checkout uses: actions/checkout@v5 - - name: Setup Cross Compilation Toolchains - uses: ./.github/actions/setup - with: - target_arch: ${{ matrix.target-arch }} + - name: Update Rust + run: rustup update stable + - name: Get Host Triplet + id: host-triplet + run: | + { + echo -n "triplet=" + rustc -vV | grep '^host:' | awk '{print $2}' + } >> "$GITHUB_OUTPUT" - name: Build env: CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1 @@ -151,12 +151,12 @@ jobs: if [[ "$IS_CROSS" == "false" ]]; then "$target_dir/$exe" --version fi - tar -cvf "$CARGO_BUILD_TARGET.tar" -C "$target_dir" "$exe" + tar -cvf "${{ steps.host-triplet.outputs.triplet }}.tar" -C "$target_dir" "$exe" - name: Upload Artifact uses: actions/upload-artifact@v4 with: - name: maa_cli-${{ env.CARGO_BUILD_TARGET }} - path: ${{ env.CARGO_BUILD_TARGET }}.tar + name: maa_cli-${{ steps.host-triplet.outputs.triplet }} + path: ${{ steps.host-triplet.outputs.triplet }}.tar retention-days: 1 if-no-files-found: error