This commit is contained in:
lincube
2026-03-04 15:22:52 +08:00
parent 2ba66893ac
commit f78a56cb2c
198 changed files with 461 additions and 461 deletions

View File

@@ -1,6 +1,6 @@
# LanMontainDesktop GitHub Actions CI/CD
# LanMountainDesktop GitHub Actions CI/CD
参考 ClassIsland 项目最佳实践,为 LanMontainDesktop 配置的 GitHub Actions 工作流。
参考 ClassIsland 项目最佳实践,为 LanMountainDesktop 配置的 GitHub Actions 工作流。
## 📋 工作流说明
@@ -98,11 +98,11 @@ git push origin v1.0.0
```bash
# 使用现有脚本
.\LanMontainDesktop\scripts\package.ps1 -RuntimeIdentifier win-x64
.\LanMountainDesktop\scripts\package.ps1 -RuntimeIdentifier win-x64
# 或用 dotnet 直接构建
dotnet build -c Release
dotnet publish LanMontainDesktop/LanMontainDesktop.csproj `
dotnet publish LanMountainDesktop/LanMountainDesktop.csproj `
-c Release -r win-x64 -o ./publish/win-x64 `
--self-contained -p:PublishSingleFile=true
```
@@ -118,7 +118,7 @@ chmod +x scripts/build.sh
# 或用 dotnet 直接构建
dotnet build -c Release
dotnet publish LanMontainDesktop/LanMontainDesktop.csproj \
dotnet publish LanMountainDesktop/LanMountainDesktop.csproj \
-c Release -r linux-x64 -o ./publish/linux-x64 \
--self-contained -p:PublishSingleFile=true
```

18
.github/CODEOWNERS vendored
View File

@@ -1,18 +1,18 @@
# CODEOWNERS for LanMontainDesktop
# CODEOWNERS for LanMountainDesktop
# Default owners for everything
* @
# Desktop UI & Components
/LanMontainDesktop/Views/ @
/LanMontainDesktop/ViewModels/ @
/LanMontainDesktop/ComponentSystem/ @
/LanMontainDesktop/Styles/ @
/LanMontainDesktop/Controls/ @
/LanMountainDesktop/Views/ @
/LanMountainDesktop/ViewModels/ @
/LanMountainDesktop/ComponentSystem/ @
/LanMountainDesktop/Styles/ @
/LanMountainDesktop/Controls/ @
# Backend Services
/LanMontainDesktop/Services/ @
/LanMontainDesktop.RecommendationBackend/ @
/LanMountainDesktop/Services/ @
/LanMountainDesktop.RecommendationBackend/ @
# Documentation
/docs/ @
@@ -21,4 +21,4 @@
# Build & CI/CD
/.github/ @
/scripts/ @
/LanMontainDesktop/LanMontainDesktop.csproj @
/LanMountainDesktop/LanMountainDesktop.csproj @

20
.github/FIX_REPORT.md vendored
View File

