77 This script creates and pushes a version tag which triggers GitHub Actions
88 to build the package and create a release. Uses date-based versioning (YYYY.MM.DD).
99
10- Multiple releases on the same day get suffixes: v2026.02.01, v2026.02.01a, v2026.02.01b
10+ Stable releases: v2026.02.01, v2026.02.01a, v2026.02.01b
11+ Beta releases: v2026.02.01-dev (use -Beta flag)
1112
1213 Automatically generates release notes from git commits and updates the PLG file.
1314
15+ . PARAMETER Beta
16+ Create a beta/dev release (adds -dev suffix, marks as prerelease on GitHub).
17+
1418. PARAMETER DryRun
1519 Show what would be done without making any changes.
1620
1721. PARAMETER Force
1822 Skip all confirmation prompts.
1923
2024. EXAMPLE
21- ./release.ps1 # Creates v2026.02.01 (or next available)
25+ ./release.ps1 # Creates v2026.02.01 (stable)
26+ ./release.ps1 -Beta # Creates v2026.02.01-dev (beta)
2227 ./release.ps1 -DryRun # Preview without changes
2328 ./release.ps1 -Force # Skip confirmations
2429#>
2530
2631param (
32+ [switch ]$Beta ,
2733 [switch ]$DryRun ,
2834 [switch ]$Force
2935)
@@ -34,47 +40,62 @@ $PlgFile = "compose.manager.plg"
3440
3541Write-Host " "
3642Write-Host " ========================================" - ForegroundColor Cyan
37- Write-Host " Compose Manager Release Script" - ForegroundColor Cyan
43+ if ($Beta ) {
44+ Write-Host " Compose Manager BETA Release" - ForegroundColor Yellow
45+ } else {
46+ Write-Host " Compose Manager Release Script" - ForegroundColor Cyan
47+ }
3848Write-Host " ========================================" - ForegroundColor Cyan
3949Write-Host " "
4050
4151# Get today's date in version format
4252$dateVersion = Get-Date - Format " yyyy.MM.dd"
43- $baseTag = " v$dateVersion "
44-
45- # Fetch latest tags from remote
46- Write-Host " Fetching latest from origin..." - ForegroundColor Yellow
47- git fetch origin -- tags
4853
49- # Get existing tags for today
50- $existingTags = git tag - l " $baseTag *" 2> $null | Sort-Object
51-
52- if ($existingTags ) {
53- Write-Host " Existing tags for today:" - ForegroundColor Yellow
54- $existingTags | ForEach-Object { Write-Host " $_ " - ForegroundColor Gray }
54+ if ($Beta ) {
55+ # Beta releases use -dev.HHMM suffix for uniqueness
56+ $timeStamp = Get-Date - Format " HHmm"
57+ $newTag = " v$dateVersion -dev.$timeStamp "
58+
59+ # No collision check needed - time-based tags are unique
60+ git fetch origin -- tags
61+ } else {
62+ # Stable release logic
63+ $baseTag = " v$dateVersion "
64+
65+ # Fetch latest tags from remote
66+ Write-Host " Fetching latest from origin..." - ForegroundColor Yellow
67+ git fetch origin -- tags
5568
56- # Find the next suffix
57- $lastTag = $existingTags | Select -Object - Last 1
69+ # Get existing tags for today (exclude -dev tags)
70+ $existingTags = git tag - l " $baseTag * " 2> $null | Where -Object { $_ -notmatch ' -dev ' } | Sort-Object
5871
59- if ($lastTag -eq $baseTag ) {
60- # First release was without suffix, next is 'a'
61- $newTag = " ${baseTag} a"
62- } elseif ($lastTag -match " ^v\d{4}\.\d{2}\.\d{2}([a-z])$" ) {
63- # Increment the suffix letter
64- $lastSuffix = $matches [1 ]
65- $nextSuffix = [char ]([int ][char ]$lastSuffix + 1 )
66- if ($nextSuffix -gt ' z' ) {
67- Write-Error " Too many releases today! (exceeded 'z' suffix)"
72+ if ($existingTags ) {
73+ Write-Host " Existing tags for today:" - ForegroundColor Yellow
74+ $existingTags | ForEach-Object { Write-Host " $_ " - ForegroundColor Gray }
75+
76+ # Find the next suffix
77+ $lastTag = $existingTags | Select-Object - Last 1
78+
79+ if ($lastTag -eq $baseTag ) {
80+ # First release was without suffix, next is 'a'
81+ $newTag = " ${baseTag} a"
82+ } elseif ($lastTag -match " ^v\d{4}\.\d{2}\.\d{2}([a-z])$" ) {
83+ # Increment the suffix letter
84+ $lastSuffix = $matches [1 ]
85+ $nextSuffix = [char ]([int ][char ]$lastSuffix + 1 )
86+ if ($nextSuffix -gt ' z' ) {
87+ Write-Error " Too many releases today! (exceeded 'z' suffix)"
88+ exit 1
89+ }
90+ $newTag = " $baseTag$nextSuffix "
91+ } else {
92+ Write-Error " Unexpected tag format: $lastTag "
6893 exit 1
6994 }
70- $newTag = " $baseTag$nextSuffix "
7195 } else {
72- Write-Error " Unexpected tag format: $lastTag "
73- exit 1
96+ # No releases today yet - use base tag without suffix
97+ $newTag = $baseTag
7498 }
75- } else {
76- # No releases today yet - use base tag without suffix
77- $newTag = $baseTag
7899}
79100
80101# Get the last tag for generating changelog
@@ -83,7 +104,13 @@ $versionNumber = $newTag -replace '^v', ''
83104
84105Write-Host " "
85106Write-Host " New release tag: " - NoNewline
86- Write-Host $newTag - ForegroundColor Green
107+ if ($Beta ) {
108+ Write-Host $newTag - ForegroundColor Yellow
109+ Write-Host " Type: BETA (will update dev branch)" - ForegroundColor Yellow
110+ } else {
111+ Write-Host $newTag - ForegroundColor Green
112+ Write-Host " Type: STABLE (will update main branch)" - ForegroundColor Green
113+ }
87114Write-Host " "
88115
89116# Generate release notes from git commits
0 commit comments