Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
159 commits
Select commit Hold shift + click to select a range
1a97345
b站历史记录配套使用的前端,初步完善框架
woijfwefw Oct 14, 2024
6dae71f
引入Vant4组件库,现在可以选择显示历史记录的区间
woijfwefw Oct 15, 2024
b69d5b3
新增分区组件,接入视频分区,调整布局,优化界面
woijfwefw Oct 19, 2024
3fd0769
接入electron,支持打包成桌面端
woijfwefw Oct 22, 2024
69c6cdc
将跳转融入进显示当前页数里,点击up头像和名字可以跳转到up空间,点击条目可以跳转到对应源,将下一页逻辑改为路由切换,而不是现在单单切换a…
woijfwefw Nov 2, 2024
78a3e53
将后端从java转为python,将分页抽离出来作为一个组件
woijfwefw Nov 3, 2024
d7a72a6
增加打包时用到的环境变量,以此来判断使用何种路由
woijfwefw Nov 9, 2024
d051c10
修复已知问题
woijfwefw Nov 11, 2024
54b6b8e
修复搜索显示重复问题
woijfwefw Nov 15, 2024
4dfc803
添加TailwindCSS的Prettier插件,并加入配置文件,格式化所有文件,去掉了分号,将双引号变为单引号
woijfwefw Nov 16, 2024
00874ed
增加忽略文件,添加类型检查,使语法更严格
woijfwefw Nov 16, 2024
26accfd
feat: 优化历史记录查询的年份选择
woijfwefw Jan 1, 2025
2991dce
refactor(components): 重构历史和搜索页面组件
woijfwefw Jan 2, 2025
f11b39b
feat(api): 更新 API 地址并优化搜索栏样式
woijfwefw Jan 3, 2025
51a01d9
feat(analytics): 添加年度总结分析页面
woijfwefw Jan 6, 2025
f52c559
feat(components): 添加导航栏和年度总结页面组件
woijfwefw Jan 7, 2025
a725c87
feat(components): 添加连续观看记录页组件
woijfwefw Jan 8, 2025
51e4aaa
feat(analytics): 添加时间分析页面组件
woijfwefw Jan 9, 2025
09a59bb
feat(analytics): 添加最爱重温页面组件
woijfwefw Jan 10, 2025
722ec07
feat(analytics): 添加视频整体完成率分析页面
woijfwefw Jan 11, 2025
371302d
feat(analytics): 添加 UP 主完成率分析页面
woijfwefw Jan 12, 2025
b8db464
feat(analytics): 添加标签分析页面组件
woijfwefw Jan 13, 2025
652d59a
feat(analytics): 添加时间分布分析页面
woijfwefw Jan 14, 2025
267feec
feat(analytics): 添加月度观看趋势页面组件
woijfwefw Jan 15, 2025
0128e67
feat(analytics): 添加视频时长分析页面组件
woijfwefw Jan 16, 2025
ce662cb
feat(analytics): 添加标题关键词分析页面
woijfwefw Jan 17, 2025
1988e72
fix(analytics): 修复年度分析页面的年份选择和数据加载问题
woijfwefw Jan 18, 2025
84b8851
增加实时更新接口
woijfwefw Jan 19, 2025
822a71a
feat(search): 实现 UP 主搜索功能
woijfwefw Jan 20, 2025
78d9ede
feat(frontend): 添加隐私模式功能并优化用户界面
woijfwefw Jan 20, 2025
b8b69db
Update api.js
woijfwefw Jan 20, 2025
9680a9c
feat(analytics): 添加标题趋势分析页并优化页面切换逻辑
woijfwefw Jan 22, 2025
9e53c28
feat(analytics): 添加标题长度分析页面
woijfwefw Jan 23, 2025
dbf6db8
docs: 更新README文件
woijfwefw Jan 23, 2025
3883f5c
feat(analytics): 添加标题情感分析页面
woijfwefw Jan 24, 2025
28605bc
feat(analytics): 添加标题互动分析页面
woijfwefw Jan 25, 2025
5b060cf
docs(README): 更新项目说明和功能介绍
woijfwefw Jan 27, 2025
9aaa079
feat(api): 新增登录、导出等功能并优化错误处理
woijfwefw Jan 27, 2025
8e87b1f
Update README.md
woijfwefw Jan 27, 2025
2247a8e
更新 api.js
woijfwefw Jan 27, 2025
7b48bef
feat(history): 添加批量删除功能
woijfwefw Jan 28, 2025
27ad5fb
feat(api): 添加服务器地址配置功能
woijfwefw Jan 30, 2025
499e964
feat(database): 添加数据库重置和备注功能并优化设置页面
woijfwefw Jan 30, 2025
701dd2d
refactor(components): 重构导航栏和相关组件
woijfwefw Jan 31, 2025
62babd2
refactor(components): 优化历史记录页面展示逻辑
woijfwefw Feb 1, 2025
73d95e8
fix(tailwind): 修复动画页面加载和数据更新问题
woijfwefw Feb 1, 2025
add3b26
feat(search): 优化搜索功能
woijfwefw Feb 1, 2025
e8db91b
feat(api): 添加获取 SQLite 版本的功能并显示在侧边栏
woijfwefw Feb 2, 2025
ee43233
feat(images): 添加图片管理功能
woijfwefw Feb 5, 2025
debeda4
feat(components): 添加视频下载功能
woijfwefw Feb 6, 2025
67096d5
feat(api): 增加 FFmpeg 安装检查并优化下载功能
woijfwefw Feb 7, 2025
a82efa9
feat(api): 支持使用本地图片的功能
woijfwefw Feb 11, 2025
7c4fe60
feat(备注功能): 优化备注数据获取和更新逻辑
woijfwefw Feb 14, 2025
614ad5d
feat(images): 添加停止下载功能并优化下载逻辑
woijfwefw Feb 15, 2025
653d6f3
feat(api): 新增计划任务管理相关接口
woijfwefw Feb 25, 2025
c99b6e4
feat(SchedulerTasks): 实现任务启用禁用功能并更新API路径
woijfwefw Feb 26, 2025
0e68b5a
feat(Task): 完善计划任务管理功能
woijfwefw Feb 28, 2025
2e5efc1
docs(README): 更新计划任务页面说明
woijfwefw Mar 1, 2025
791cda8
feat(api): 添加视频摘要
woijfwefw Mar 1, 2025
0de33f4
refactor(components): 优化组件的导入
woijfwefw Mar 3, 2025
e1da98f
feat(api): 添加邮件配置相关接口并更新设置页面说明
woijfwefw Mar 5, 2025
9cda678
feat(api): 接入 deepseek 和本地摘相关接口
woijfwefw Mar 7, 2025
864f6b6
feat(VideoDetailDialog): 添加 CUDA 不可用时的提示和安装指南
woijfwefw Mar 8, 2025
775c189
refactor(task): 优化任务编辑和视频摘要
woijfwefw Mar 9, 2025
3873599
feat(filters): 优化筛选栏
woijfwefw Mar 10, 2025
b9a009f
refactor(api): 删除未使用的接口
woijfwefw Mar 12, 2025
d48f18e
feat(history): 优化页面细节
woijfwefw Mar 13, 2025
3094c72
refactor(frontend): 优化年度总结页面
woijfwefw Mar 14, 2025
b1bc2e8
refactor(api): 修改 API 默认地址并优化通知类型
woijfwefw Mar 15, 2025
c5de278
refactor(dialog): 优化弹窗样式和布局
woijfwefw Mar 16, 2025
16e5704
feat(auth): 优化登录流程
woijfwefw Mar 17, 2025
cd2a453
feat(downloads): 添加下载管理功能并优化历史记录
woijfwefw Mar 18, 2025
a381a0d
feat(tauri): 不在使用electron,而是使用 Tauri 框架构建桌面应用
woijfwefw Mar 22, 2025
168e173
feat(email): 添加测试邮件功能
woijfwefw Mar 23, 2025
1b8a4d9
fix(VideoSummary): 修复对话框关闭后状态没有清空的问题
woijfwefw Mar 23, 2025
b302e9c
fix #5 feat(server): 添加服务器连接检查和健康状态监测功能
woijfwefw Mar 24, 2025
dbd05ad
feat(components): 添加评论页面组件
woijfwefw Mar 25, 2025
01b7262
feat(components): 将下载视频和图片菜单集成到媒体管理页面,并集成ArtPlayer,增加关于页面
woijfwefw Mar 27, 2025
81da928
feat(data-sync): 实现数据同步和完整性检查功能
woijfwefw Mar 28, 2025
64e279a
feat(tailwind): 重构多个页面
woijfwefw Mar 29, 2025
1c8cbee
feat(scheduler): 增加间隔执行类型的任务调度
woijfwefw Mar 30, 2025
8938d82
feat(components): 实现收藏功能
woijfwefw Apr 1, 2025
9daa232
docs(README): 添加logo
woijfwefw Apr 1, 2025
9dce013
feat(favorites): 添加失效视频修复功能
woijfwefw Apr 3, 2025
24a98f9
增加提问模板
woijfwefw Apr 4, 2025
b32acb1
closes #9 添加Dockerfile (#15)
eli-yip Apr 7, 2025
fd7183d
feat(api): 增加收藏夹和用户视频下载功能
woijfwefw Apr 10, 2025
70de2cd
feat(export): 增加按月份和日期范围导出历史记录功能
woijfwefw Apr 11, 2025
df59fc4
feat(api): 新增视频详情相关接口和功能
woijfwefw Apr 13, 2025
ed9a8d4
docs(README): 添加 LICENSE 文件
woijfwefw Apr 16, 2025
1031639
fix #18 : 修复过滤弹窗在firefox上被侧边栏遮挡的问题
woijfwefw Apr 22, 2025
0eae87b
fix #12 : 添加重复观看数据为空时的提示
woijfwefw Apr 24, 2025
b798133
feat(api): 下载图片和视频详情可选是否使用cookie
woijfwefw Apr 25, 2025
55c9af2
feat(search): 搜索支持本地图片源
woijfwefw Apr 26, 2025
1428121
resolve #19 : 设置增加侧边栏状态管理
woijfwefw Apr 29, 2025
65df5ad
resolve #20 : 增加像素主题
woijfwefw May 3, 2025
14addf8
feat(api): 支持更多yutto已经支持的参数选项
woijfwefw May 4, 2025
7de7194
refactor(tailwind): 重构 DownloadDialog 组件UI
woijfwefw May 5, 2025
2efcbd4
feat(history): 添加同步删除B站历史记录功能
woijfwefw May 7, 2025
8dc3d0e
feat(api): 增加 API 密钥安全验证功能
woijfwefw May 8, 2025
c292942
feat(api): 添加获取视频合集观看时长信息的接口
woijfwefw May 9, 2025
3ffa815
feat(BiliTools): 优化视频时长数据展示
woijfwefw May 9, 2025
5dbaee2
feat(BiliTools): 优化视频数据展示和排序功能
woijfwefw May 10, 2025
ce10339
resolve #24: 添加复制链接功能
woijfwefw May 12, 2025
9c2b9b7
feat(api):修复API密钥带来的错误
woijfwefw May 14, 2025
52d301c
fix #26
woijfwefw May 15, 2025
0b8b876
feat(api): 增加数据完整性校验配置相关API
woijfwefw May 16, 2025
0d94aa9
refactor: 移除 API密钥验证相关功能
woijfwefw May 18, 2025
07d792b
resolve #23 : 添加批量下载视频功能
woijfwefw May 19, 2025
07818bc
fix #27 fix #28
woijfwefw May 21, 2025
2931c05
增加1Panel部署指南
woijfwefw May 22, 2025
2a675bf
feat(video-details): 接入新的超详细视频详情接口
woijfwefw May 24, 2025
5d37540
resolve #8 添加 shell插件并实现系统默认浏览器打开 URL 功能
woijfwefw May 24, 2025
e27f1d8
Docker 构建优化 (#31)
hang333 May 26, 2025
a437334
fix(build): 移除顶级 await,修复打包报 “Top-level await is not available” 错误 (#30)
hang333 May 26, 2025
15d9658
feat(api): 增加合集下载功能
woijfwefw Jun 1, 2025
7ebcdee
refactor: 将年度总结分析拆分为多个子分析
woijfwefw Jun 2, 2025
6f25833
feat(analytics): 年度总结添加热门视频分析功能
woijfwefw Jun 3, 2025
fc51e37
更新 README.md
woijfwefw Jul 5, 2025
4437cbe
refactor(search): 优化搜索参数
woijfwefw Jul 30, 2025
354e3a2
refactor(tailwind): 重新设计UP主完成率分析页面
woijfwefw Aug 3, 2025
e2216b3
docs(README): 更新页面介绍顺序
woijfwefw Aug 4, 2025
20790c0
feat(components): 优化下载对话框
woijfwefw Aug 10, 2025
0efb60d
docs(README): 更新功能说明
woijfwefw Aug 11, 2025
08009a0
feat(utils): 新增图片 URL标准化工具函数
woijfwefw Aug 14, 2025
f83e1b9
feat(dynamic): 新增用户动态抓取和管理功能
woijfwefw Aug 28, 2025
f225d35
feat(README): 更新功能介绍
woijfwefw Aug 28, 2025
f7027da
feat: 优化动态正文表情显示与添加删除功能
woijfwefw Sep 22, 2025
6665e74
feat: 移除全局图片像素化功能及相关字体预加载逻辑
woijfwefw Oct 5, 2025
25487cb
feat(favorites): 移除收藏夹视频修复功能
woijfwefw Oct 7, 2025
33e4d80
feat(video): 添加失效视频明细获取功能
woijfwefw Oct 12, 2025
b876155
feat(dark-mode): 实现全局深色模式支持
woijfwefw Oct 16, 2025
e1272ef
feat(store): 补充深色模式文件
woijfwefw Oct 16, 2025
9fea24d
将筛选移动到导航栏保持视觉平衡
woijfwefw Nov 15, 2025
a61b062
更新小白指南
woijfwefw Dec 5, 2025
7d8647c
ci: add GitHub Actions for tauri release and docker image
woijfwefw Dec 21, 2025
9ffb1c3
ci: prevent docker tags from auto-setting latest on releases
woijfwefw Dec 21, 2025
24f6db6
ci: fix tauri workflow expressions for tag pushes
woijfwefw Dec 21, 2025
c2f52df
ci: pin tauri-action to v0.6
woijfwefw Dec 21, 2025
f3d3617
ci: fix npm arg passing for tauri-action
woijfwefw Dec 21, 2025
736c6c6
ci: enable bundle targets and install bundler deps
woijfwefw Dec 21, 2025
101c3ff
ci: fix tauri builds (optional deps + mac targets)
woijfwefw Dec 21, 2025
7df4674
ci: use npm install so tauri cli platform deps are present
woijfwefw Dec 21, 2025
c93b0d8
ci: fix tauri-action runner and macos universal
woijfwefw Dec 21, 2025
6ebe975
ci: lock tauri cli platform binaries
woijfwefw Dec 21, 2025
1e0d895
ci: avoid npm lockfile for optional deps
woijfwefw Dec 21, 2025
68fe483
chore: pin tauri versions to match rust
woijfwefw Dec 21, 2025
233af53
fix: regenerate lockfile to ensure Rollup native package installs on …
alexma233 Dec 23, 2025
3a4503b
feat: 调度任务表单支持热门视频清理年份选择
woijfwefw Jan 1, 2026
aa8f185
feat: 新增历史记录移动端视频操作页
woijfwefw May 6, 2026
4871b23
improvement: 优化历史筛选与分页交互
woijfwefw May 6, 2026
484d5cd
refactor: 移除摘要与观看时长相关功能
woijfwefw May 6, 2026
adea885
chore: 忽略 Acemcp 本地索引目录
woijfwefw May 6, 2026
665db24
feat: 设置页支持 MCP 开关与复制提示词
woijfwefw Jun 11, 2026
112b427
fix(docker): 更新前端 GHCR 镜像命名空间
woijfwefw Jun 11, 2026
9d1b5be
fix(email): expose SMTP auth username
woijfwefw Jun 21, 2026
7401003
feat: add apprise settings page (#41)
ygguorun Jun 26, 2026
52206c1
Merge frontend into HistoryHub
woijfwefw Oct 25, 2026
f550e83
feat: integrate HistoryHub browser history sync
woijfwefw Oct 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ __pycache__
.dockerignore
Dockerfile
cache
frontend
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI

on:
push:
branches: [master]
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
static-and-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Check Python and JSON syntax
run: |
python - <<'PY'
import ast
import json
import subprocess
from pathlib import Path

files = subprocess.check_output(['git', 'ls-files', '-z']).decode().split('\0')
for filename in filter(None, files):
path = Path(filename)
if path.suffix == '.py':
ast.parse(path.read_text(encoding='utf-8-sig'), filename=filename)
elif path.suffix == '.json':
json.loads(path.read_text(encoding='utf-8-sig'))
PY

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: frontend/package-lock.json

- name: Check JavaScript syntax
run: |
git ls-files -z -- '*.js' '*.mjs' '*.cjs' | while IFS= read -r -d '' file; do
node --check "$file"
done

- name: Install frontend dependencies
working-directory: frontend
run: npm ci --include=optional --no-fund --no-audit

- name: Build frontend
working-directory: frontend
run: npm run build
62 changes: 62 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Frontend Docker image

on:
push:
branches:
- master
tags:
- "v*"
pull_request:
workflow_dispatch:
inputs:
publish:
description: 'Push the image to GHCR'
type: boolean
default: false

permissions:
contents: read
packages: write

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GHCR
if: startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && inputs.publish)
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/lifearchiveproject/bili-history-frontend
tags: |
type=ref,event=tag
type=semver,pattern={{version}}
type=raw,value=latest

- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./frontend
file: ./frontend/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && inputs.publish) }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
11 changes: 9 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
name: Publish Docker images (GHCR)
name: Backend Docker image