@@ -1,4 +1,4 @@
# 修复报告GitHub Actions CI/CD
# 修复报告GitHub Actions CI/CD
## ✅ 问题已解决
@@ -8,16 +8,16 @@ MSBUILD : error MSB1003: Specify a project or solution file.
The current working directory does not contain a project or solution file.
```
**原因**: 项目中缺少 `LanMontainDesktop.sln` 解决方案文件,但工作流尝试执行 `dotnet restore` 而没有指定项目。
**原因**: 项目中缺少 `LanMountainDesktop.sln` 解决方案文件,但工作流尝试执行 `dotnet restore` 而没有指定项目。
---
## 🔧 已采取的修复
### 1. 创建解决方案文件
✅ 创建了标准的 `LanMontainDesktop.sln` 文件,包含:
- `LanMontainDesktop/LanMontainDesktop.csproj`
- `LanMontainDesktop.RecommendationBackend/LanMontainDesktop.RecommendationBackend.csproj`
✅ 创建了标准的 `LanMountainDesktop.sln` 文件,包含:
- `LanMountainDesktop/LanMountainDesktop.csproj`
- `LanMountainDesktop.RecommendationBackend/LanMountainDesktop.RecommendationBackend.csproj`
### 2. 验证本地构建工作
✅ 本地测试通过:
@@ -39,9 +39,9 @@ The current working directory does not contain a project or solution file.
包含两个项目的标准 Visual Studio 解决方案格式:
```
LanMontainDesktop.sln
├── LanMontainDesktop (Desktop UI - Avalonia)
└── LanMontainDesktop.RecommendationBackend (Web API - ASP.NET Core)
LanMountainDesktop.sln
├── LanMountainDesktop (Desktop UI - Avalonia)
└── LanMountainDesktop.RecommendationBackend (Web API - ASP.NET Core)
```
---
@@ -52,7 +52,7 @@ LanMontainDesktop.sln
```bash
# 1. 添加新创建的解决方案文件
git add LanMontainDesktop.sln
git add LanMountainDesktop.sln
# 2. 提交
git commit -m "Add solution file for multi-project structure"
@@ -94,7 +94,7 @@ git push origin v1.0.1
| `.github/workflows/code-quality.yml` | 代码质量检查 | ✅ 可用 |
| `.github/workflows/release.yml` | 多平台发布 | ✅ 可用 |
| `.github/workflows/issue-management.yml` | Issue自动管理 | ✅ 可用 |
| `LanMontainDesktop.sln` | 解决方案文件 | ✅ 已修复 |
| `LanMountainDesktop.sln` | 解决方案文件 | ✅ 已修复 |
---

View File

@@ -1,10 +1,10 @@
# Multi-Platform Build Guide
# Multi-Platform Build Guide
This document explains how to build LanMontainDesktop for Windows, Linux, and macOS.
This document explains how to build LanMountainDesktop for Windows, Linux, and macOS.
## Overview
LanMontainDesktop supports self-contained builds for:
LanMountainDesktop supports self-contained builds for:
- **Windows**: x64 (64-bit) and x86 (32-bit)
- **Linux**: x64 only (AppImage/snap support planned)
- **macOS**: x64 (Intel) and arm64 (Apple Silicon M1/M2/M3)
@@ -67,19 +67,19 @@ brew install dotnet
**Windows (x64):**
```powershell
# Using the PowerShell script
.\LanMontainDesktop\scripts\package.ps1 `
.\LanMountainDesktop\scripts\package.ps1 `
-RuntimeIdentifier win-x64 `
-Version 1.0.0
# Or with dotnet directly
dotnet publish LanMontainDesktop/LanMontainDesktop.csproj `
dotnet publish LanMountainDesktop/LanMountainDesktop.csproj `
-c Release -r win-x64 -o ./publish/win-x64 `
--self-contained -p:PublishSingleFile=true
```
**Windows (x86):**
```powershell
.\LanMontainDesktop\scripts\package.ps1 `
.\LanMountainDesktop\scripts\package.ps1 `
-RuntimeIdentifier win-x86 `
-Version 1.0.0
```
@@ -119,8 +119,8 @@ After building, you'll have a self-contained directory with:
```
publish/[rid]/
├── LanMontainDesktop.exe (Windows)
├── LanMontainDesktop (Linux/macOS - executable)
├── LanMountainDesktop.exe (Windows)
├── LanMountainDesktop (Linux/macOS - executable)
├── libvlc/ (Windows/macOS only)
├── Localization/ (i18n files)
├── Extensions/ (Component extension manifests)
@@ -134,7 +134,7 @@ publish/[rid]/
# Create zip package
$rid = "win-x64"
$version = "1.0.0"
$dir = "LanMontainDesktop-$version-$rid"
$dir = "LanMountainDesktop-$version-$rid"
Copy-Item -Path "./publish/$rid" -Destination $dir -Recurse
Compress-Archive -Path $dir -DestinationPath "$dir.zip"
```
@@ -144,7 +144,7 @@ Compress-Archive -Path $dir -DestinationPath "$dir.zip"
# Create tar.gz package
rid=linux-x64
version=1.0.0
dir="LanMontainDesktop-$version-$rid"
dir="LanMountainDesktop-$version-$rid"
mkdir -p $dir
cp -r ./publish/$rid/* $dir/
tar -czf "$dir.tar.gz" $dir
@@ -218,16 +218,16 @@ tar -czf "$dir.tar.gz" $dir
```bash
# Clean and retry
dotnet clean LanMontainDesktop/LanMontainDesktop.csproj
dotnet clean LanMountainDesktop/LanMountainDesktop.csproj
dotnet restore
dotnet publish LanMontainDesktop/LanMontainDesktop.csproj -c Release -r win-x64 --self-contained
dotnet publish LanMountainDesktop/LanMountainDesktop.csproj -c Release -r win-x64 --self-contained
```
### Linux Build Fails
```bash
# Check dependencies are installed
ldd ./publish/linux-x64/LanMontainDesktop | grep "not found"
ldd ./publish/linux-x64/LanMountainDesktop | grep "not found"
# Install missing libraries
sudo apt-get install -y lib[missing-name]

