Skip to content

Commit 3355d03

Browse files
committed
first commit
0 parents  commit 3355d03

File tree

85 files changed

+11493
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+11493
-0
lines changed

.github/workflows/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# GitHub Actions 工作流说明
2+
3+
## 构建工作流 (build.yml)
4+
5+
这个工作流会自动构建 Tauri 应用程序到 Windows 和 macOS 平台。
6+
7+
### 触发条件
8+
9+
- **推送到 main 分支**: 每次推送代码到 main 分支时自动构建
10+
- **创建版本标签**: 创建 `v*` 格式的标签时(例如 `v1.0.0`
11+
- **Pull Request**: 当有 PR 提交到 main 分支时
12+
- **手动触发**: 在 GitHub Actions 页面手动运行
13+
14+
### 构建平台
15+
16+
1. **macOS**: 构建 Universal Binary(同时支持 Intel 和 Apple Silicon)
17+
- 输出格式: `.dmg``.app`
18+
19+
2. **Windows**: 构建 x64 可执行文件
20+
- 输出格式: `.msi``.exe` (NSIS安装器)
21+
22+
### 构建产物
23+
24+
构建完成后,产物会自动上传为 GitHub Actions Artifacts:
25+
- `macos-build`: macOS 构建产物
26+
- `windows-build`: Windows 构建产物
27+
28+
你可以在 Actions 页面下载这些产物。
29+
30+
### 发布版本
31+
32+
当你创建一个版本标签时(例如 `v0.1.0`),工作流会:
33+
1. 构建所有平台
34+
2. 自动创建 GitHub Release
35+
3. 将所有构建产物附加到 Release 中
36+
37+
#### 如何发布版本
38+
39+
```bash
40+
# 确保所有更改已提交
41+
git add .
42+
git commit -m "准备发布 v0.1.0"
43+
44+
# 创建并推送标签
45+
git tag v0.1.0
46+
git push origin main
47+
git push origin v0.1.0
48+
```
49+
50+
### 注意事项
51+
52+
- 确保 `package.json``src-tauri/tauri.conf.json` 中的版本号一致
53+
- macOS 构建需要大约 15-20 分钟
54+
- Windows 构建需要大约 10-15 分钟
55+
- 如果需要签名,需要配置相应的密钥和证书
56+

.github/workflows/build.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Build Tauri App
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*'
9+
pull_request:
10+
branches:
11+
- main
12+
workflow_dispatch:
13+
14+
jobs:
15+
build:
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- platform: 'macos-latest'
21+
args: '--target universal-apple-darwin'
22+
name: 'macOS'
23+
- platform: 'windows-latest'
24+
args: ''
25+
name: 'Windows'
26+
27+
runs-on: ${{ matrix.platform }}
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
33+
- name: Setup Node.js
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: '20'
37+
38+
- name: Install pnpm
39+
uses: pnpm/action-setup@v4
40+
with:
41+
version: 9
42+
43+
- name: Setup Rust
44+
uses: dtolnay/rust-toolchain@stable
45+
with:
46+
# For universal macOS build
47+
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
48+
49+
- name: Install dependencies (Ubuntu)
50+
if: matrix.platform == 'ubuntu-latest'
51+
run: |
52+
sudo apt-get update
53+
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
54+
55+
- name: Install frontend dependencies
56+
run: pnpm install
57+
58+
- name: Build Tauri app
59+
uses: tauri-apps/tauri-action@v0
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
with:
63+
args: ${{ matrix.args }}
64+
65+
- name: Upload artifacts (macOS)
66+
if: matrix.platform == 'macos-latest'
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: macos-build
70+
path: |
71+
src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg
72+
src-tauri/target/universal-apple-darwin/release/bundle/macos/*.app
73+
if-no-files-found: warn
74+
75+
- name: Upload artifacts (Windows)
76+
if: matrix.platform == 'windows-latest'
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: windows-build
80+
path: |
81+
src-tauri/target/release/bundle/msi/*.msi
82+
src-tauri/target/release/bundle/nsis/*.exe
83+
if-no-files-found: warn
84+
85+
release:
86+
needs: build
87+
if: startsWith(github.ref, 'refs/tags/v')
88+
runs-on: ubuntu-latest
89+
steps:
90+
- name: Download all artifacts
91+
uses: actions/download-artifact@v4
92+
with:
93+
path: artifacts
94+
95+
- name: Create Release
96+
uses: softprops/action-gh-release@v1
97+
with:
98+
files: |
99+
artifacts/**/*.dmg
100+
artifacts/**/*.msi
101+
artifacts/**/*.exe
102+
env:
103+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104+

.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
25+
26+
.history
27+
.playwright-mcp
28+
.vscode

0 commit comments

Comments
 (0)