Skip to content

Commit efc99ee

Browse files
authored
ci(nuget): fix auto-versioning to remove leading zeros (#442)
The date-based auto-versioning was using formatted strings that produced leading zeros (e.g., "2025.12.08"), which violates package version format and causes cargo to reject the version. Changed to use integer date components instead, producing valid versions like "2025.12.8".
1 parent 96054be commit efc99ee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/nuget.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ jobs:
4646
run: |
4747
$Version = '${{ github.event.inputs.version }}'
4848
if ($Version -eq '' -or $Version -eq 'latest') {
49-
$Version = (Get-Date -Format "yyyy.MM.dd") + ".0"
49+
$DateNow = Get-Date
50+
$Version = "{0}.{1}.{2}.0" -f $DateNow.Year, $DateNow.Month, $DateNow.Day
5051
}
5152
5253
if ($Version -notmatch '^\d+\.\d+\.\d+\.\d+$') {

0 commit comments

Comments
 (0)