1414 DOTNET_CLI_TELEMETRY_OPTOUT : true
1515
1616jobs :
17- build :
18- name : " Build and Test"
19- strategy :
20- matrix :
21- include :
22- - dotnet : ' 8.0.x'
23- dotnet-framework : ' net8.0'
24- os : ubuntu-latest
25- - dotnet : ' 8.0.x'
26- dotnet-framework : ' net8.0'
27- os : windows-latest
28- - dotnet : ' 9.0.x'
29- dotnet-framework : ' net9.0'
30- os : ubuntu-latest
31- - dotnet : ' 9.0.x'
32- dotnet-framework : ' net9.0'
33- os : windows-latest
34-
35- runs-on : ${{ matrix.os }}
36-
17+ calculate-version :
18+ name : " Calculate Version"
19+ runs-on : ubuntu-latest
3720 outputs :
3821 version : ${{ steps.gitversion.outputs.SemVer }}
3922 nuget-version : ${{ steps.gitversion.outputs.NuGetVersion }}
@@ -54,16 +37,46 @@ jobs:
5437 - name : Determine Version
5538 id : gitversion
5639 uses : gittools/actions/gitversion/execute@v4.0.1
40+ with :
41+ useConfigFile : true
5742
5843 - name : Display GitVersion outputs
5944 run : |
45+ echo "?? CD Version Calculation:"
46+ echo "Branch: ${{ github.ref }}"
6047 echo "Version: ${{ steps.gitversion.outputs.SemVer }}"
6148 echo "NuGet Version: ${{ steps.gitversion.outputs.NuGetVersion }}"
6249 echo "Assembly Version: ${{ steps.gitversion.outputs.AssemblySemVer }}"
6350 echo "File Version: ${{ steps.gitversion.outputs.AssemblySemFileVer }}"
6451 echo "Informational Version: ${{ steps.gitversion.outputs.InformationalVersion }}"
6552
66- - name : Setup .NET ${{ matrix.dotnot }}
53+ build :
54+ needs : calculate-version
55+ name : " Build and Test"
56+ strategy :
57+ matrix :
58+ include :
59+ - dotnet : ' 8.0.x'
60+ dotnet-framework : ' net8.0'
61+ os : ubuntu-latest
62+ - dotnet : ' 8.0.x'
63+ dotnet-framework : ' net8.0'
64+ os : windows-latest
65+ - dotnet : ' 9.0.x'
66+ dotnet-framework : ' net9.0'
67+ os : ubuntu-latest
68+ - dotnet : ' 9.0.x'
69+ dotnet-framework : ' net9.0'
70+ os : windows-latest
71+
72+ runs-on : ${{ matrix.os }}
73+
74+ steps :
75+ - uses : actions/checkout@v4
76+ with :
77+ fetch-depth : 0
78+
79+ - name : Setup .NET ${{ matrix.dotnet }}
6780 uses : actions/setup-dotnet@v4
6881 with :
6982 dotnet-version : ${{ matrix.dotnet }}
@@ -74,11 +87,11 @@ jobs:
7487 - name : Build
7588 run : dotnet build --no-restore -c Release -f ${{ matrix.dotnet-framework }}
7689 env :
77- GitVersion_SemVer : ${{ steps.gitversion .outputs.SemVer }}
78- GitVersion_AssemblySemVer : ${{ steps.gitversion .outputs.AssemblySemVer }}
79- GitVersion_AssemblySemFileVer : ${{ steps.gitversion .outputs.AssemblySemFileVer }}
80- GitVersion_InformationalVersion : ${{ steps.gitversion .outputs.InformationalVersion }}
81- GitVersion_NuGetVersion : ${{ steps.gitversion .outputs.NuGetVersion }}
90+ GitVersion_SemVer : ${{ needs.calculate-version .outputs.version }}
91+ GitVersion_AssemblySemVer : ${{ needs.calculate-version .outputs.assembly-version }}
92+ GitVersion_AssemblySemFileVer : ${{ needs.calculate-version .outputs.file-version }}
93+ GitVersion_InformationalVersion : ${{ needs.calculate-version .outputs.informational-version }}
94+ GitVersion_NuGetVersion : ${{ needs.calculate-version .outputs.nuget-version }}
8295
8396 - name : Test (Ubuntu)
8497 if : startsWith(matrix.os, 'ubuntu')
@@ -89,12 +102,18 @@ jobs:
89102 run : dotnet test --no-build --verbosity normal -c Release -f ${{ matrix.dotnet-framework }} --filter "DB!=SQLServer"
90103
91104 publish :
92- needs : build
105+ needs : [calculate-version, build]
93106 name : " Publish Packages (Development)"
94107 if : github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
95108 uses : ./.github/workflows/publish.yml
96109 with :
97110 publish-to-nuget : false
111+ build-configuration : ' Release'
112+ version : ${{ needs.calculate-version.outputs.version }}
113+ nuget-version : ${{ needs.calculate-version.outputs.nuget-version }}
114+ assembly-version : ${{ needs.calculate-version.outputs.assembly-version }}
115+ informational-version : ${{ needs.calculate-version.outputs.informational-version }}
116+ secrets : inherit
98117
99118 clean :
100119 needs : publish
0 commit comments