From a42cb45534665b896ac1a691297deac400b586fd Mon Sep 17 00:00:00 2001 From: Northern_Lights <2537875849@qq.com> Date: Wed, 2 Oct 2024 21:15:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20.github/workflows/windows?= =?UTF-8?q?=5Ftest.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/windows_test.yaml | 71 +++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/windows_test.yaml diff --git a/.github/workflows/windows_test.yaml b/.github/workflows/windows_test.yaml new file mode 100644 index 0000000..52d5589 --- /dev/null +++ b/.github/workflows/windows_test.yaml @@ -0,0 +1,71 @@ +name: "Windows Nightly Build" +on: + schedule: + - cron: "0 0 * * *" # every day at midnight + workflow_dispatch: +jobs: + build: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up MSbuild + uses: microsoft/setup-msbuild@v2 + + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + channel: 'stable' + cache: true + cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache + cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path + + - run: flutter --version + + - name: Set up Rust + uses: dtolnay/rust-toolchain@stable + + - name: Rust Version + run: | + rustup --version + cargo --version + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + with: + workspaces: "rust" + cache-all-crates: true + + - name: Set up LLVM + uses: KyleMayes/install-llvm-action@v2 + with: + version: "18" + + - name: Flutter pub get + run: flutter pub get + - name: Flutter build runner + run: dart run build_runner build --delete-conflicting-outputs + - name: Rust cargo update + run: cargo update + working-directory: rust + + - name: Set up Flutter rust bridge + run: | + cargo install cargo-expand + cargo install 'flutter_rust_bridge_codegen@^2.0.0-dev.0' + + - name: Flutter Rust bridge generate + run: flutter_rust_bridge_codegen generate + - name: flutter gen l10n + run: | + flutter pub global activate intl_utils + flutter pub global run intl_utils:generate + - name: Flutter build Windows + run: flutter build windows + + - name: Archive build + uses: actions/upload-artifact@v4 + with: + name: windows + path: build/windows/x64/runner/Release +