on:
workflow_dispatch:
inputs:
publish:
description: 'Push the image to GHCR'
type: boolean
default: false
pull_request:
push:
branches:
- master
Expand Down Expand Up @@ -38,6 +44,7 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Log in to GHCR
if: startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && inputs.publish)
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
Expand All @@ -61,7 +68,7 @@ jobs:
context: .
file: ${{ matrix.variant.dockerfile }}
platforms: linux/amd64
push: true
push: ${{ startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && inputs.publish) }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
Expand Down
53 changes: 34 additions & 19 deletions .github/workflows/multi-platform-build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 多平台构建
name: HistoryHub release build

on:
workflow_dispatch: # 允许手动触发
Expand All @@ -11,6 +11,9 @@ on:
tags:
- 'v*' # 在推送标签时触发,标签格式如 v1.0.0

permissions:
contents: read

jobs:
build:
name: 构建 ${{ matrix.os }}
Expand Down Expand Up @@ -94,7 +97,7 @@ jobs:
ls -la ./dist/

echo "检查可能的构建产物目录:"
find . -type d -name "*BilibiliHistory*" -o -name "*bili*" | grep -v "__pycache__"
find . -type d -name "*HistoryHub*" -o -name "*bili*" | grep -v "__pycache__"
shell: bash

