77 runPublish :
88 description : ' Publish Nuget ?'
99 required : true
10- default : ' false'
10+ default : false
1111 type : boolean
1212
1313jobs :
3434 id : gitversion
3535
3636 - name : Format NuGet version
37- run : |
38- packageVersion="${{ steps.gitversion.outputs.majorMinorPatch }}.${{steps.gitversion.outputs.preReleaseNumber}}"
37+ run : |
38+ buildNumber="${{steps.gitversion.outputs.preReleaseNumber}}${{ steps.gitversion.outputs.buildMetaData }}"
39+
40+ if [[ "${GITHUB_REF}" != "refs/heads/${{ github.event.repository.default_branch }}" ]]; then
41+ buildNumber="${buildNumber}-beta"
42+ fi
43+
44+ packageVersion="${{ steps.gitversion.outputs.majorMinorPatch }}.${buildNumber}"
3945 echo "packageVersion=$packageVersion" >> $GITHUB_OUTPUT
4046 id : formatversion
4147
6369
6470 - name : Run tests with coverage
6571 working-directory : src
72+ env :
73+ DiffEngine_Disabled : ' true'
6674 run : >-
6775 dotnet test
6876 --configuration Release
@@ -136,6 +144,21 @@ jobs:
136144 name : release-notes
137145 path : release-notes.md
138146
147+ - name : Check for changes in Samples
148+ id : changes
149+ run : |
150+ if git diff --quiet origin/main HEAD -- src/Samples/; then
151+ echo "SamplesUpdated=false" >> $GITHUB_OUTPUT
152+ else
153+ echo "SamplesUpdated=true" >> $GITHUB_OUTPUT
154+ fi
155+
156+ if git diff --quiet origin/main HEAD -- src/TestStack.BDDfy/; then
157+ echo "BddfyUpdated=false" >> $GITHUB_OUTPUT
158+ else
159+ echo "BddfyUpdated=true" >> $GITHUB_OUTPUT
160+ fi
161+
139162 - name : Create NuGet package
140163 working-directory : src
141164 run : >-
@@ -160,7 +183,7 @@ jobs:
160183 publish-nuget :
161184 runs-on : ubuntu-latest
162185 needs : build
163- if : github.event.inputs.runPublish == 'true' && github.ref_name == github.event.repository.default_branch
186+ if : github.event.inputs.runPublish == 'true' || github.ref_name == github.event.repository.default_branch
164187 environment :
165188 name : Publish
166189 url : https://www.nuget.org/packages/TestStack.BDDfy/
0 commit comments