Skip to content

Commit 581390c

Browse files
committed
Update dotnet-ci.yaml
1 parent 292da26 commit 581390c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

.github/workflows/dotnet-ci.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: Publish NuGet to Releases
22

3-
# 手动触发工作流,支持输入版本号
43
on:
54
workflow_dispatch:
65
inputs:
@@ -19,28 +18,30 @@ jobs:
1918
- name: 安装.NET SDK
2019
uses: actions/setup-dotnet@v4
2120
with:
22-
dotnet-version: '9.0.x'
21+
dotnet-version: '9.0.x' # 与现有CI配置保持一致
2322

2423
- name: 恢复依赖
25-
run: dotnet restore ./src/c#/GeneralUpdate.sln
24+
run: dotnet restore ./src/c#/GeneralUpdate.sln # 使用解决方案统一恢复
2625

27-
- name: 构建并打包NuGet
26+
- name: 构建项目(确保生成DLL)
27+
run: dotnet build ./src/c#/GeneralUpdate.sln -c Release --no-restore # 显式构建,避免重复恢复
28+
29+
- name: 打包NuGet包
2830
run: |
29-
# 定义需要发布的组件列表
3031
$projects = @(
3132
"GeneralUpdate.Bowl",
3233
"GeneralUpdate.ClientCore",
3334
"GeneralUpdate.Core",
3435
"GeneralUpdate.Differential"
3536
)
3637
37-
# 循环打包每个组件,使用统一版本号
3838
foreach ($project in $projects) {
3939
dotnet pack ./src/c#/$project/$project.csproj `
4040
-c Release `
4141
-o ./nupkgs `
4242
-p:Version=${{ github.event.inputs.version }} `
43-
-p:PackageVersion=${{ github.event.inputs.version }}
43+
-p:PackageVersion=${{ github.event.inputs.version }} `
44+
--no-build # 避免重复构建,使用已生成的文件
4445
}
4546
shell: pwsh
4647

0 commit comments

Comments
 (0)