mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-23 09:54:25 +08:00
Readme修复
This commit is contained in:
178
.github/About_action..md
vendored
Normal file
178
.github/About_action..md
vendored
Normal file
@@ -0,0 +1,178 @@
|
|||||||
|
# LanMontainDesktop GitHub Actions CI/CD
|
||||||
|
|
||||||
|
参考 ClassIsland 项目最佳实践,为 LanMontainDesktop 配置的 GitHub Actions 工作流。
|
||||||
|
|
||||||
|
## 📋 工作流说明
|
||||||
|
|
||||||
|
### 1. Build (`build.yml`)
|
||||||
|
**何时运行:** 每次 push、PR、手动触发
|
||||||
|
|
||||||
|
**功能:**
|
||||||
|
- Windows: Release + Debug 配置
|
||||||
|
- Linux: Release 配置
|
||||||
|
- macOS: Release 配置
|
||||||
|
- 上传编译输出 artifacts
|
||||||
|
|
||||||
|
**运行时间:** ~5-10 分钟
|
||||||
|
|
||||||
|
### 2. Quality Check (`code-quality.yml`)
|
||||||
|
**何时运行:** PR 或 push
|
||||||
|
|
||||||
|
**功能:**
|
||||||
|
- 编译检查
|
||||||
|
- 代码格式检查 (`dotnet format`)
|
||||||
|
|
||||||
|
**运行时间:** ~3-5 分钟
|
||||||
|
|
||||||
|
### 3. Release (`release.yml`)
|
||||||
|
**何时运行:** Push 标签 (`v*`) 或手动触发
|
||||||
|
|
||||||
|
**功能:**
|
||||||
|
- 并行构建所有平台 (Windows x64/x86, Linux x64, macOS x64/arm64)
|
||||||
|
- 自动创建 GitHub Release
|
||||||
|
- 上传所有平台的可执行包
|
||||||
|
|
||||||
|
**运行时间:** ~20-30 分钟
|
||||||
|
|
||||||
|
**触发方式:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 推送标签 - 自动触发
|
||||||
|
git tag v1.0.0
|
||||||
|
git push origin v1.0.0
|
||||||
|
|
||||||
|
# 或手动触发
|
||||||
|
# GitHub Actions > Release > Run workflow
|
||||||
|
# 输入: tag (例如 v1.0.0)
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. Issue Management (`issue-management.yml`)
|
||||||
|
**何时运行:** 每天 1:30 AM UTC
|
||||||
|
|
||||||
|
**功能:**
|
||||||
|
- 标记 30 天无活动的 Issue
|
||||||
|
- 关闭 7 天无活动的 stale Issue
|
||||||
|
- 对 PR 同样处理
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚀 快速开始
|
||||||
|
|
||||||
|
### 创建版本发布
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 1. 提交最后的更改
|
||||||
|
git add .
|
||||||
|
git commit -m "Release v1.0.0"
|
||||||
|
|
||||||
|
# 2. 创建标签
|
||||||
|
git tag v1.0.0 -m "Release version 1.0.0"
|
||||||
|
|
||||||
|
# 3. 推送
|
||||||
|
git push origin main
|
||||||
|
git push origin v1.0.0
|
||||||
|
|
||||||
|
# 4. 等待... (GitHub Actions 自动构建)
|
||||||
|
# 约 20-30 分钟后,Release 将自动创建
|
||||||
|
```
|
||||||
|
|
||||||
|
### 查看工作流状态
|
||||||
|
|
||||||
|
访问: **GitHub 项目 > Actions 标签**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📁 支持的平台与格式
|
||||||
|
|
||||||
|
| 平台 | 架构 | 输出格式 |
|
||||||
|
|------|------|---------|
|
||||||
|
| Windows | x64, x86 | `.zip` |
|
||||||
|
| Linux | x64 | `.tar.gz` |
|
||||||
|
| macOS | x64, arm64 | `.tar.gz` |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🛠️ 本地构建参考
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 使用现有脚本
|
||||||
|
.\LanMontainDesktop\scripts\package.ps1 -RuntimeIdentifier win-x64
|
||||||
|
|
||||||
|
# 或用 dotnet 直接构建
|
||||||
|
dotnet build -c Release
|
||||||
|
dotnet publish LanMontainDesktop/LanMontainDesktop.csproj `
|
||||||
|
-c Release -r win-x64 -o ./publish/win-x64 `
|
||||||
|
--self-contained -p:PublishSingleFile=true
|
||||||
|
```
|
||||||
|
|
||||||
|
### Linux / macOS
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 使用 build 脚本
|
||||||
|
chmod +x scripts/build.sh
|
||||||
|
./scripts/build.sh publish --config Release --rid linux-x64
|
||||||
|
./scripts/build.sh publish --config Release --rid osx-x64
|
||||||
|
./scripts/build.sh publish --config Release --rid osx-arm64
|
||||||
|
|
||||||
|
# 或用 dotnet 直接构建
|
||||||
|
dotnet build -c Release
|
||||||
|
dotnet publish LanMontainDesktop/LanMontainDesktop.csproj \
|
||||||
|
-c Release -r linux-x64 -o ./publish/linux-x64 \
|
||||||
|
--self-contained -p:PublishSingleFile=true
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📊 Actions 使用统计
|
||||||
|
|
||||||
|
**免费额度:** 2000 runner-hours/月 (对大多数项目用不完)
|
||||||
|
|
||||||
|
**预计使用:**
|
||||||
|
- Build job: ~3-5 分钟 × 3 平台
|
||||||
|
- Code quality: ~3-5 分钟
|
||||||
|
- Release: ~25-30 分钟 × 1/周
|
||||||
|
|
||||||
|
**月总计:** ~30-50 分钟 × 20+ 次 = ~600-1000 分钟 (远低于免费额度)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🐛 常见问题
|
||||||
|
|
||||||
|
### Release 工作流不运行?
|
||||||
|
|
||||||
|
检查:
|
||||||
|
1. 标签格式是否为 `v*` (例如:`v1.0.0`)
|
||||||
|
2. `.csproj` 文件是否有效
|
||||||
|
3. GitHub Actions 是否已启用
|
||||||
|
|
||||||
|
### 特定平台构建失败?
|
||||||
|
|
||||||
|
查看 Actions 日志:
|
||||||
|
1. **Windows**: 检查 libvlc 依赖
|
||||||
|
2. **Linux**: 检查系统库依赖
|
||||||
|
3. **macOS**: 检查 Xcode 工具链
|
||||||
|
|
||||||
|
### 如何跳过某个工作流?
|
||||||
|
|
||||||
|
在 commit 消息中添加:
|
||||||
|
```
|
||||||
|
[skip ci] # 跳过所有工作流
|
||||||
|
[skip build] # 跳过构建
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🔗 参考
|
||||||
|
|
||||||
|
- [ClassIsland CI/CD](https://github.com/ClassIsland/ClassIsland/.github/workflows/)
|
||||||
|
- [GitHub Actions 文档](https://docs.github.com/actions)
|
||||||
|
- [.NET 发布指南](https://learn.microsoft.com/dotnet/core/tools/dotnet-publish)
|
||||||
|
- [Avalonia 部署](https://docs.avaloniaui.net/docs/deployment)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**更新:** 2026-03-04
|
||||||
|
**版本:** 2.0 (参考 ClassIsland)
|
||||||
|
**状态:** ✅ 生产可用
|
||||||
204
.github/README.md
vendored
204
.github/README.md
vendored
@@ -1,178 +1,44 @@
|
|||||||
# LanMontainDesktop GitHub Actions CI/CD
|
# LanMontainDesktop
|
||||||
|
|
||||||
参考 ClassIsland 项目最佳实践,为 LanMontainDesktop 配置的 GitHub Actions 工作流。
|
> 你的桌面,不止一面。
|
||||||
|
|
||||||
## 📋 工作流说明
|
`LanMontainDesktop` 是一个基于 Avalonia 的桌面壳层项目,目标不是“做一个启动器”,而是把桌面变成可编排的信息与交互空间。
|
||||||
|
|
||||||
### 1. Build (`build.yml`)
|
## 项目定位
|
||||||
**何时运行:** 每次 push、PR、手动触发
|
- 以网格化布局组织桌面组件,支持多页桌面与组件自由摆放。
|
||||||
|
- 提供顶部状态栏 + 底部任务栏的桌面框架,强调信息密度与可读性平衡。
|
||||||
|
- 通过主题色、日夜模式、玻璃视觉与动画系统,形成统一的视觉语言。
|
||||||
|
- 通过组件注册机制与 JSON 扩展入口,让桌面能力可持续扩展。
|
||||||
|
|
||||||
**功能:**
|
## 核心能力
|
||||||
- Windows: Release + Debug 配置
|
- 桌面组件系统:天气、时钟、计时器、课程表、日历、白板、音乐控制、学习环境等组件可组合使用。
|
||||||
- Linux: Release 配置
|
- 壁纸系统:支持图片与视频壁纸,并可在设置中实时预览。
|
||||||
- macOS: Release 配置
|
- 主题系统:支持日夜模式、主题色与调色联动(Monet 风格色板)。
|
||||||
- 上传编译输出 artifacts
|
- 个性化设置:网格密度、状态栏间距、任务栏布局、语言与时区等可持久化配置。
|
||||||
|
- 本地化:内置 `zh-CN` 与 `en-US` 资源。
|
||||||
|
|
||||||
**运行时间:** ~5-10 分钟
|
## 工程结构
|
||||||
|
- `LanMontainDesktop/`:桌面端主程序(Avalonia)。
|
||||||
|
- `LanMontainDesktop.RecommendationBackend/`:推荐内容后端服务(ASP.NET Core Minimal API)。
|
||||||
|
- `docs/`:视觉与圆角等规范文档。
|
||||||
|
- `LanMontainDesktop/ComponentSystem/`:组件定义、注册、放置规则与扩展入口。
|
||||||
|
|
||||||
### 2. Quality Check (`code-quality.yml`)
|
## 技术栈
|
||||||
**何时运行:** PR 或 push
|
- .NET 10(`net10.0`)
|
||||||
|
- Avalonia 11
|
||||||
|
- FluentAvalonia + FluentIcons.Avalonia
|
||||||
|
- LibVLCSharp(用于视频相关能力)
|
||||||
|
- WebView.Avalonia(嵌入式网页组件能力)
|
||||||
|
|
||||||
**功能:**
|
## 扩展机制(摘要)
|
||||||
- 编译检查
|
- 组件系统通过 `ComponentRegistry` 合并内置组件与扩展组件。
|
||||||
- 代码格式检查 (`dotnet format`)
|
- 运行时会扫描 `Extensions/Components/*.json`(相对应用输出目录)加载第三方组件清单。
|
||||||
|
- 扩展契约与字段说明见组件系统文档:`LanMontainDesktop/ComponentSystem/README.md`。
|
||||||
|
|
||||||
**运行时间:** ~3-5 分钟
|
## 当前状态
|
||||||
|
- 项目包含桌面端与推荐后端两个子项目,并在同一 solution 中维护。
|
||||||
|
- 配置默认写入本地:`%LOCALAPPDATA%\LanMontainDesktop\settings.json`。
|
||||||
|
- 当前体验以 Windows 为主要目标平台。
|
||||||
|
|
||||||
### 3. Release (`release.yml`)
|
## 运行说明
|
||||||
**何时运行:** Push 标签 (`v*`) 或手动触发
|
运行与环境准备已拆分到独立文档:[`run.md`](./run.md)
|
||||||
|
|
||||||
**功能:**
|
|
||||||
- 并行构建所有平台 (Windows x64/x86, Linux x64, macOS x64/arm64)
|
|
||||||
- 自动创建 GitHub Release
|
|
||||||
- 上传所有平台的可执行包
|
|
||||||
|
|
||||||
**运行时间:** ~20-30 分钟
|
|
||||||
|
|
||||||
**触发方式:**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# 推送标签 - 自动触发
|
|
||||||
git tag v1.0.0
|
|
||||||
git push origin v1.0.0
|
|
||||||
|
|
||||||
# 或手动触发
|
|
||||||
# GitHub Actions > Release > Run workflow
|
|
||||||
# 输入: tag (例如 v1.0.0)
|
|
||||||
```
|
|
||||||
|
|
||||||
### 4. Issue Management (`issue-management.yml`)
|
|
||||||
**何时运行:** 每天 1:30 AM UTC
|
|
||||||
|
|
||||||
**功能:**
|
|
||||||
- 标记 30 天无活动的 Issue
|
|
||||||
- 关闭 7 天无活动的 stale Issue
|
|
||||||
- 对 PR 同样处理
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🚀 快速开始
|
|
||||||
|
|
||||||
### 创建版本发布
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# 1. 提交最后的更改
|
|
||||||
git add .
|
|
||||||
git commit -m "Release v1.0.0"
|
|
||||||
|
|
||||||
# 2. 创建标签
|
|
||||||
git tag v1.0.0 -m "Release version 1.0.0"
|
|
||||||
|
|
||||||
# 3. 推送
|
|
||||||
git push origin main
|
|
||||||
git push origin v1.0.0
|
|
||||||
|
|
||||||
# 4. 等待... (GitHub Actions 自动构建)
|
|
||||||
# 约 20-30 分钟后,Release 将自动创建
|
|
||||||
```
|
|
||||||
|
|
||||||
### 查看工作流状态
|
|
||||||
|
|
||||||
访问: **GitHub 项目 > Actions 标签**
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 📁 支持的平台与格式
|
|
||||||
|
|
||||||
| 平台 | 架构 | 输出格式 |
|
|
||||||
|------|------|---------|
|
|
||||||
| Windows | x64, x86 | `.zip` |
|
|
||||||
| Linux | x64 | `.tar.gz` |
|
|
||||||
| macOS | x64, arm64 | `.tar.gz` |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🛠️ 本地构建参考
|
|
||||||
|
|
||||||
### Windows
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# 使用现有脚本
|
|
||||||
.\LanMontainDesktop\scripts\package.ps1 -RuntimeIdentifier win-x64
|
|
||||||
|
|
||||||
# 或用 dotnet 直接构建
|
|
||||||
dotnet build -c Release
|
|
||||||
dotnet publish LanMontainDesktop/LanMontainDesktop.csproj `
|
|
||||||
-c Release -r win-x64 -o ./publish/win-x64 `
|
|
||||||
--self-contained -p:PublishSingleFile=true
|
|
||||||
```
|
|
||||||
|
|
||||||
### Linux / macOS
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# 使用 build 脚本
|
|
||||||
chmod +x scripts/build.sh
|
|
||||||
./scripts/build.sh publish --config Release --rid linux-x64
|
|
||||||
./scripts/build.sh publish --config Release --rid osx-x64
|
|
||||||
./scripts/build.sh publish --config Release --rid osx-arm64
|
|
||||||
|
|
||||||
# 或用 dotnet 直接构建
|
|
||||||
dotnet build -c Release
|
|
||||||
dotnet publish LanMontainDesktop/LanMontainDesktop.csproj \
|
|
||||||
-c Release -r linux-x64 -o ./publish/linux-x64 \
|
|
||||||
--self-contained -p:PublishSingleFile=true
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 📊 Actions 使用统计
|
|
||||||
|
|
||||||
**免费额度:** 2000 runner-hours/月 (对大多数项目用不完)
|
|
||||||
|
|
||||||
**预计使用:**
|
|
||||||
- Build job: ~3-5 分钟 × 3 平台
|
|
||||||
- Code quality: ~3-5 分钟
|
|
||||||
- Release: ~25-30 分钟 × 1/周
|
|
||||||
|
|
||||||
**月总计:** ~30-50 分钟 × 20+ 次 = ~600-1000 分钟 (远低于免费额度)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🐛 常见问题
|
|
||||||
|
|
||||||
### Release 工作流不运行?
|
|
||||||
|
|
||||||
检查:
|
|
||||||
1. 标签格式是否为 `v*` (例如:`v1.0.0`)
|
|
||||||
2. `.csproj` 文件是否有效
|
|
||||||
3. GitHub Actions 是否已启用
|
|
||||||
|
|
||||||
### 特定平台构建失败?
|
|
||||||
|
|
||||||
查看 Actions 日志:
|
|
||||||
1. **Windows**: 检查 libvlc 依赖
|
|
||||||
2. **Linux**: 检查系统库依赖
|
|
||||||
3. **macOS**: 检查 Xcode 工具链
|
|
||||||
|
|
||||||
### 如何跳过某个工作流?
|
|
||||||
|
|
||||||
在 commit 消息中添加:
|
|
||||||
```
|
|
||||||
[skip ci] # 跳过所有工作流
|
|
||||||
[skip build] # 跳过构建
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🔗 参考
|
|
||||||
|
|
||||||
- [ClassIsland CI/CD](https://github.com/ClassIsland/ClassIsland/.github/workflows/)
|
|
||||||
- [GitHub Actions 文档](https://docs.github.com/actions)
|
|
||||||
- [.NET 发布指南](https://learn.microsoft.com/dotnet/core/tools/dotnet-publish)
|
|
||||||
- [Avalonia 部署](https://docs.avaloniaui.net/docs/deployment)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**更新:** 2026-03-04
|
|
||||||
**版本:** 2.0 (参考 ClassIsland)
|
|
||||||
**状态:** ✅ 生产可用
|
|
||||||
|
|||||||
Reference in New Issue
Block a user