66 - ' release/**'
77 - ' releases/**'
88 pull_request :
9+
910env :
11+ DOTNET_NOLOGO : true
1012 DOTNET_CLI_TELEMETRY_OPTOUT : true
1113 MSBUILDSINGLELOADCONTEXT : 1
14+
1215jobs :
13- generateVersionInfo :
14- name : GenerateVersionInfo
16+ build :
17+ name : Build and Test
1518 runs-on : ubuntu-latest
1619 steps :
1720 - name : Checkout
@@ -23,50 +26,19 @@ jobs:
2326 - name : Fetch complete repository including tags
2427 run : git fetch --tags --force --prune && git describe
2528 - name : Generate version info from git history
26- run : dotnet gitversion /output json | jq -r 'to_entries|map("GitVersion_\(.key)=\(.value|tostring)")|.[]' >> gitversion.env && cat gitversion.env
27- - name : Upload version info file
28- uses : actions/upload-artifact@v3
29- with :
30- name : gitversion
31- path : gitversion.env
32-
33- build :
34- name : Build
35- needs : generateVersionInfo
36- runs-on : ubuntu-latest
37- steps :
38- - name : Checkout
39- uses : actions/checkout@v3
40- - name : Download version info file
41- uses : actions/download-artifact@v3
42- with :
43- name : gitversion
44- path : ./
45- - name : Inject version info into environment
46- run : cat ./gitversion.env >> $GITHUB_ENV
29+ run : dotnet gitversion /output json | jq -r 'to_entries|map("GitVersion_\(.key)=\(.value|tostring)")|.[]' >> $GITHUB_ENV
30+ - name : Print current version
31+ run : echo "Current version is \"$GitVersion_SemVer\""
32+ - name : Install dependencies
33+ run : dotnet restore
4734 - name : Build solution
48- run : echo "Current version is \"$GitVersion_SemVer\"" && dotnet build -c Release
35+ run : dotnet build --no-restore -c Release
36+ - name : Run Tests
37+ run : dotnet test -c Release --no-restore --no-build
4938 - name : Create NuGet packages
50- run : dotnet pack -c Release --no-build -o nupkg
39+ run : dotnet pack -c Release --no-restore --no- build -o nupkg
5140 - name : Upload nuget packages
5241 uses : actions/upload-artifact@v3
5342 with :
5443 name : nupkg
5544 path : nupkg
56-
57- test :
58- name : Test
59- needs : [build, generateVersionInfo]
60- runs-on : ubuntu-latest
61- steps :
62- - name : Checkout
63- uses : actions/checkout@v3
64- - name : Download version info file
65- uses : actions/download-artifact@v3
66- with :
67- name : gitversion
68- path : ./
69- - name : Inject version info into environment
70- run : cat ./gitversion.env >> $GITHUB_ENV
71- - name : Run tests
72- run : echo "Current version is \"$GitVersion_SemVer\"" && dotnet test -c Release
0 commit comments