14
.github/README.md vendored
View File

@@ -1,8 +1,8 @@
# LanMontainDesktop
# LanMountainDesktop
> 你的桌面,不止一面。
`LanMontainDesktop` 是一个基于 Avalonia 的桌面壳层项目,目标不是“做一个启动器”,而是把桌面变成可编排的信息与交互空间。
`LanMountainDesktop` 是一个基于 Avalonia 的桌面壳层项目,目标不是“做一个启动器”,而是把桌面变成可编排的信息与交互空间。
## 项目定位
- 以网格化布局组织桌面组件,支持多页桌面与组件自由摆放。
@@ -18,10 +18,10 @@
- 本地化:内置 `zh-CN``en-US` 资源。
## 工程结构
- `LanMontainDesktop/`桌面端主程序Avalonia
- `LanMontainDesktop.RecommendationBackend/`推荐内容后端服务ASP.NET Core Minimal API
- `LanMountainDesktop/`桌面端主程序Avalonia
- `LanMountainDesktop.RecommendationBackend/`推荐内容后端服务ASP.NET Core Minimal API
- `docs/`:视觉与圆角等规范文档。
- `LanMontainDesktop/ComponentSystem/`:组件定义、注册、放置规则与扩展入口。
- `LanMountainDesktop/ComponentSystem/`:组件定义、注册、放置规则与扩展入口。
## 技术栈
- .NET 10`net10.0`
@@ -33,11 +33,11 @@
## 扩展机制(摘要)
- 组件系统通过 `ComponentRegistry` 合并内置组件与扩展组件。
- 运行时会扫描 `Extensions/Components/*.json`(相对应用输出目录)加载第三方组件清单。
- 扩展契约与字段说明见组件系统文档:`LanMontainDesktop/ComponentSystem/README.md`
- 扩展契约与字段说明见组件系统文档:`LanMountainDesktop/ComponentSystem/README.md`
## 当前状态
- 项目包含桌面端与推荐后端两个子项目,并在同一 solution 中维护。
- 配置默认写入本地:`%LOCALAPPDATA%\LanMontainDesktop\settings.json`
- 配置默认写入本地:`%LOCALAPPDATA%\LanMountainDesktop\settings.json`
- 当前体验以 Windows 为主要目标平台。
## 运行说明

View File

@@ -1,4 +1,4 @@
# 版本号自动同步说明
# 版本号自动同步说明
## 📋 概述
@@ -48,15 +48,15 @@ sed -i "s/<Version>.*<\/Version>/<Version>$VERSION<\/Version>/" file.csproj
### 3. 构建和发布
更新后的版本号被用于:
- 程序集版本 (`AssemblyVersion`)
- 包文件名 (`LanMontainDesktop-1.0.1-win-x64.zip`)
- 包文件名 (`LanMountainDesktop-1.0.1-win-x64.zip`)
- 应用内显示 (About 页面)
- GitHub Release 标题
## 📍 涉及的文件
自动更新的文件:
1. `LanMontainDesktop/LanMontainDesktop.csproj`
2. `LanMontainDesktop.RecommendationBackend/LanMontainDesktop.RecommendationBackend.csproj`
1. `LanMountainDesktop/LanMountainDesktop.csproj`
2. `LanMountainDesktop.RecommendationBackend/LanMountainDesktop.RecommendationBackend.csproj`
## ✅ 使用流程

View File

@@ -1,8 +1,8 @@
# GitHub CI/CD Workflow Setup Guide
# GitHub CI/CD Workflow Setup Guide
## Overview
This document describes the CI/CD workflows configured for LanMontainDesktop. These workflows are designed to maintain code quality, automate testing, and streamline the release process.
This document describes the CI/CD workflows configured for LanMountainDesktop. These workflows are designed to maintain code quality, automate testing, and streamline the release process.
## Workflows
@@ -10,7 +10,7 @@ This document describes the CI/CD workflows configured for LanMontainDesktop. Th
**Trigger:** Every push/PR to main branches, or manual dispatch
**What it does:**
- Builds both LanMontainDesktop and RecommendationBackend in Debug and Release modes
- Builds both LanMountainDesktop and RecommendationBackend in Debug and Release modes
- Runs unit tests (if available)
- Uploads build artifacts for inspection
- Runs on Windows (windows-latest)
@@ -54,7 +54,7 @@ QODANA_ENDPOINT=https://qodana.cloud
| macOS | x64, arm64 (Apple Silicon) | .tar.gz | ✅ Full support |
**Build Scripts:**
- Windows: Uses PowerShell (`LanMontainDesktop\scripts\package.ps1`)
- Windows: Uses PowerShell (`LanMountainDesktop\scripts\package.ps1`)
- Linux/macOS: Uses Bash (`scripts/build.sh`)
**Usage:**
@@ -109,22 +109,22 @@ To align with CI workflows, set up your local environment:
dotnet restore
# Build (like CI does)
dotnet build LanMontainDesktop/LanMontainDesktop.csproj
dotnet build LanMontainDesktop.RecommendationBackend/LanMontainDesktop.RecommendationBackend.csproj
dotnet build LanMountainDesktop/LanMountainDesktop.csproj
dotnet build LanMountainDesktop.RecommendationBackend/LanMountainDesktop.RecommendationBackend.csproj
# Format code locally (required by CI)
dotnet format
# Run tests
dotnet test LanMontainDesktop/LanMontainDesktop.csproj
dotnet test LanMontainDesktop.RecommendationBackend/LanMontainDesktop.RecommendationBackend.csproj
dotnet test LanMountainDesktop/LanMountainDesktop.csproj
dotnet test LanMountainDesktop.RecommendationBackend/LanMountainDesktop.RecommendationBackend.csproj
# Alternative: Use local build scripts (Linux/macOS)
./scripts/build.sh --rid linux-x64 --version 1.0.0
./scripts/build.sh --rid osx-x64 --version 1.0.0
# Or on Windows with the PowerShell script
./LanMontainDesktop/scripts/package.ps1 -RuntimeIdentifier win-x64 -Version 1.0.0
./LanMountainDesktop/scripts/package.ps1 -RuntimeIdentifier win-x64 -Version 1.0.0
```
### Cross-Platform Build Scripts
@@ -150,10 +150,10 @@ chmod +x scripts/build.sh
**Windows:**
```powershell
# Using PowerShell script
.\LanMontainDesktop\scripts\package.ps1 -RuntimeIdentifier win-x64 -Version 1.0.0
.\LanMountainDesktop\scripts\package.ps1 -RuntimeIdentifier win-x64 -Version 1.0.0
# Or use dotnet directly
dotnet publish LanMontainDesktop/LanMontainDesktop.csproj `
dotnet publish LanMountainDesktop/LanMountainDesktop.csproj `
-c Release -r win-x64 -o ./publish/win-x64 `
-p:PublishSingleFile=true --self-contained
```
@@ -210,7 +210,7 @@ git push origin v1.0.0
### Status Badge
Add to your README.md:
```markdown
![Build Status](https://github.com/YOUR_ORG/LanMontainDesktop/workflows/Build%20&%20Test/badge.svg)
![Build Status](https://github.com/YOUR_ORG/LanMountainDesktop/workflows/Build%20&%20Test/badge.svg)
```
### Check Workflow Status

