@@ -2,77 +2,12 @@ name: CI
2
2
3
3
on :
4
4
push :
5
+ branches :
6
+ - ' **' # Ignores pushes of tags
5
7
pull_request :
6
8
workflow_dispatch :
7
9
8
10
jobs :
9
11
build :
10
- runs-on : windows-latest # Use Ubuntu in v5.0
11
-
12
- env :
13
- DOTNET_NOLOGO : true
14
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE : true # Avoid pre-populating the NuGet package cache
15
-
16
- steps :
17
- - uses : actions/checkout@v3
18
- with :
19
- fetch-depth : 0 # all
20
-
21
- - name : Setup .NET 2.0 # Remove in v5.0
22
- uses : actions/setup-dotnet@v1
23
- with :
24
- dotnet-version : 2.0.x
25
-
26
- - name : Setup .NET 8.0
27
- uses : actions/setup-dotnet@v1
28
- with :
29
- dotnet-version : 8.0.x
30
-
31
- - name : Install GitVersion
32
- uses : gittools/actions/gitversion/setup@v0
33
- with :
34
- versionSpec : ' 5.x'
35
-
36
- - name : Run GitVersion
37
- id : gitversion
38
- uses : gittools/actions/gitversion/execute@v0
39
-
40
- - name : Display SemVer
41
- run : |
42
- echo "SemVer: $env:GitVersion_SemVer"
43
-
44
- - name : Add DbUp NuGet Source
45
- run : dotnet nuget add source --name DbUp --username DbUp --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text https://nuget.pkg.github.com/DbUp/index.json
46
-
47
- - name : Restore
48
- run : dotnet restore
49
- working-directory : src
50
-
51
- - name : Build
52
- run : dotnet build -c Release --no-restore /p:Version=$env:GitVersion_SemVer
53
- working-directory : src
54
-
55
- - name : Test
56
- run : dotnet test --no-build -c Release --logger trx --logger "console;verbosity=detailed" --results-directory ../artifacts
57
- working-directory : src
58
-
59
- - name : Pack
60
- run : dotnet pack --no-build -c Release -o ../artifacts /p:Version=$env:GitVersion_SemVer
61
- working-directory : src
62
-
63
- - name : Push NuGet packages to GitHub Packages ⬆️
64
- working-directory : artifacts
65
- run : dotnet nuget push *.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/DbUp/index.json"
66
-
67
- - name : Push NuGet packages to NuGet ⬆️
68
- if : ${{ steps.gitversion.outputs.preReleaseLabel == '' }}
69
- working-directory : artifacts
70
- run : dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_APIKEY }} --source https://api.nuget.org/v3/index.json
71
-
72
- - name : Test Report 🧪
73
- uses : dorny/test-reporter@v1
74
- if : ${{ always() }}
75
- with :
76
- name : Tests
77
- path : artifacts/*.trx
78
- reporter : dotnet-trx
12
+ name : Build
13
+ uses : DbUp/Universe/.github/workflows/build.yml@main
0 commit comments