File tree 3 files changed +31
-43
lines changed
3 files changed +31
-43
lines changed Original file line number Diff line number Diff line change 11
11
types : [published]
12
12
13
13
jobs :
14
- test :
14
+ build :
15
15
runs-on : ubuntu-latest
16
16
name : Build
17
17
steps :
18
- - name : Checkout
19
- uses : actions/checkout@v2
18
+ - uses : actions/checkout@v4
20
19
with :
21
20
fetch-depth : 0
22
21
23
- - uses : actions/cache@v2
22
+ - uses : actions/setup-dotnet@v4
24
23
with :
25
- path : ~/.nuget/packages
26
- key : ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
27
- restore-keys : |
28
- ${{ runner.os }}-nuget-
24
+ dotnet-version : ' 8.x'
25
+ cache : true
29
26
30
- - name : Setup dotnet
31
- uses : actions/setup-dotnet@v1
32
- with :
33
- dotnet-version : ' 3.1'
34
-
35
- - name : Setup dotnet
36
- uses : actions/setup-dotnet@v1
37
- with :
38
- dotnet-version : ' 5.0'
39
-
40
- - name : Install GitVersion
41
- run : dotnet tool install -g GitVersion.Tool
42
-
43
- - name : GitVersion
44
- run : dotnet gitversion /l console /output buildserver
45
-
46
- - name : DotNet Build
47
- shell : pwsh
48
- run : |
49
- dotnet restore
50
- dotnet build --no-restore
51
- dotnet build --configuration Release --no-restore
52
- dotnet pack --configuration Release --no-restore --no-build
27
+ - run : make build
53
28
54
- - name : DotNet Test
55
- shell : pwsh
56
- run : |
57
- dotnet test --no-build --no-restore
29
+ - run : make test
58
30
59
31
- name : Push NuGet
60
32
if : |
61
33
github.event.action == 'published'
62
- shell : pwsh
63
- run : dotnet nuget push **/*.nupkg --source $Env:SOURCE --api-key $Env:TOKEN
34
+ run : make push-nuget
64
35
env :
65
- SOURCE : ' https://api.nuget.org/v3/index.json'
66
36
TOKEN : ${{ secrets.NUGET_API_KEY }}
Original file line number Diff line number Diff line change 1
1
{
2
- "version" : " 0.1 .0" ,
2
+ "version" : " 2.0 .0" ,
3
3
"command" : " dotnet" ,
4
- "isShellCommand" : true ,
5
4
"args" : [],
6
5
"tasks" : [
7
6
{
8
- "taskName" : " build" ,
7
+ "label" : " build" ,
8
+ "type" : " shell" ,
9
+ "command" : " dotnet" ,
9
10
"args" : [
11
+ " build" ,
10
12
" "
11
13
],
12
- "isBuildCommand" : true ,
13
- "problemMatcher" : " $msCompile"
14
+ "problemMatcher" : " $msCompile" ,
15
+ "group" : {
16
+ "_id" : " build" ,
17
+ "isDefault" : false
18
+ }
14
19
}
15
20
]
16
21
}
Original file line number Diff line number Diff line change
1
+ .PHONY :
2
+
3
+ build :
4
+ dotnet restore
5
+ dotnet build --no-restore
6
+ dotnet build --configuration Release --no-restore
7
+ dotnet pack --configuration Release --no-restore --no-build
8
+
9
+ test :
10
+ dotnet test --no-build --no-restore
11
+
12
+ push-nuget :
13
+ dotnet nuget push ** /* .nupkg --api-key $$ TOKEN --source ' https://api.nuget.org/v3/index.json'
You can’t perform that action at this time.
0 commit comments