Skip to content

Commit e12296d

Browse files
author
baiqing
committed
ci: add Windows Tauri build workflow on windows-latest
CI 在 windows-latest runner 上原生构建 spike:vite build → cargo build --release → WiX MSI + NSIS exe 打包,artifact 直接挂在 workflow run 上下载。 触发:push 到 windows-tauri-spike / main、改动落在 apps/windows-tauri/ 或本 workflow 时;也支持 workflow_dispatch 强制重跑。
1 parent 46e72ba commit e12296d

1 file changed

Lines changed: 87 additions & 0 deletions

File tree

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: windows-tauri-build
2+
3+
# Windows installer 在 windows-latest runner 上原生构建。
4+
# Phase 0 spike 没单元测试,所以「build 成功 + 产出可下载的 .msi / .exe」就是测试。
5+
#
6+
# 触发条件:
7+
# - push 到 windows-tauri-spike 或 main,且改动落在 apps/windows-tauri/ 或本 workflow
8+
# - 手动 dispatch(用于强制重跑)
9+
on:
10+
push:
11+
branches: [windows-tauri-spike, main]
12+
paths:
13+
- "apps/windows-tauri/**"
14+
- ".github/workflows/windows-tauri-build.yml"
15+
pull_request:
16+
branches: [main, develop]
17+
paths:
18+
- "apps/windows-tauri/**"
19+
- ".github/workflows/windows-tauri-build.yml"
20+
workflow_dispatch: {}
21+
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.ref }}
24+
cancel-in-progress: true
25+
26+
jobs:
27+
build-windows:
28+
name: build (windows-latest)
29+
runs-on: windows-latest
30+
timeout-minutes: 30
31+
defaults:
32+
run:
33+
working-directory: apps/windows-tauri
34+
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
39+
- name: Setup pnpm
40+
uses: pnpm/action-setup@v4
41+
with:
42+
version: 10
43+
44+
- name: Setup Node.js
45+
uses: actions/setup-node@v4
46+
with:
47+
node-version: 22
48+
cache: pnpm
49+
cache-dependency-path: apps/windows-tauri/pnpm-lock.yaml
50+
51+
- name: Setup Rust toolchain
52+
uses: dtolnay/rust-toolchain@stable
53+
with:
54+
targets: x86_64-pc-windows-msvc
55+
56+
- name: Cache cargo build (src-tauri)
57+
uses: Swatinem/rust-cache@v2
58+
with:
59+
workspaces: apps/windows-tauri/src-tauri -> target
60+
shared-key: windows-tauri-spike
61+
62+
- name: Install frontend dependencies
63+
run: pnpm install --frozen-lockfile
64+
65+
- name: Build (frontend + Tauri Windows bundle)
66+
# 这一步串起:vite build -> cargo build --release -> WiX MSI + NSIS exe 打包
67+
run: pnpm tauri build
68+
69+
- name: Inspect build output
70+
shell: bash
71+
run: |
72+
echo "===bundle dir==="
73+
ls -la src-tauri/target/release/bundle || true
74+
echo "===msi==="
75+
ls -la src-tauri/target/release/bundle/msi || true
76+
echo "===nsis==="
77+
ls -la src-tauri/target/release/bundle/nsis || true
78+
79+
- name: Upload installer artifacts
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: openless-windows-spike-${{ github.sha }}
83+
path: |
84+
apps/windows-tauri/src-tauri/target/release/bundle/msi/*.msi
85+
apps/windows-tauri/src-tauri/target/release/bundle/nsis/*.exe
86+
if-no-files-found: error
87+
retention-days: 30

0 commit comments

Comments
 (0)