Skip to content

Commit cb16a05

Browse files
authored
feat: Use GitVersion directly as part of the pipeline, instead of NuGet packages (#343)
1 parent c1f9e93 commit cb16a05

File tree

5 files changed

+21
-5
lines changed

5 files changed

+21
-5
lines changed

.github/workflows/build-dotnet-fast.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,19 @@ jobs:
6464
uses: ./.github/workflows/step-node-commitlint.yml
6565
secrets: inherit
6666

67+
version:
68+
name: Version Management
69+
uses: ./.github/workflows/step-dotnet-version.yml
70+
with:
71+
dotnet-version: ${{ inputs.dotnetVersion || '8.x' }}
72+
dotnet-quality: ${{ inputs.dotnetQuality || 'ga' }}
73+
secrets: inherit
74+
6775
build:
6876
name: Build and Test
6977
needs:
7078
- commitlinter
79+
- version
7180
runs-on: ${{ inputs.runsOnBuild || 'ubuntu-latest' }}
7281
steps:
7382
- name: Checkout repository
@@ -95,11 +104,11 @@ jobs:
95104
run: dotnet restore ${{ inputs.solution }} --verbosity ${{ inputs.dotnetLogging || 'minimal' }}
96105

97106
- name: Build solution
98-
run: dotnet build ${{ inputs.solution }} -v ${{ inputs.dotnetLogging || 'minimal' }} -c Release --no-restore /p:GeneratePackageOnBuild=false
107+
run: dotnet build ${{ inputs.solution }} -v ${{ inputs.dotnetLogging || 'minimal' }} -c Release --no-restore /p:GeneratePackageOnBuild=false /p:Version=${{ needs.version.outputs.solution-version }}
99108

100109
- name: Test
101110
run: |
102-
dotnet test ${{ inputs.solution }} -c Release -v ${{ inputs.dotnetLogging || 'minimal' }} --no-build --no-restore
111+
dotnet test ${{ inputs.solution }} -c Release -v ${{ inputs.dotnetLogging || 'minimal' }} --no-build --no-restore /p:GeneratePackageOnBuild=false /p:Version=${{ needs.version.outputs.solution-version }}
103112
104113
dependabot:
105114
name: Dependabot Merge

.github/workflows/build-dotnet-matrix.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,14 @@ jobs:
136136
needs:
137137
- tests
138138
- format
139+
- version
139140
with:
140141
dotnet-logging: ${{ inputs.dotnetLogging || 'minimal' }}
141142
dotnet-version: ${{ inputs.dotnetVersion || '8.x' }}
142143
dotnet-quality: ${{ inputs.dotnetQuality || 'ga' }}
143144
runs-on: ${{ inputs.runsOnBuild || 'ubuntu-latest' }}
144145
solution: ${{ inputs.solution }}
146+
solution-version: ${{ needs.version.outputs.solution-version }}
145147
secrets: inherit
146148

147149
dependabot:

.github/workflows/build-dotnet-single.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,14 @@ jobs:
109109
needs:
110110
- tests
111111
- format
112+
- version
112113
with:
113114
dotnet-logging: ${{ inputs.dotnetLogging || 'minimal' }}
114115
dotnet-version: ${{ inputs.dotnetVersion || '8.x' }}
115116
dotnet-quality: ${{ inputs.dotnetQuality || 'ga' }}
116117
runs-on: ${{ inputs.runsOnBuild || 'ubuntu-latest' }}
117118
solution: ${{ inputs.solution }}
119+
solution-version: ${{ needs.version.outputs.solution-version }}
118120
secrets: inherit
119121

120122
dependabot:

.github/workflows/step-dotnet-build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ on:
2424
solution:
2525
required: true
2626
type: string
27+
solution-version:
28+
required: true
29+
type: string
2730
secrets:
2831
FETCH_TOKEN:
2932
required: false
@@ -51,7 +54,7 @@ jobs:
5154
run: dotnet restore ${{ inputs.solution }} -v ${{ inputs.dotnet-logging }}
5255

5356
- name: Build
54-
run: dotnet build ${{ inputs.solution }} -v ${{ inputs.dotnet-logging }} -c Release --no-restore
57+
run: dotnet build ${{ inputs.solution }} -v ${{ inputs.dotnet-logging }} -c Release --no-restore /p:Version=${{ inputs.solution-version }}
5558

5659
- name: Upload NuGet packages
5760
uses: actions/upload-artifact@v4.6.2

.github/workflows/step-dotnet-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ jobs:
9898
run: dotnet restore ${{ inputs.solution }} -v ${{ inputs.dotnet-logging }}
9999

100100
- name: Build
101-
run: dotnet build ${{ inputs.solution }} -c Release -v ${{ inputs.dotnet-logging || 'minimal' }} --no-restore /p:GeneratePackageOnBuild=false
101+
run: dotnet build ${{ inputs.solution }} -c Release -v ${{ inputs.dotnet-logging || 'minimal' }} --no-restore /p:GeneratePackageOnBuild=false /p:Version=${{ inputs.solution-version }}
102102

103103
- name: Test
104104
id: test
105105
run: |
106-
dotnet test ${{ inputs.solution }} -c Release -v ${{ inputs.dotnet-logging || 'minimal' }} --no-build --no-restore --collect:"XPlat Code Coverage;Format=cobertura,opencover" /p:GeneratePackageOnBuild=false -- --coverage --coverage-output-format cobertura
106+
dotnet test ${{ inputs.solution }} -c Release -v ${{ inputs.dotnet-logging || 'minimal' }} --no-build --no-restore --collect:"XPlat Code Coverage;Format=cobertura,opencover" /p:Version=${{ inputs.solution-version }} /p:GeneratePackageOnBuild=false -- --coverage --coverage-output-format cobertura
107107
108108
- name: ReportGenerator
109109
uses: danielpalme/ReportGenerator-GitHub-Action@5.4.17

0 commit comments

Comments
 (0)