Skip to content

Commit 668d2f9

Browse files
author
User
committed
feat: 添加自动更新功能
- 添加 tauri-plugin-updater 和 tauri-plugin-process - 前端添加检查更新和更新弹窗 - 设置页面添加检查更新按钮 - 应用启动时自动检查更新 - GitHub Actions 支持生成 updater JSON - 更新 .gitignore 忽略签名私钥
1 parent 5b502c2 commit 668d2f9

File tree

9 files changed

+417
-238
lines changed

9 files changed

+417
-238
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Checkout repository
2525
uses: actions/checkout@v4
2626
with:
27-
fetch-depth: 0 # Fetch all history for changelog
27+
fetch-depth: 0
2828

2929
- name: Get commit messages since last tag
3030
id: changelog
@@ -33,19 +33,15 @@ jobs:
3333
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
3434
3535
if [ -z "$LAST_TAG" ]; then
36-
# No previous tag, get all commits
3736
COMMITS=$(git log --pretty=format:"- %s" -20)
3837
else
39-
# Get commits since last tag
4038
COMMITS=$(git log ${LAST_TAG}..HEAD --pretty=format:"- %s")
4139
fi
4240
43-
# Handle empty commits
4441
if [ -z "$COMMITS" ]; then
4542
COMMITS="- Initial release"
4643
fi
4744
48-
# Save to output (handle multiline)
4945
echo "commits<<EOF" >> $GITHUB_OUTPUT
5046
echo "$COMMITS" >> $GITHUB_OUTPUT
5147
echo "EOF" >> $GITHUB_OUTPUT
@@ -84,6 +80,8 @@ jobs:
8480
uses: tauri-apps/tauri-action@v0
8581
env:
8682
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
84+
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
8785
with:
8886
tagName: v${{ github.run_number }}
8987
releaseName: 'LoArchive v${{ github.run_number }}'
@@ -100,6 +98,10 @@ jobs:
10098
|------|------|
10199
| `.msi` | Windows 安装包(推荐) |
102100
| `.exe` | Windows 便携版 |
101+
| `.nsis.zip.sig` | 更新签名文件(自动更新用) |
102+
103+
### 🔄 自动更新
104+
应用内置自动更新功能,启动时会自动检查新版本。
103105
104106
### 🔧 使用方法
105107
1. 下载并安装
@@ -111,3 +113,4 @@ jobs:
111113
<sub>构建时间: ${{ github.event.head_commit.timestamp }}</sub>
112114
releaseDraft: false
113115
prerelease: false
116+
includeUpdaterJson: true

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ tauri_dev.log
7171
# 敏感信息 - 登录凭据(必须忽略!)
7272
login_info.py
7373

74+
# Tauri 签名密钥(绝对不能提交!)
75+
.tauri-private.key
76+
*.private.key
77+
7478
# 配置文件(可能包含敏感信息)
7579
loarchive_config.json
7680
download_history.json

0 commit comments

Comments
 (0)