File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 2828 - cron : ' 13 20 03,16 * *'
2929 workflow_dispatch :
3030
31+ env :
32+ # cSpell:disable
33+ MINIMAL_DOTNET_SDK_VERSION : 10.0.100
34+ # cSpell:enable
35+
3136# cSpell:ignore autobuild
3237jobs :
3338 analyze :
6671 if : ${{ (matrix.build-mode == 'autobuild') || (matrix.build-mode == '') }}
6772 uses : github/codeql-action/autobuild@v4
6873
74+ - name : Check .NET SDK ${{ env.MINIMAL_DOTNET_SDK_VERSION }} is installed
75+ id : dotnet-sdk-version
76+ if : ${{ (matrix.build-mode == 'manual') && (matrix.language == 'csharp') }}
77+ shell : pwsh
78+ run : |
79+ $installed_version = [System.Version]::Parse($(dotnet --version))
80+ $required_version = [System.Version]::Parse('${{ env.MINIMAL_DOTNET_SDK_VERSION }}')
81+
82+ if ( $required_version -gt $installed_version ) {
83+ # required SDK version is not installed
84+ "::notice::.NET SDK version: installed ${installed_version}, required ${required_version}"
85+
86+ "install-dotnet-sdk-version=${required_version}" >> $Env:GITHUB_OUTPUT
87+ }
88+
89+ - name : Install .NET SDK ${{ steps.dotnet-sdk-version.outputs.install-dotnet-sdk-version }}
90+ if : ${{ (matrix.build-mode == 'manual') && (matrix.language == 'csharp') && (steps.dotnet-sdk-version.outputs.install-dotnet-sdk-version != '') }}
91+ uses : actions/setup-dotnet@v5.0.0
92+ with :
93+ dotnet-version : ' ${{ steps.dotnet-sdk-version.outputs.install-dotnet-sdk-version }}'
94+
6995 - name : Build all .NET projects
7096 if : ${{ (matrix.build-mode == 'manual') && (matrix.language == 'csharp') }}
7197 run : |
You can’t perform that action at this time.
0 commit comments