Skip to content

Commit

Permalink
Stick to .NET SDK 6 for CI builds
Browse files Browse the repository at this point in the history
  • Loading branch information
bradwilson committed Aug 16, 2023
1 parent ecbd505 commit 966a5b7
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/.global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "6.0.300",
"rollForward": "latestMinor"
}
}
9 changes: 8 additions & 1 deletion .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,23 @@ jobs:
uses: microsoft/setup-msbuild@v1
if: matrix.os == 'windows-2022'

- name: Replace global.json
run: cp .github/workflows/.global.json global.json
shell: bash

- name: Install .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
7.0.x
- name: Get .NET information
run: dotnet --info

- name: Get Mono information
run: mono --version
if: ${{ matrix.os != 'windows-2022' }}

- name: "Build target: BuildAll"
run: dotnet run --project tools/builder --no-launch-profile -- BuildAll --timing

Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/push-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,22 @@ jobs:
fetch-depth: 0
submodules: true

- name: Replace global.json
run: cp .github/workflows/.global.json global.json
shell: bash

- name: Install .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
7.0.x
- name: Get .NET information
run: dotnet --info

- name: Get Mono information
run: mono --version

- name: "Build target: BuildAll"
run: dotnet run --project tools/builder --no-launch-profile -- BuildAll --timing

Expand Down
4 changes: 2 additions & 2 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ else
fi

if which dotnet > /dev/null; then
if [ $(dotnet --version | cut -d. -f1) -lt 7 ]; then
echo "error(1): .NET SDK version $(dotnet --version) is too low; please install 7.0 or later"
if [ $(dotnet --version | cut -d. -f1) -lt 6 ]; then
echo "error(1): .NET SDK version $(dotnet --version) is too low; please install 6.0 or later"
exit 1
fi

Expand Down
4 changes: 2 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ if ($null -eq (Get-Command "dotnet" -ErrorAction Ignore)) {
}

$version = [Version]$([regex]::matches((&dotnet --version), '^(\d+\.)?(\d+\.)?(\*|\d+)').value)
if ($version.Major -lt 7) {
throw ".NET SDK version ($version) is too low; please install version 7.0 or later"
if ($version.Major -lt 6) {
throw ".NET SDK version ($version) is too low; please install version 6.0 or later"
}

if ($null -eq (Get-Command "msbuild.exe" -ErrorAction Ignore)) {
Expand Down

0 comments on commit 966a5b7

Please sign in to comment.