File tree 2 files changed +58
-1
lines changed
2 files changed +58
-1
lines changed Original file line number Diff line number Diff line change 5
5
on :
6
6
push :
7
7
branches :
8
- - master
8
+ - main
9
9
- develop
10
10
- " feature/**"
11
11
- " release/**"
Original file line number Diff line number Diff line change
1
+ # This workflow will build a .NET project
2
+
3
+ name : Release
4
+
5
+ on :
6
+ release :
7
+ types : [published]
8
+
9
+ defaults :
10
+ run :
11
+ working-directory : src
12
+
13
+ jobs :
14
+ build :
15
+ env :
16
+ BUILD_CONFIG : " Release"
17
+
18
+ runs-on : ${{ matrix.os }}
19
+ strategy :
20
+ matrix :
21
+ os : [ubuntu-latest]
22
+
23
+ steps :
24
+ - uses : actions/checkout@v3
25
+
26
+ - name : Get Build Version
27
+ run : |
28
+ Import-Module ..\build\GetBuildVersion.psm1
29
+ Write-Host $Env:GITHUB_REF
30
+ $version = GetBuildVersion -VersionString $Env:GITHUB_REF
31
+ echo "BUILD_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
32
+ shell : pwsh
33
+
34
+ - name : Setup .NET
35
+ uses : actions/setup-dotnet@v3
36
+ with :
37
+ dotnet-version : 6.0.x
38
+
39
+ - name : Restore dependencies
40
+ run : dotnet restore
41
+
42
+ - name : Build
43
+ run : dotnet build --configuration $BUILD_CONFIG -p:Version=$BUILD_VERSION --no-restore
44
+
45
+ - name : Test
46
+ run : dotnet test -p:Configuration=$BUILD_CONFIG --no-restore --no-build --verbosity normal --collect:"XPlat Code Coverage"
47
+
48
+ - name : Codecov
49
+
50
+ with :
51
+ token : ${{ secrets.CODECOVACCESSTOKEN }} # not required for public repos
52
+
53
+ - name : Setup NuGet
54
+ uses : NuGet/setup-nuget@v1
55
+
56
+ - name : Publish NuGet
57
+ run : nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGETORGAPI}}
You can’t perform that action at this time.
0 commit comments