@@ -2,15 +2,47 @@ name: Continuous Integration
22on : [push]
33jobs :
44 build :
5- name : Build and test
6- runs-on : ubuntu-latest
7- steps :
8- - uses : actions/checkout@v2
5+ env :
6+ BUILD_CONFIG : ' Release'
7+ SOLUTION : ' GDSMultiPageFormService.sln'
8+ name : Build and publish package
9+ runs-on : ubuntu-latest
10+ strategy :
11+ matrix :
12+ dotnet-version : ['3.1.x']
13+ steps :
14+ - uses : actions/checkout@v2
15+ with :
16+ fetch-depth : 0
917
10- - name : Setup .NET Core SDK 60
11- uses : actions/setup-dotnet@v1
12- with :
13- dotnet-version : 6.0.x
18+ - name : Setup .NET Core SDK 60
19+ uses : actions/setup-dotnet@v1
20+ with :
21+ dotnet-version : ${{ matrix.dotnet-version }}
1422
15- - name : Dotnet build
16- run : dotnet build GDSMultiPageFormService.sln
23+ - name : Install GitVersion
24+ uses : gittools/actions/gitversion/setup@v0.9.7
25+ with :
26+ versionSpec : ' 5.5.0'
27+
28+ - name : Determine Version
29+ id : gitversion
30+ uses : gittools/actions/gitversion/execute@v0.9.7
31+
32+ - name : Display GitVersion outputs
33+ run : |
34+ echo "Major: ${{ steps.gitversion.outputs.major }}"
35+ echo "Minor: ${{ steps.gitversion.outputs.minor }}"
36+ echo "Patch: ${{ steps.gitversion.outputs.patch }}"
37+ echo "NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}"
38+
39+ - name : Dotnet build
40+ run : dotnet build GDSMultiPageFormService.sln --configuration release
41+
42+ - name : Package nuget
43+ if : startsWith(github.ref, 'refs/tags/v')
44+ run : dotnet pack GDSMultiPageFormService.sln --configuration release -o:package /p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersionV2 }}
45+
46+ - name : Push generated package to GitHub registry
47+ if : startsWith(github.ref, 'refs/tags/v')
48+ run : dotnet nuget push ./package/*.nupkg --source https://nuget.pkg.github.com/TechnologyEnhancedLearning/index.json --api-key ${{ secrets.NUGETAPIKEY }}
0 commit comments