Skip to content

Commit 944622d

Browse files
authored
Upgrade to .NET Core SDK 3.1. (#395)
* Upgrade to .NET Core SDK 3.1. * Add workaround for setup-dotnet not supporting SxS dotnet installs. * Specify explicit fetch depth of 0 for Nerdbank.GitVersioning. * Make step names consistent across workflows. * Coerce robocopy's exit code when it does not indicate an error. * Make robocopy as quiet as possible.
1 parent 3164e92 commit 944622d

File tree

4 files changed

+57
-14
lines changed

4 files changed

+57
-14
lines changed

.github/workflows/dotnet.yaml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,35 @@ jobs:
88
os: [ubuntu-latest, windows-latest, macOS-latest]
99
name: Dotnet build
1010
steps:
11-
- uses: actions/checkout@master
11+
- uses: actions/checkout@v1
1212
with:
1313
fetch-depth: 0
14-
- name: Setup dotnet
14+
- name: Setup dotnet runtime 2.0.9
1515
uses: actions/setup-dotnet@v1
1616
with:
17-
dotnet-version: 2.2.108
18-
- run: dotnet build --configuration Release
19-
- name: test with dotnet
17+
dotnet-version: 2.1.202
18+
- name: Setup dotnet runtime 2.1.17
19+
uses: actions/setup-dotnet@v1
20+
with:
21+
dotnet-version: 2.1.805
22+
- name: Setup dotnet SDK 3.1
23+
uses: actions/setup-dotnet@v1
24+
with:
25+
dotnet-version: 3.1.201
26+
- name: Setup SxS dotnet
27+
if: matrix.os == 'windows-latest'
28+
run: |
29+
(robocopy %DOTNET_ROOT:3.1.201=2.1.805% %DOTNET_ROOT% /E /XC /XN /XO /NFL /NDL /NJH /NJS /NP) ^& if %ERRORLEVEL% geq 8 exit /B %ERRORLEVEL%
30+
(robocopy %DOTNET_ROOT:3.1.201=2.1.202% %DOTNET_ROOT% /E /XC /XN /XO /NFL /NDL /NJH /NJS /NP) ^& if %ERRORLEVEL% geq 8 exit /B %ERRORLEVEL%
31+
exit /B 0
32+
shell: cmd
33+
- name: Setup SxS dotnet
34+
if: matrix.os != 'windows-latest'
35+
run: |
36+
rsync --archive --ignore-existing ${DOTNET_ROOT/3.1.201/2.1.805}/ ${DOTNET_ROOT/3.1.201/2.1.202}/ $DOTNET_ROOT
37+
- name: Build
38+
run: dotnet build --configuration Release
39+
- name: Test
2040
run: dotnet test /p:CollectCoverage=true /p:ExcludeByFile=\"**/KubernetesClient/generated/**/*.cs\" /p:CoverletOutputFormat="cobertura"
2141
# - uses: 5monkeys/cobertura-action@master
2242
# with:

.github/workflows/nuget.yaml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,30 @@ jobs:
1111

1212
steps:
1313
- uses: actions/checkout@v1
14-
- name: Setup .NET Core
14+
with:
15+
fetch-depth: 0
16+
- name: Setup dotnet runtime 2.0.9
17+
uses: actions/setup-dotnet@v1
18+
with:
19+
dotnet-version: 2.1.202
20+
- name: Setup dotnet runtime 2.1.17
21+
uses: actions/setup-dotnet@v1
22+
with:
23+
dotnet-version: 2.1.805
24+
- name: Setup dotnet SDK 3.1
1525
uses: actions/setup-dotnet@v1
1626
with:
17-
dotnet-version: 2.2.108
18-
- name: test with dotnet
27+
dotnet-version: 3.1.201
28+
- name: Setup SxS dotnet
29+
if: matrix.os == 'windows-latest'
30+
run: |
31+
(robocopy %DOTNET_ROOT:3.1.201=2.1.805% %DOTNET_ROOT% /E /XC /XN /XO /NFL /NDL /NJH /NJS /NP) ^& if %ERRORLEVEL% geq 8 exit /B %ERRORLEVEL%
32+
(robocopy %DOTNET_ROOT:3.1.201=2.1.202% %DOTNET_ROOT% /E /XC /XN /XO /NFL /NDL /NJH /NJS /NP) ^& if %ERRORLEVEL% geq 8 exit /B %ERRORLEVEL%
33+
exit /B 0
34+
shell: cmd
35+
- name: Test
1936
run: dotnet test
20-
- name: pack
37+
- name: Pack
2138
run: dotnet pack --configuration Release src/KubernetesClient -o pkg
22-
- name: push
23-
run: dotnet nuget push pkg\*.nupkg -s https://www.nuget.org/ -k ${{ secrets.nuget_api_key }}
39+
- name: Push
40+
run: dotnet nuget push pkg\*.nupkg -s https://www.nuget.org/ -k ${{ secrets.nuget_api_key }}

install-linux.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microso
55
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
66
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
77
sudo apt-get -qq update
8-
sudo apt-get install -y dotnet-sdk-2.2
8+
sudo apt-get install -y dotnet-runtime-2.0.9
9+
sudo apt-get install -y dotnet-runtime-2.1
10+
sudo apt-get install -y dotnet-sdk-3.1
911

1012
echo 'Installing kubectl'
1113
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.13.4/bin/linux/amd64/kubectl

install-osx.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
#!/bin/sh
22
echo 'Installing .NET Core...'
33

4-
wget https://download.visualstudio.microsoft.com/download/pr/4850aa8f-44a9-4c4a-9961-f18aa4d90ceb/07d790444f3ba6b412a76d6f1aced338/dotnet-sdk-2.2.105-osx-x64.pkg -O ~/dotnet-sdk-2.2.105-osx-x64.pkg
4+
wget https://download.microsoft.com/download/3/a/3/3a3bda26-560d-4d8e-922e-6f6bc4553a84/dotnet-runtime-2.0.9-osx-x64.pkg -O ~/dotnet-runtime-2.0.9-osx-x64.pkg
5+
wget https://download.visualstudio.microsoft.com/download/pr/9d3edcf8-2da1-42eb-a30f-54d629c8f13f/2e967304f8f3543c7329fd53d292d076/dotnet-runtime-2.1.17-osx-x64.pkg -O ~/dotnet-runtime-2.1.17-osx-x64.pkg
6+
wget https://download.visualstudio.microsoft.com/download/pr/905598d0-17a3-4b42-bf13-c5a69d7aac87/853aff73920dcb013c09a74f05da7f6a/dotnet-sdk-3.1.201-osx-x64.pkg -O ~/dotnet-sdk-3.1.201-osx-x64.pkg
57

6-
sudo installer -pkg ~/dotnet-sdk-2.2.105-osx-x64.pkg -target /
8+
sudo installer -pkg ~/dotnet-runtime-2.0.9-osx-x64.pkg -target /
9+
sudo installer -pkg ~/dotnet-runtime-2.1.17-osx-x64.pkg -target /
10+
sudo installer -pkg ~/dotnet-sdk-3.1.201-osx-x64.pkg -target /
711

812
# https://github.com/dotnet/cli/issues/2544
913
ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/

0 commit comments

Comments
 (0)