Skip to content

配置 GitHub Packages 支持 CI 构建#2

Merged
BAKAOLC merged 3 commits into
mainfrom
setup-github-packages
Nov 15, 2025
Merged

配置 GitHub Packages 支持 CI 构建#2
BAKAOLC merged 3 commits into
mainfrom
setup-github-packages

Conversation

@BAKAOLC

@BAKAOLC BAKAOLC commented Nov 14, 2025

Copy link
Copy Markdown
Collaborator

变更内容

  • 添加 GitHub Actions workflow 配置(build.yml, release.yml)
  • 更新项目文件支持 CI 环境自动使用 NuGet 包
  • 本地开发默认使用游戏目录,CI 环境使用 DuckovGameLibs 包
  • 更新 NuGet 包版本号为 1.1.6-Steam
  • 配置 .NET 版本为 10.x
  • 添加 packages:read 权限以访问 GitHub Packages
  • 在 build workflow 中添加 artifact 上传步骤,便于下载测试构建产物

功能说明

  • CI 环境:自动检测并使用 GitHub Packages 中的 DuckovGameLibs 包
  • 本地开发:默认使用游戏目录的 DLL,无需配置 NuGet
  • 灵活性:可通过 /p:UseGameLibsFromNuGet=true 强制使用 NuGet 包
  • 构建产物:每次构建完成后自动上传 zip 包到 artifact,保留 7 天,方便下载测试

Copilot AI review requested due to automatic review settings November 14, 2025 23:56
@BAKAOLC BAKAOLC force-pushed the setup-github-packages branch from 358fe39 to 11b6e84 Compare November 14, 2025 23:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR configures GitHub Actions CI/CD workflows and enables dual-mode dependency management for the project: NuGet packages in CI environments and local game directory references for development.

Key Changes:

  • Added two GitHub Actions workflows for automated build and release processes
  • Modified project files to conditionally use NuGet packages (DuckovGameLibs 1.1.6-Steam) in CI or local game DLLs in development
  • Implemented automatic detection of CI environment through $(CI) and $(GITHUB_ACTIONS) MSBuild variables

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
DuckovCustomModelRegister/DuckovCustomModelRegister.csproj Added conditional logic to switch between NuGet package and local game directory references based on environment
DuckovCustomModel/DuckovCustomModel.csproj Added conditional logic to switch between NuGet package and local game directory references based on environment
.github/workflows/build.yml New workflow for building on main/develop branches and pull requests, includes test execution
.github/workflows/release.yml New workflow for creating releases when version tags are pushed, includes artifact upload and GitHub release creation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@BAKAOLC BAKAOLC force-pushed the setup-github-packages branch from 332c348 to cdad7dc Compare November 15, 2025 00:01
- 添加 GitHub Actions workflow 配置(build.yml, release.yml)
- 更新项目文件支持 CI 环境自动使用 NuGet 包
- 本地开发默认使用游戏目录,CI 环境使用 DuckovGameLibs 包
- 更新 NuGet 包版本号为 1.1.6-Steam
- 配置 .NET 版本为 10.x
- 添加 packages:read 权限以访问 GitHub Packages
@BAKAOLC BAKAOLC force-pushed the setup-github-packages branch 2 times, most recently from ac46122 to c08fad3 Compare November 15, 2025 00:30
@BAKAOLC BAKAOLC force-pushed the setup-github-packages branch from e539483 to 0371d2c Compare November 15, 2025 00:42

@BAKAOLC BAKAOLC left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checked

@BAKAOLC BAKAOLC merged commit e1f74c5 into main Nov 15, 2025
1 check passed
@BAKAOLC BAKAOLC deleted the setup-github-packages branch November 15, 2025 01:16
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