View File

@@ -1,4 +1,4 @@
name: Build
name: Build
on:
push:
@@ -7,7 +7,7 @@ on:
env:
DOTNET_VERSION: '10.0.x'
Solution_Name: LanMontainDesktop.sln
Solution_Name: LanMountainDesktop.sln
jobs:
build-windows:
@@ -41,8 +41,8 @@ jobs:
with:
name: build-windows-${{ matrix.configuration }}
path: |
LanMontainDesktop/bin/${{ matrix.configuration }}/
LanMontainDesktop.RecommendationBackend/bin/${{ matrix.configuration }}/
LanMountainDesktop/bin/${{ matrix.configuration }}/
LanMountainDesktop.RecommendationBackend/bin/${{ matrix.configuration }}/
retention-days: 7
build-linux:
@@ -80,8 +80,8 @@ jobs:
with:
name: build-linux
path: |
LanMontainDesktop/bin/Release/
LanMontainDesktop.RecommendationBackend/bin/Release/
LanMountainDesktop/bin/Release/
LanMountainDesktop.RecommendationBackend/bin/Release/
retention-days: 7
build-macos:
@@ -111,6 +111,6 @@ jobs:
with:
name: build-macos
path: |
LanMontainDesktop/bin/Release/
LanMontainDesktop.RecommendationBackend/bin/Release/
LanMountainDesktop/bin/Release/
LanMountainDesktop.RecommendationBackend/bin/Release/
retention-days: 7

View File

@@ -1,4 +1,4 @@
name: Quality Check
name: Quality Check
on:
pull_request:
@@ -8,7 +8,7 @@ on:
env:
DOTNET_VERSION: '10.0.x'
Solution_Name: LanMontainDesktop.sln
Solution_Name: LanMountainDesktop.sln
jobs:
analyze:

View File

