Skip to content

Commit 3dc041c

Browse files
committed
Update dotnet-aot-check.yaml
1 parent ac30f61 commit 3dc041c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

.github/workflows/dotnet-aot-check.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,24 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v3
1111
- name: Setup .NET SDK
12-
uses: actions/setup-dotnet@v4 # 升级到最新版setup-dotnet,确保兼容性
12+
uses: actions/setup-dotnet@v4
1313
with:
1414
dotnet-version: '9.0.x'
1515
- name: Restore dependencies
16-
run: dotnet restore ./src/c#/GeneralUpdate.sln # 确保所有项目依赖还原
16+
run: dotnet restore ./src/c#/GeneralUpdate.sln
1717

18-
- name: Check AOT support (Client app)
18+
# 合并检查AOT和分析结果的步骤,确保共享同一个执行环境
19+
- name: Check AOT support (Client app) and analyze result
1920
run: |
21+
# 执行AOT发布并捕获退出码
2022
dotnet publish ./src/c#/GeneralUpdate.Client/GeneralUpdate.Client.csproj `
2123
-c Release `
2224
-r win-x64
23-
24-
- name: Analyze AOT result
25-
run: |
25+
26+
# 立即检查当前环境的退出码(同一个step内有效)
2627
if ($LASTEXITCODE -eq 0) {
2728
Write-Host "✅ GeneralUpdate.Client 支持AOT编译"
2829
} else {
2930
Write-Host "❌ GeneralUpdate.Client 不支持AOT编译,请检查错误日志"
30-
exit 1 # 可选:让Workflow失败以提示问题
31+
exit 1 # 让step失败,触发Workflow失败
3132
}

0 commit comments

Comments
 (0)