1
+ name : Build, test and deploy
2
+
3
+ on :
4
+ push :
5
+ pull_request :
6
+
7
+ env :
8
+ # Stop wasting time caching packages
9
+ DOTNET_SKIP_FIRST_TIME_EXPERIENCE : true
10
+ # Disable sending usage data to Microsoft
11
+ DOTNET_CLI_TELEMETRY_OPTOUT : true
12
+
13
+ # Official NuGet Feed settings
14
+ NUGET_FEED : https://api.nuget.org/v3/index.json
15
+
16
+ jobs :
17
+ build_test_deploy :
18
+ runs-on : ubuntu-20.04
19
+ defaults :
20
+ run :
21
+ working-directory : ./source
22
+
23
+ steps :
24
+ - name : Checkout
25
+ uses : actions/checkout@v2
26
+ with :
27
+ fetch-depth : 0
28
+
29
+ - name : Setup GitVersion
30
+ uses :
gittools/actions/gitversion/[email protected]
31
+ with :
32
+ versionSpec : ' 5.8.1'
33
+
34
+ - name : Determine Version
35
+ id : gitversion
36
+ uses :
gittools/actions/gitversion/[email protected]
37
+
38
+ - name : Setup .NET
39
+ uses : actions/setup-dotnet@v1
40
+ with :
41
+ dotnet-version : 6.0.x
42
+
43
+ - name : Restore dependencies
44
+ run : dotnet restore
45
+
46
+ - name : Build Release version
47
+ run : dotnet build --no-restore --configuration Release /p:AssemblyVersion=${{ steps.gitversion.outputs.assemblySemFileVer }} /p:FileVersion=${{ steps.gitversion.outputs.assemblySemFileVer }} /p:InformationalVersion=${{ steps.gitversion.outputs.Sha }}
48
+
49
+ # - name: Run Tests
50
+ # run: dotnet test --configuration Release --no-restore --verbosity normal --collect:"XPlat Code Coverage" --settings Marten.AspNetCore.Identity.Tests/coverlet.runsettings
51
+
52
+ - name : Pack
53
+ run : dotnet pack --no-build --output ./output --configuration Release /p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersionV2 }}
54
+
55
+ - name : Upload Package to job as artificat
56
+ uses : actions/upload-artifact@v2
57
+ with :
58
+ name : " Marten.AspNetCore.Identity-${{ steps.gitversion.outputs.nuGetVersionV2 }}"
59
+ # Does not support current "working-directory" settings
60
+ path : source/output/*.nupkg
61
+ if-no-files-found : error
62
+
63
+ - name : Upload Package to release
64
+ # if: contains(github.ref, 'main')
65
+ uses : svenstaro/upload-release-action@v1-release
66
+ with :
67
+ repo_token : ${{ secrets.GITHUB_TOKEN }}
68
+ file_glob : true
69
+ # Does not support current "working-directory" settings
70
+ file : source/output/*.nupkg
71
+ tag : " ${{ steps.gitversion.outputs.fullSemVer }}"
72
+ overwrite : true
73
+
74
+ - name : Upload Package to nuget
75
+ # if: contains(github.ref, 'main')
76
+ run : dotnet nuget push ./output/*.nupkg --source $NUGET_FEED --skip-duplicate --api-key ${{ secrets.NUGET_KEY }}
0 commit comments