- name: 创建构建验证报告
Expand Down Expand Up @@ -127,7 +130,7 @@ jobs:
ls -la ./dist/*.exe 2>/dev/null >> build_report.md || echo "未找到.exe文件" >> build_report.md
else
# 非Windows平台
ls -la ./dist/**/BilibiliHistoryAnalyzer* 2>/dev/null >> build_report.md || echo "未找到主程序文件" >> build_report.md
ls -la ./dist/**/HistoryHubBackend* 2>/dev/null >> build_report.md || echo "未找到主程序文件" >> build_report.md
fi
echo '```' >> build_report.md

Expand Down Expand Up @@ -176,21 +179,21 @@ jobs:

if [ "${{ matrix.os }}" == "windows-latest" ]; then
# Windows平台特殊处理
if [ -d "./dist/BilibiliHistoryAnalyzer" ]; then
echo "使用BilibiliHistoryAnalyzer目录"
7z a -tzip BilibiliHistoryFetcher-windows.zip ./dist/BilibiliHistoryAnalyzer
if [ -d "./dist/HistoryHubBackend" ]; then
echo "使用HistoryHubBackend目录"
7z a -tzip HistoryHub-backend-windows.zip ./dist/HistoryHubBackend
else
echo "查找可能的输出目录..."
find ./dist -type d -maxdepth 1 -print
FIRST_DIR=$(find ./dist -type d -maxdepth 1 | grep -v "^./dist$" | head -1)
if [ ! -z "$FIRST_DIR" ]; then
echo "使用目录: $FIRST_DIR"
7z a -tzip BilibiliHistoryFetcher-windows.zip "$FIRST_DIR"
7z a -tzip HistoryHub-backend-windows.zip "$FIRST_DIR"
else
echo "未找到构建目录,创建空包"
mkdir -p ./dist/empty
echo "构建失败,此为空包。请检查构建日志。" > ./dist/empty/README.txt
7z a -tzip BilibiliHistoryFetcher-windows.zip ./dist/empty
7z a -tzip HistoryHub-backend-windows.zip ./dist/empty
fi
fi
elif [ "${{ matrix.os }}" == "macos-latest" ]; then
Expand All @@ -202,12 +205,12 @@ jobs:
DIST_DIR=$(find ./dist -type d -mindepth 1 -maxdepth 1 | head -1)
if [ ! -z "$DIST_DIR" ]; then
echo "找到输出目录: $DIST_DIR"
cd dist && zip -r ../BilibiliHistoryFetcher-macos.zip $(basename "$DIST_DIR")
cd dist && zip -r ../HistoryHub-backend-macos.zip $(basename "$DIST_DIR")
else
echo "未找到构建目录,创建空包"
mkdir -p ./dist/empty
echo "构建失败,此为空包。请检查构建日志。" > ./dist/empty/README.txt
cd dist && zip -r ../BilibiliHistoryFetcher-macos.zip empty
cd dist && zip -r ../HistoryHub-backend-macos.zip empty
fi
else
# Linux平台
Expand All @@ -218,25 +221,31 @@ jobs:
DIST_DIR=$(find ./dist -type d -mindepth 1 -maxdepth 1 | head -1)
if [ ! -z "$DIST_DIR" ]; then
echo "找到输出目录: $DIST_DIR"
cd dist && zip -r ../BilibiliHistoryFetcher-linux.zip $(basename "$DIST_DIR")
cd dist && zip -r ../HistoryHub-backend-linux.zip $(basename "$DIST_DIR")
else
echo "未找到构建目录,创建空包"
mkdir -p ./dist/empty
echo "构建失败,此为空包。请检查构建日志。" > ./dist/empty/README.txt
cd dist && zip -r ../BilibiliHistoryFetcher-linux.zip empty
cd dist && zip -r ../HistoryHub-backend-linux.zip empty
fi
fi
shell: bash

