Skip to content

升级整个项目到 .NET 10 / Upgrade entire project to .NET 10#11

Merged
LazuliKao merged 4 commits intomainfrom
copilot/upgrade-to-dotnet-10
Oct 17, 2025
Merged

升级整个项目到 .NET 10 / Upgrade entire project to .NET 10#11
LazuliKao merged 4 commits intomainfrom
copilot/upgrade-to-dotnet-10

Conversation

Copy link
Contributor

Copilot AI commented Oct 17, 2025

概述 / Overview

本 PR 将 HuaJiBot.NET 项目从 .NET 9 升级到 .NET 10,为未来的 .NET 10 发布做好准备。

This PR upgrades the HuaJiBot.NET project from .NET 9 to .NET 10, preparing the project for the upcoming .NET 10 release.

主要变更 / Key Changes

1. 项目文件 / Project Files

更新了 14 个项目文件的目标框架从 net9.0net10.0

  • 核心项目:HuaJiBot.NET, HuaJiBot.NET.CLI
  • 适配器:OneBot, Satori, Telegram, Lagrange
  • 插件:RepairTeam, AutoReply, Scripting, Calendar, AIChat, MessageBridge, GitHubBridge
  • 测试:HuaJiBot.NET.UnitTest

注意:HuaJiBot.NET.SourceGenerator 保持 netstandard2.0 目标框架,以确保与 Roslyn 分析器的兼容性。

Updated 14 project files from net9.0 to net10.0 target framework, while keeping the SourceGenerator at netstandard2.0 for Roslyn compatibility.

2. Docker 支持 / Docker Support

更新 Dockerfile

  • SDK 镜像:mcr.microsoft.com/dotnet/sdk:9.0-alpine10.0-alpine
  • 运行时镜像:mcr.microsoft.com/dotnet/runtime:9.0-alpine10.0-azurelinux3.0-distroless
  • 发布框架参数:--framework net9.0--framework net10.0
  • 迁移到 distroless 运行时镜像,提供更安全、更小的容器镜像

Migrated to distroless runtime image (10.0-azurelinux3.0-distroless) for improved security and smaller container size.

3. CI/CD

更新 GitHub Actions 工作流 (.github/workflows/build-plugins.yml):

  • 使用 .NET 10.x SDK 进行构建

Updated GitHub Actions workflow to use .NET 10.x SDK for builds.

4. 构建脚本 / Build Scripts

更新 build.sh 脚本中的框架版本参数

5. 文档 / Documentation

更新 README.md 中的开发要求,将 .NET SDK 版本从 8 更新到 10

影响范围 / Impact

  • ✅ 所有更改都是最小化的,仅涉及版本号更新
  • ✅ 不影响现有代码逻辑和功能
  • ✅ 保持了源代码生成器的 .NET Standard 2.0 兼容性
  • ✅ 所有配置文件保持一致性
  • ✅ Distroless 镜像提供更高的安全性和更小的攻击面

All changes are minimal and surgical, affecting only version numbers without impacting existing code logic or functionality. The distroless runtime image provides enhanced security with minimal attack surface.

测试 / Testing

项目配置已更新完成,待 .NET 10 SDK 正式发布后即可进行构建和测试。

The project configuration is now ready and will be able to build once the .NET 10 SDK is officially released.

文件统计 / File Statistics

  • 18 个文件被修改 / 18 files modified
  • 纯版本号替换和容器镜像优化,无逻辑变更 / Version replacements and container image optimization, no logic changes

关闭 / Closes #[issue_number]

Original prompt

整个项目升级.NET 10


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits October 17, 2025 06:58
Co-authored-by: LazuliKao <46601807+LazuliKao@users.noreply.github.com>
Co-authored-by: LazuliKao <46601807+LazuliKao@users.noreply.github.com>
Copilot AI changed the title [WIP] Update entire project to .NET 10 升级整个项目到 .NET 10 / Upgrade entire project to .NET 10 Oct 17, 2025
Copilot AI requested a review from LazuliKao October 17, 2025 07:04
@LazuliKao LazuliKao marked this pull request as ready for review October 17, 2025 07:05
@LazuliKao
Copy link
Member

Co-authored-by: LazuliKao <46601807+LazuliKao@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 17, 2025

@copilot
参考https://github.com/dotnet/dotnet-docker/blob/main/documentation/distroless.md
把运行时改成基于[10.0-azurelinux3.0-distroless](https://mcr.microsoft.com/en-us/artifact/mar/dot...

Updated Dockerfile to use mcr.microsoft.com/dotnet/runtime:10.0-azurelinux3.0-distroless as the runtime base image. Also removed the RUN commands for creating user and setting permissions since distroless images are non-root by default with a pre-configured app user. (commit: 058fbe5...)

@LazuliKao LazuliKao merged commit e688791 into main Oct 17, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants