File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 steps :
2626 - name : Checkout
2727 uses : actions/checkout@v4
28+ with :
29+ fetch-depth : 0
30+
31+ - name : Compute next version
32+ id : version
33+ shell : pwsh
34+ run : |
35+ git fetch --tags --quiet
36+ $latest = git tag --sort=-v:refname | Where-Object { $_ -match '^v\d+\.\d+\.\d+$' } | Select-Object -First 1
37+ if (-not $latest) {
38+ $newVersion = "1.0.0"
39+ } else {
40+ $parts = $latest.TrimStart('v') -split '\.'
41+ $newVersion = "$([int]$parts[0]).$([int]$parts[1]).$([int]$parts[2] + 1)"
42+ }
43+ Write-Host "Next version: $newVersion (tag: v$newVersion)"
44+ "version=$newVersion" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
45+ "tag=v$newVersion" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
2846
2947 - name : Validate required GitHub secrets
3048 shell : pwsh
82100 --output ./publish
83101 --runtime win-x86
84102 --no-restore
103+ -p:Version=${{ steps.version.outputs.version }}
85104
86105 - name : Write production appsettings from GitHub secrets
87106 shell : pwsh
@@ -248,3 +267,12 @@ jobs:
248267 -MaxAttempts 10 `
249268 -InitialDelaySeconds 45 `
250269 -RetryDelaySeconds 15
270+
271+ - name : Tag release
272+ shell : pwsh
273+ run : |
274+ git config user.name "github-actions[bot]"
275+ git config user.email "github-actions[bot]@users.noreply.github.com"
276+ git tag ${{ steps.version.outputs.tag }}
277+ git push origin ${{ steps.version.outputs.tag }}
278+ Write-Host "Tagged ${{ steps.version.outputs.tag }}"
Original file line number Diff line number Diff line change 1+ <Project >
2+ <PropertyGroup >
3+ <!-- Fallback version for local builds. CI overrides this via -p:Version during dotnet publish. -->
4+ <Version >1.0.0</Version >
5+ <AssemblyVersion >1.0.0.0</AssemblyVersion >
6+ <FileVersion >1.0.0.0</FileVersion >
7+ </PropertyGroup >
8+ </Project >
You can’t perform that action at this time.
0 commit comments