@@ -1,4 +1,4 @@
name: Release
name: Release
on:
push:
@@ -18,7 +18,7 @@ on:
env:
DOTNET_VERSION: '10.0.x'
Solution_Name: LanMontainDesktop.sln
Solution_Name: LanMountainDesktop.sln
jobs:
prepare:
@@ -65,8 +65,8 @@ jobs:
run: |
$VERSION = "${{ needs.prepare.outputs.version }}"
$csprojFiles = @(
"LanMontainDesktop/LanMontainDesktop.csproj",
"LanMontainDesktop.RecommendationBackend/LanMontainDesktop.RecommendationBackend.csproj"
"LanMountainDesktop/LanMountainDesktop.csproj",
"LanMountainDesktop.RecommendationBackend/LanMountainDesktop.RecommendationBackend.csproj"
)
foreach ($csprojPath in $csprojFiles) {
@@ -85,7 +85,7 @@ jobs:
- name: Publish
run: |
dotnet publish LanMontainDesktop/LanMontainDesktop.csproj `
dotnet publish LanMountainDesktop/LanMountainDesktop.csproj `
-c Release `
-o ./publish/windows-${{ matrix.arch }} `
--self-contained `
@@ -99,7 +99,7 @@ jobs:
$version = "${{ needs.prepare.outputs.version }}"
$arch = "${{ matrix.arch }}"
$source = "publish/windows-$arch"
$package = "LanMontainDesktop-$version-win-$arch"
$package = "LanMountainDesktop-$version-win-$arch"
New-Item -ItemType Directory -Path "$package" -Force | Out-Null
Copy-Item -Path "$source/*" -Destination "$package" -Recurse -Force
@@ -112,7 +112,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: release-windows-${{ matrix.arch }}
path: LanMontainDesktop-*.zip
path: LanMountainDesktop-*.zip
retention-days: 30
build-linux:
@@ -145,11 +145,11 @@ jobs:
- name: Update version in .csproj
run: |
VERSION="${{ needs.prepare.outputs.version }}"
echo "Updating version in LanMontainDesktop.csproj to $VERSION"
sed -i "s/<Version>.*<\/Version>/<Version>$VERSION<\/Version>/" LanMontainDesktop/LanMontainDesktop.csproj
echo "Updating version in LanMountainDesktop.csproj to $VERSION"
sed -i "s/<Version>.*<\/Version>/<Version>$VERSION<\/Version>/" LanMountainDesktop/LanMountainDesktop.csproj
echo "Updating version in LanMontainDesktop.RecommendationBackend.csproj to $VERSION"
sed -i "s/<Version>.*<\/Version>/<Version>$VERSION<\/Version>/" LanMontainDesktop.RecommendationBackend/LanMontainDesktop.RecommendationBackend.csproj
echo "Updating version in LanMountainDesktop.RecommendationBackend.csproj to $VERSION"
sed -i "s/<Version>.*<\/Version>/<Version>$VERSION<\/Version>/" LanMountainDesktop.RecommendationBackend/LanMountainDesktop.RecommendationBackend.csproj
- name: Restore
run: dotnet restore ${{ env.Solution_Name }}
@@ -159,7 +159,7 @@ jobs:
- name: Publish
run: |
dotnet publish LanMontainDesktop/LanMontainDesktop.csproj \
dotnet publish LanMountainDesktop/LanMountainDesktop.csproj \
-c Release \
-o ./publish/linux-x64 \
--self-contained \
@@ -171,7 +171,7 @@ jobs:
run: |
version="${{ needs.prepare.outputs.version }}"
source="publish/linux-x64"
package_name="lanmontaindesktop"
package_name="LanMountainDesktop"
package_version="${version}"
arch="amd64"
@@ -195,7 +195,7 @@ jobs:
EOF
# Set proper permissions
chmod 755 "build-deb/usr/local/bin/LanMontainDesktop"
chmod 755 "build-deb/usr/local/bin/LanMountainDesktop"
# Create DEB file
dpkg-deb --build "build-deb" "${package_name}_${package_version}_${arch}.deb"
@@ -233,11 +233,11 @@ jobs:
- name: Update version in .csproj
run: |
VERSION="${{ needs.prepare.outputs.version }}"
echo "Updating version in LanMontainDesktop.csproj to $VERSION"
sed -i '' "s/<Version>.*<\/Version>/<Version>$VERSION<\/Version>/" LanMontainDesktop/LanMontainDesktop.csproj
echo "Updating version in LanMountainDesktop.csproj to $VERSION"
sed -i '' "s/<Version>.*<\/Version>/<Version>$VERSION<\/Version>/" LanMountainDesktop/LanMountainDesktop.csproj
echo "Updating version in LanMontainDesktop.RecommendationBackend.csproj to $VERSION"
sed -i '' "s/<Version>.*<\/Version>/<Version>$VERSION<\/Version>/" LanMontainDesktop.RecommendationBackend/LanMontainDesktop.RecommendationBackend.csproj
echo "Updating version in LanMountainDesktop.RecommendationBackend.csproj to $VERSION"
sed -i '' "s/<Version>.*<\/Version>/<Version>$VERSION<\/Version>/" LanMountainDesktop.RecommendationBackend/LanMountainDesktop.RecommendationBackend.csproj
- name: Restore
run: dotnet restore ${{ env.Solution_Name }}
@@ -247,7 +247,7 @@ jobs:
- name: Publish
run: |
dotnet publish LanMontainDesktop/LanMontainDesktop.csproj \
dotnet publish LanMountainDesktop/LanMountainDesktop.csproj \
-c Release \
-o ./publish/macos-${{ matrix.arch }} \
--self-contained \
@@ -260,7 +260,7 @@ jobs:
version="${{ needs.prepare.outputs.version }}"
arch="${{ matrix.arch }}"
source="publish/macos-$arch"
app_name="LanMontainDesktop"
app_name="LanMountainDesktop"
package_name="${app_name}-${version}-macos-${arch}"
# Create app bundle structure
@@ -277,7 +277,7 @@ jobs:
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>LanMontainDesktop</string>
<string>LanMountainDesktop</string>
<key>CFBundleName</key>
<string>LanMountain Desktop</string>
<key>CFBundleVersion</key>