- name: 上传构建产物
uses: actions/upload-artifact@v4
with:
name: BilibiliHistoryFetcher-${{ matrix.os }}
path: BilibiliHistoryFetcher-*.zip
name: HistoryHub-backend-${{ matrix.os }}
path: HistoryHub-backend-*.zip

build-frontend:
name: Build frontend desktop apps
uses: ./.github/workflows/tauri-release.yml
with:
ref: ${{ github.event.inputs.tag || github.ref }}

release:
name: 创建发布
needs: build
needs: [build, build-frontend]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag != '')
permissions:
Expand Down Expand Up @@ -302,8 +311,14 @@ jobs:
with:
tag_name: ${{ github.event.inputs.tag || github.ref_name }}
files: |
./BilibiliHistoryFetcher-windows-latest/BilibiliHistoryFetcher-windows.zip
./BilibiliHistoryFetcher-macos-latest/BilibiliHistoryFetcher-macos.zip
./BilibiliHistoryFetcher-ubuntu-latest/BilibiliHistoryFetcher-linux.zip
name: Release ${{ github.event.inputs.tag || github.ref_name }}
./HistoryHub-backend-windows-latest/HistoryHub-backend-windows.zip
./HistoryHub-backend-macos-latest/HistoryHub-backend-macos.zip
./HistoryHub-backend-ubuntu-latest/HistoryHub-backend-linux.zip
./HistoryHub-frontend-*/**/*.exe
./HistoryHub-frontend-*/**/*.dmg
./HistoryHub-frontend-*/**/*.deb
./HistoryHub-frontend-*/**/*.AppImage
name: HistoryHub ${{ github.event.inputs.tag || github.ref_name }}
body: ${{ steps.generate_changelog.outputs.changelog }}
prerelease: ${{ contains(github.event.inputs.tag || github.ref_name, '-') }}
fail_on_unmatched_files: true
95 changes: 95 additions & 0 deletions .github/workflows/tauri-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Frontend desktop build

