build: 发布v0.6.8 #100
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| test: | |
| name: Test on Windows | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| components: rustfmt, clippy | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Build frontend | |
| run: bun run build | |
| - name: Copy i18n locales to src-tauri | |
| shell: pwsh | |
| run: | | |
| $srcLocalesDir = "src-ui\i18n\locales" | |
| $destDir = "src-tauri\locales" | |
| if (-not (Test-Path $destDir)) { | |
| New-Item -Path $destDir -ItemType Directory -Force | Out-Null | |
| } | |
| Copy-Item -Path "$srcLocalesDir\*" -Destination $destDir -Force | |
| Write-Host "✓ i18n locales files copied to src-tauri/locales/" | |
| - name: Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: src-tauri -> target | |
| - name: Validate commit messages | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| git fetch origin ${{ github.base_ref }} | |
| bun x commitlint --from origin/${{ github.base_ref }} --to HEAD --verbose | |
| - name: Check formatting | |
| working-directory: src-tauri | |
| run: cargo fmt --all -- --check | |
| - name: Clippy | |
| working-directory: src-tauri | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| - name: Run tests | |
| working-directory: src-tauri | |
| run: cargo test --all-features | |
| build-test: | |
| name: Build Test (x64) | |
| runs-on: windows-latest | |
| needs: test | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| targets: x86_64-pc-windows-msvc | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Copy i18n locales to src-tauri | |
| shell: pwsh | |
| run: | | |
| $srcLocalesDir = "src-ui\i18n\locales" | |
| $destDir = "src-tauri\locales" | |
| if (-not (Test-Path $destDir)) { | |
| New-Item -Path $destDir -ItemType Directory -Force | Out-Null | |
| } | |
| Copy-Item -Path "$srcLocalesDir\*" -Destination $destDir -Force | |
| Write-Host "✓ i18n locales files copied to src-tauri/locales/" | |
| - name: Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: src-tauri -> target | |
| - name: Build x64 installer (AI enabled) | |
| shell: pwsh | |
| run: | | |
| cd xtask | |
| cargo run --bin xtask build-installer --arch x64 --ai enabled | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-test-artifacts | |
| path: | | |
| *.exe | |
| *.msi | |
| retention-days: 7 |