From 82c630bd0e6b251dea1aea36a152ce8753e65265 Mon Sep 17 00:00:00 2001 From: MystiPanda Date: Sun, 10 Dec 2023 20:45:27 +0800 Subject: [PATCH] feat: Support windows aarch64 (#112) --- .github/workflows/release.yml | 22 +++++++++++++++------- patches/support-windows-aarch64.patch | 2 +- src-tauri/Cargo.toml | 2 +- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a049b12e..cf71d775 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,8 +20,8 @@ jobs: target: x86_64-pc-windows-msvc - os: windows-latest target: i686-pc-windows-msvc - # - os: windows-latest - # target: aarch64-pc-windows-msvc + - os: windows-latest + target: aarch64-pc-windows-msvc - os: macos-latest target: aarch64-apple-darwin - os: macos-latest @@ -32,12 +32,22 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 + - name: Apply Patch + if: matrix.target == 'aarch64-pc-windows-msvc' + run: | + git config --global user.email "clash-verge-rev@github.io" + git config --global user.name "clash-verge-rev" + git am patches/support-windows-aarch64.patch + + - name: Init Submodule + if: matrix.target == 'aarch64-pc-windows-msvc' + run: git submodule update --init --recursive + - name: Install Rust Stable uses: dtolnay/rust-toolchain@stable - name: Add Rust Target - run: | - rustup target add ${{ matrix.target }} + run: rustup target add ${{ matrix.target }} - name: Rust Cache uses: Swatinem/rust-cache@v2 @@ -61,7 +71,6 @@ jobs: pnpm check ${{ matrix.target }} - name: Tauri build - if: startsWith(matrix.os, 'windows') || startsWith(matrix.os,'macos') || startsWith(matrix.target,'x86_64') uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -78,8 +87,7 @@ jobs: - name: Portable Bundle if: matrix.os == 'windows-latest' - run: | - pnpm portable ${{ matrix.target }} + run: pnpm portable ${{ matrix.target }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} diff --git a/patches/support-windows-aarch64.patch b/patches/support-windows-aarch64.patch index 75d3c94d..1eb4af72 100644 --- a/patches/support-windows-aarch64.patch +++ b/patches/support-windows-aarch64.patch @@ -29,7 +29,7 @@ index 4c6dde5..5fd9ad8 100644 nanoid = "0.4" chrono = "0.4" sysinfo = "0.29" --rquickjs = "0.4" +-rquickjs = "0.3" serde_json = "1.0" serde_yaml = "0.9" auto-launch = "0.5" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 4c6dde51..6ce6d097 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -25,7 +25,7 @@ log4rs = "1" nanoid = "0.4" chrono = "0.4" sysinfo = "0.29" -rquickjs = "0.4" +rquickjs = "0.3" serde_json = "1.0" serde_yaml = "0.9" auto-launch = "0.5"