on:
workflow_call:
inputs:
ref:
required: true
type: string

permissions:
contents: read

jobs:
build-tauri:
name: Build (${{ matrix.label }})
runs-on: ${{ matrix.platform }}
defaults:
run:
working-directory: frontend
strategy:
fail-fast: false
matrix:
include:
- label: macos-universal
platform: macos-latest
args: --target universal-apple-darwin --config src-tauri/tauri.macos.conf.json
- label: linux-x64
platform: ubuntu-24.04
args: --config src-tauri/tauri.linux.conf.json
- label: windows-x64
platform: windows-latest
args: --config src-tauri/tauri.windows.conf.json

steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: frontend/package-lock.json

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}

- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: "frontend/src-tauri -> target"

- name: Install Linux dependencies
if: matrix.platform == 'ubuntu-24.04'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
patchelf \
libssl-dev \
pkg-config \
fakeroot \
libfuse2

- name: Install Windows dependencies
if: matrix.platform == 'windows-latest'
run: choco install nsis -y

- name: Install frontend dependencies
run: npm ci --include=optional --no-fund --no-audit

- name: Build desktop app
uses: tauri-apps/tauri-action@v0.6
with:
projectPath: frontend
tauriScript: npx tauri
args: ${{ matrix.args }}

- name: Upload frontend artifacts
uses: actions/upload-artifact@v4
with:
name: HistoryHub-frontend-${{ matrix.label }}
path: |
frontend/src-tauri/target/**/release/bundle/nsis/*.exe
frontend/src-tauri/target/**/release/bundle/dmg/*.dmg
frontend/src-tauri/target/**/release/bundle/deb/*.deb
frontend/src-tauri/target/**/release/bundle/appimage/*.AppImage
if-no-files-found: error
Loading
Loading