From 91062485dd5fbb85b93b3c18ac47369c15ba6c5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=AE=E6=A3=83?= Date: Thu, 12 Dec 2024 09:12:12 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20=E6=B7=BB=E5=8A=A0=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 66 ++++++++++++++++++++++++++++++++++++ src-tauri/.cargo/config.toml | 2 ++ 2 files changed, 68 insertions(+) create mode 100644 .github/workflows/test.yml create mode 100644 src-tauri/.cargo/config.toml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..519dd94f --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,66 @@ +name: Build Test +on: + workflow_dispatch: + inputs: + version: + description: "Version to build" + required: true + default: "0.1.0" + +jobs: + publish-tauri: + permissions: + contents: write + strategy: + fail-fast: false + matrix: + settings: + - platform: windows-latest + args: "--verbose" + target: "windows" + - platform: macos-latest + args: "--target x86_64-apple-darwin" + target: "macos-intel" + - platform: macos-latest + args: "--target aarch64-apple-darwin" + target: "macos-arm" + runs-on: ${{ matrix.settings.platform }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Add Rust targets(macOS Intel) + if: matrix.settings.target == 'macos-intel' + run: rustup target add x86_64-apple-darwin + - name: Add Rust targets(macOS ARM) + if: matrix.settings.target == 'macos-arm' + run: rustup target add aarch64-apple-darwin + + - name: Rust setup + uses: dtolnay/rust-toolchain@stable + - name: Rust cache + uses: swatinem/rust-cache@v2 + with: + workspaces: "./src-tauri -> target" + + - name: setup node + uses: actions/setup-node@v3 + with: + node-version: 23.3.0 + - name: setup pnpm + uses: pnpm/action-setup@v2 + with: + version: 9.15.0 + - name: Install frontend dependencies + run: pnpm install + + - name: Build app + run: pnpm tauri build --verbose + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAURI_DIST_DIR: dist + TAURI_DEV: false + TAURI_VERSION: ${{ github.event.inputs.version }} + TAURI_TARGET: ${{ matrix.settings.target }} + TAURI_PLATFORM: ${{ matrix.settings.platform }} + TAURI_ARGS: ${{ matrix.settings.args }} diff --git a/src-tauri/.cargo/config.toml b/src-tauri/.cargo/config.toml new file mode 100644 index 00000000..656e08b0 --- /dev/null +++ b/src-tauri/.cargo/config.toml @@ -0,0 +1,2 @@ +[net] +git-fetch-with-cli = true \ No newline at end of file