Skip to content
This repository was archived by the owner on Aug 30, 2025. It is now read-only.

Commit 6053f9f

Browse files
committed
Update .net SDK to 6.0.300
Update pipelines
1 parent 09ee149 commit 6053f9f

4 files changed

Lines changed: 69 additions & 40 deletions

File tree

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,47 @@
1-
name: 'Publish Nuget'
1+
name: 'Publish nuget'
2+
3+
24

35
on:
46
push:
57
branches:
6-
- main
8+
- deploy-nuget
9+
10+
11+
12+
env:
13+
SDK_VERSION: '6.0.300'
14+
PACKAGE_PATH: ./src/**/*.nupkg
15+
NUGET_SERVER: https://api.nuget.org/v3/index.json
16+
717

818

919
jobs:
1020

1121
deploy-nuget:
12-
name: "Deploy NuGet"
22+
name: "Deploy nuget"
1323
runs-on: ubuntu-latest
1424

1525
steps:
16-
- uses: actions/checkout@main
26+
- name: "Checkout"
27+
uses: actions/checkout@v3
1728

18-
- name: Setup .NET
29+
- name: "Setup .NET"
1930
uses: actions/setup-dotnet@v2
2031
with:
21-
dotnet-version: '6.0.202'
32+
dotnet-version: ${{ env.SDK_VERSION }}
2233

23-
- name: Restore dependencies
34+
- name: "Restore dependencies"
2435
run: dotnet restore
2536

26-
- name: Build
27-
run: dotnet build --configuration Release
37+
- name: "Build"
38+
run: dotnet build --configuration Release --no-restore
39+
40+
- name: "Test"
41+
run: dotnet test --configuration Release --no-build
2842

29-
- name: Create the Package
30-
run: dotnet pack --configuration Release
43+
- name: "Pack"
44+
run: dotnet pack --configuration Release --no-build
3145

32-
- name: Publish
33-
run: dotnet nuget push "./src/bin/PowerUtils.AspNetCore.ErrorHandler.*.nupkg" -k ${{ secrets.NUGET_TOKEN }} -s https://api.nuget.org/v3/index.json
46+
- name: "Publish nuget"
47+
run: dotnet nuget push ${{ env.PACKAGE_PATH }} --api-key ${{ secrets.NUGET_TOKEN }} --source ${{ env.NUGET_SERVER }} --skip-duplicate

.github/workflows/sonarcloud.yml

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: 'SonarCloud'
22

3+
4+
35
on:
46
push:
57
branches:
@@ -10,57 +12,64 @@ on:
1012
- main
1113

1214

15+
16+
env:
17+
SDK_VERSION: '6.0.300'
18+
19+
20+
1321
jobs:
1422

1523
sonar-scanner:
1624
name: "Sonar scanner"
1725
runs-on: windows-latest
18-
steps:
1926

20-
- name: Setup .NET
27+
steps:
28+
- name: "Setup .NET"
2129
uses: actions/setup-dotnet@v2
2230
with:
23-
dotnet-version: '6.0.202'
31+
dotnet-version: ${{ env.SDK_VERSION }}
2432

25-
- name: Set up JDK 11
33+
- name: "Set up JDK 11"
2634
uses: actions/setup-java@v3.3.0
2735
with:
2836
distribution: 'adopt'
2937
java-version: '11'
3038

31-
- uses: actions/checkout@v2
39+
- name: "Checkout"
40+
uses: actions/checkout@v3
3241
with:
3342
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
3443

35-
- name: Cache SonarCloud packages
36-
uses: actions/cache@v3.0.2
44+
- name: "Cache SonarCloud packages"
45+
uses: actions/cache@v3
3746
with:
3847
path: ~\sonar\cache
3948
key: ${{ runner.os }}-sonar
4049
restore-keys: ${{ runner.os }}-sonar
4150

42-
- name: Cache SonarCloud scanner
51+
- name: "Cache SonarCloud scanner"
4352
id: cache-sonar-scanner
44-
uses: actions/cache@v3.0.2
53+
uses: actions/cache@v3
4554
with:
4655
path: .\.sonar\scanner
4756
key: ${{ runner.os }}-sonar-scanner
4857
restore-keys: ${{ runner.os }}-sonar-scanner
4958

50-
- name: Install SonarCloud scanner
59+
- name: "Install SonarCloud scanner"
5160
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
5261
shell: pwsh
5362
run: |
5463
New-Item -Path .\.sonar\scanner -ItemType Directory
5564
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
5665
57-
- name: Build and analyze
66+
- name: "Build and analyze"
5867
env:
5968
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
6069
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
6170
shell: pwsh
6271
run: |
6372
.\.sonar\scanner\dotnet-sonarscanner begin /k:"${{ secrets.SONAR_PROJECT_KEY }}" /o:"${{ secrets.SONAR_ORGANIZATION }}" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
64-
dotnet build --configuration Release
65-
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
66-
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
73+
dotnet build
74+
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --no-build
75+
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"

.github/workflows/test-project.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,40 @@
11
name: 'Tests'
22

3+
4+
35
on:
4-
push:
5-
branches:
6-
- develop
76
pull_request:
87
types: [opened, reopened, synchronize]
98
branches:
109
- main
1110

1211

12+
13+
env:
14+
SDK_VERSION: '6.0.300'
15+
16+
17+
1318
jobs:
1419

1520
test-project:
16-
name: "Testing project"
21+
name: "Test nuget"
1722
runs-on: ubuntu-latest
1823

1924
steps:
20-
- uses: actions/checkout@v2
25+
- name: "Checkout"
26+
uses: actions/checkout@v3
2127

22-
- name: Setup .NET
28+
- name: "Setup .NET"
2329
uses: actions/setup-dotnet@v2
2430
with:
25-
dotnet-version: '6.0.202'
31+
dotnet-version: ${{ env.SDK_VERSION }}
2632

27-
- name: Restore dependencies
33+
- name: "Restore dependencies"
2834
run: dotnet restore
2935

30-
- name: Build
31-
run: dotnet build --no-restore
36+
- name: "Build"
37+
run: dotnet build --configuration Release --no-restore
3238

33-
- name: Test
34-
run: dotnet test --no-build
39+
- name: "Test"
40+
run: dotnet test --configuration Release --no-build

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"sdk": {
3-
"version": "6.0.202"
3+
"version": "6.0.300"
44
}
55
}

0 commit comments

Comments
 (0)