Skip to content

Commit 097a375

Browse files
committed
Refactor preview tag format and add release script
Updated `cd-release-preview.yml` to simplify the regex for preview tag matching. Adjusted `run_release.ps1` to make `PreviewId` and `TagName` NuGet-compliant by removing dots and using the format `vX.Y.Z-previewYYYYMMDDHHmm`. Improved error messaging for version validation. Added `run_release.ps1` to the `DevOps` project in `CryptoNet.sln`.
1 parent 2c06eb4 commit 097a375

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

.github/workflows/cd-release-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: "2. Continuous Deployment (Release Preview)"
33
on:
44
push:
55
tags:
6-
- "v[0-9]+\\.[0-9]+\\.[0-9]+-preview.*"
6+
- "v[0-9]+\\.[0-9]+\\.[0-9]+-preview*"
77

88
jobs:
99
build:

CryptoNet.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DevOps", "DevOps", "{1733D1
2222
RELEASE-NOTES = RELEASE-NOTES
2323
run_codecoverage.ps1 = run_codecoverage.ps1
2424
run_codecoverage.txt = run_codecoverage.txt
25+
run_release.ps1 = run_release.ps1
2526
EndProjectSection
2627
EndProject
2728
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Info", "Info", "{6976E2ED-A139-48C5-A390-639F56A8B348}"

run_release.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ if ($VersionNumber -notmatch '^\d+\.\d+\.\d+$') {
1414
}
1515

1616
# Build preview suffix (valid SemVer identifiers, no leading zeros)
17-
$DatePart = (Get-Date -Format "yyyyMMdd") # e.g. 20250822
18-
$TimePart = (Get-Date -Format "Hmm") # e.g. 845 (not 0845, no leading zero!)
19-
$PreviewId = "$DatePart.$TimePart" # → "20250822.845"
17+
$DatePart = (Get-Date -Format "yyyyMMdd") # e.g 20250822
18+
$TimePart = (Get-Date -Format "Hmm") # e.g 845 (not 0845, no leading zero!)
19+
$PreviewId = "$DatePart$TimePart" # → "20250822845" (no dots!)
2020

2121
# Construct the tag
2222
if ($IsPreview) {
23-
# format: vX.Y.Z-preview.YYYYMMDD.HHmm
24-
$TagName = "v$VersionNumber-preview.$PreviewId"
23+
# format: vX.Y.Z-previewYYYYMMDDHHmm (NuGet-compliant)
24+
$TagName = "v$VersionNumber-preview$PreviewId"
2525
} else {
2626
$TagName = "v$VersionNumber"
2727
}

0 commit comments

Comments
 (0)