File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed
Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change 99 runs-on : ${{ matrix.os }}
1010 strategy :
1111 matrix :
12- os : [windows-latest, ubuntu-latest]
13- runtime : [win-x64, linux-x64]
12+ # 预定义每个OS对应的runtime和shell,避开三元表达式
13+ include :
14+ - os : windows-latest
15+ runtime : win-x64
16+ shell : pwsh
17+ - os : ubuntu-latest
18+ runtime : linux-x64
19+ shell : bash
1420
1521 steps :
22+ # 步骤1:拉取代码(缩进6个空格,以下步骤统一)
1623 - name : Checkout code
1724 uses : actions/checkout@v4
1825
26+ # 步骤2:安装.NET SDK(第23行对应这里的dotnet-version)
1927 - name : Setup .NET SDK
2028 uses : actions/setup-dotnet@v4
2129 with :
22- dotnet-version :
23- - ' 8.0.x'
30+ dotnet-version : # 父级缩进10个空格
31+ - ' 8.0.x' # 数组项缩进12个空格(比父级多2个空格)
2432
33+ # 步骤3:恢复依赖
2534 - name : Restore dependencies
2635 run : dotnet restore ./src/c#/GeneralUpdate.sln
2736
37+ # 步骤4:AOT编译检测(用预定义的shell,无三元表达式)
2838 - name : Check AOT compilation
29- # 修正:用引号包裹表达式,避免YAML解析器误判特殊字符(第29行)
30- shell : " ${{ matrix.os == 'windows-latest' ? 'pwsh' : 'bash' }}"
39+ shell : ${{ matrix.shell }}
3140 run : |
3241 dotnet publish ./src/c#/GeneralUpdate.Client/GeneralUpdate.Client.csproj \
3342 -c Release \
3948 env :
4049 DOTNET_CLI_TELEMETRY_OPTOUT : 1
4150
51+ # 步骤5:验证AOT输出
4252 - name : Verify AOT output
4353 shell : pwsh
4454 run : |
You can’t perform that action at this time.
0 commit comments