Skip to content

Commit c95e7ec

Browse files
committed
Update dotnet-build.yml
1 parent a9245e3 commit c95e7ec

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

.github/workflows/dotnet-build.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ on:
1515
- README.md
1616

1717
env:
18-
CurrentSemanticVersionBase: '99.0.0'
19-
PreviewNumber: $[counter(variables['CurrentSemanticVersionBase'], 1001)]
20-
CurrentSemanticVersion: '$(CurrentSemanticVersionBase)-preview$(PreviewNumber)'
21-
NugetPackageVersion: '$(CurrentSemanticVersion)'
18+
# When we create a tag, we set the NuGet version to the tag number, the below values are only for PR builds.
19+
CurrentSemanticVersionBase: '99.0.0' # Only used for PR builds
20+
NugetPackageVersion: '99.0.0-preview${{ github.run_number }}' # Only used for PR builds
2221
NET_VERSION: '9.0.x'
2322
RunPoliCheck: false
2423
PathToLibrarySolution: 'src/CommunityToolkit.Maui.Markup.sln'
@@ -93,7 +92,7 @@ jobs:
9392

9493
- name: Set NuGet Version to Tag Number
9594
if: startsWith(github.ref, 'refs/tags/')
96-
run: echo "NugetPackageVersion=${{ github.ref }}" >> $GITHUB_ENV
95+
run: echo "NugetPackageVersion=${${{ github.ref }}#refs/tags/}" >> $GITHUB_ENV
9796

9897
- name: Set NuGet Version to PR Version
9998
if: ${{ github.event_name == 'pull_request' }}
@@ -194,7 +193,7 @@ jobs:
194193

195194
sign:
196195
needs: [build_library]
197-
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/rel/') }}
196+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
198197
runs-on: windows-latest
199198
permissions:
200199
id-token: write # Required for requesting the JWT
@@ -247,7 +246,7 @@ jobs:
247246
${{ github.workspace }}/packages/**/*.nupkg
248247
249248
release:
250-
if: ${{ startsWith(github.ref, 'refs/heads/rel/') }}
249+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
251250
needs: [sign]
252251
environment: nuget-release-gate # This gates this job until manually approved
253252
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)