Skip to content

Commit 14a308b

Browse files
committed
Merge branch 'fix/nightlies' of https://github.com/Romanitho/Winget-AutoUpdate into fix/nightlies
2 parents 1aee357 + ae51f88 commit 14a308b

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

.github/workflows/GitFlow_Nightly-builds.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,27 +44,22 @@ jobs:
4444
Write-Host "Checking for new changes since last release" -ForegroundColor Cyan
4545
Write-Host "========================================" -ForegroundColor Cyan
4646
47-
# Initialize variables with default values
48-
$BUILD_NEEDED = $false
49-
$RELEASE_TYPE = "prerelease"
47+
# Initialize RELEASE_TYPE with a default value to handle edge cases
48+
$RELEASE_TYPE = "preminor"
5049
5150
# Get the latest release tag to determine release type
5251
$LATEST_TAG = git tag -l --sort=-version:refname | Select-Object -First 1
5352
Write-Host "`n[INFO] Latest release tag: $LATEST_TAG" -ForegroundColor Green
5453
55-
# Determine release type based on previous tag (if tag exists)
56-
if ($LATEST_TAG) {
57-
if ($LATEST_TAG -like "*-*") {
58-
# Previous tag is a prerelease -> increment suffix (e.g., v2.9.1-0 -> v2.9.1-1)
59-
$RELEASE_TYPE = "prerelease"
60-
Write-Host "[INFO] Previous tag is a prerelease -> using 'prerelease' to increment suffix" -ForegroundColor Cyan
61-
} else {
62-
# Previous tag is stable -> create first prerelease (e.g., v2.9.0 -> v2.10.0-0)
63-
$RELEASE_TYPE = "preminor"
64-
Write-Host "[INFO] Previous tag is stable -> using 'preminor' to create first prerelease" -ForegroundColor Cyan
65-
}
54+
# Determine release type based on previous tag
55+
if ($LATEST_TAG -like "*-*") {
56+
# Previous tag is a prerelease -> increment suffix (e.g., v2.9.1-0 -> v2.9.1-1)
57+
$RELEASE_TYPE = "prerelease"
58+
Write-Host "[INFO] Previous tag is a prerelease -> using 'prerelease' to increment suffix" -ForegroundColor Cyan
6659
} else {
67-
Write-Host "[WARN] No existing tag found, using default 'prerelease' type" -ForegroundColor Yellow
60+
# Previous tag is stable -> create first prerelease (e.g., v2.9.0 -> v2.10.0-0)
61+
$RELEASE_TYPE = "preminor"
62+
Write-Host "[INFO] Previous tag is stable -> using 'preminor' to create first prerelease" -ForegroundColor Cyan
6863
}
6964
7065
# Manual trigger always builds
@@ -77,7 +72,7 @@ jobs:
7772
# Automated nightly: check for changes first
7873
Write-Host "`n[AUTO] Scheduled nightly build - checking for changes..." -ForegroundColor Cyan
7974
80-
# Get the commit date of the latest tag for display
75+
# Get the commit date of the latest tag (compatible with PowerShell 5.1)
8176
$TAG_DATE_FORMATTED = git log -1 --format=%ci $LATEST_TAG
8277
Write-Host "[INFO] Tag creation date: $TAG_DATE_FORMATTED" -ForegroundColor Green
8378
@@ -99,7 +94,7 @@ jobs:
9994
else {
10095
Write-Host "`n[INFO] Searching for merged PRs between $TAG_COMMIT and HEAD..." -ForegroundColor Cyan
10196
102-
# Get all merged PRs since the tag commit (HEAD already represents current branch)
97+
# Get all merged PRs to the branch since the tag commit
10398
$MERGED_PRS = git log --merges --grep="Merge pull request" --pretty=format:"%h %s" "$TAG_COMMIT..HEAD"
10499
105100
# Count merges

0 commit comments

Comments
 (0)