Skip to content

Commit 926449f

Browse files
authored
Merge pull request #1100 from Romanitho/release/2.9.1
Release 2.9.1
2 parents f66242e + b80d5cb commit 926449f

File tree

3 files changed

+81
-28
lines changed

3 files changed

+81
-28
lines changed

.github/workflows/GitFlow_Create-Release-Branch-and-PR.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
# Step 4: Create a pull request from release branch to main
5959
- name: Create Pull Request with GitHub CLI
6060
env:
61-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
GH_TOKEN: ${{ secrets.GH_PAT_SYNC }}
6262
run: |
6363
# Use GitHub CLI to create a properly formatted Pull Request
6464
gh pr create \
@@ -68,4 +68,4 @@ jobs:
6868
--label "release" \
6969
--body "# Release ${{ steps.versioning.outputs.version }}
7070
71-
This PR is automatically created to perform the final tests and validations before the release is created."
71+
This PR is automatically created to perform the final tests and validations before the release is created."

.github/workflows/GitFlow_Nightly-builds.yml

Lines changed: 78 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -40,41 +40,94 @@ jobs:
4040
id: check_prs
4141
shell: powershell
4242
run: |
43-
# Get the latest release tag (any type)
43+
Write-Host "========================================" -ForegroundColor Cyan
44+
Write-Host "Checking for new changes since last release" -ForegroundColor Cyan
45+
Write-Host "========================================" -ForegroundColor Cyan
46+
47+
# Initialize BUILD_NEEDED with default value
48+
$BUILD_NEEDED = $false
49+
50+
# Get the latest release tag to determine release type
4451
$LATEST_TAG = git tag -l --sort=-version:refname | Select-Object -First 1
45-
Write-Host "Latest release: $LATEST_TAG"
46-
47-
# Get all merged PRs since last tag (only merge commits from PRs)
48-
$MERGED_PRS = git log --merges --grep="Merge pull request" --pretty=format:"%h %s" "$LATEST_TAG..develop"
49-
50-
# Count merges
51-
$MERGE_COUNT = ($MERGED_PRS | Measure-Object).Count
52-
53-
if ($MERGE_COUNT -eq 0) {
54-
Write-Host "No PRs merged to develop since last tag. Skipping build."
55-
$BUILD_NEEDED = $false
52+
Write-Host "`n[INFO] Latest release tag: $LATEST_TAG" -ForegroundColor Green
53+
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
59+
} else {
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
63+
}
64+
65+
# Manual trigger always builds
66+
if ("${{ github.event_name }}" -eq "workflow_dispatch") {
67+
Write-Host "`n[MANUAL] Manual trigger detected - forcing build" -ForegroundColor Magenta
68+
Write-Host "[BUILD] Building new prerelease version (type: $RELEASE_TYPE)." -ForegroundColor Green
69+
$BUILD_NEEDED = $true
5670
}
5771
else {
58-
Write-Host "Merged PRs since last tag (develop):"
59-
Write-Host $MERGED_PRS
60-
61-
if ($MERGE_COUNT -eq 1 -and $MERGED_PRS -match "Merge pull request #\d+ from .*/release/") {
62-
Write-Host "Only change since last tag is a release PR merge. Skipping build."
72+
# Automated nightly: check for changes first
73+
Write-Host "`n[AUTO] Scheduled nightly build - checking for changes..." -ForegroundColor Cyan
74+
75+
# Get the commit date of the latest tag (compatible with PowerShell 5.1)
76+
$TAG_DATE_FORMATTED = git log -1 --format=%ci $LATEST_TAG
77+
Write-Host "[INFO] Tag creation date: $TAG_DATE_FORMATTED" -ForegroundColor Green
78+
79+
# Get tag commit SHA
80+
$TAG_COMMIT = git rev-list -n 1 $LATEST_TAG
81+
Write-Host "[INFO] Tag commit SHA: $TAG_COMMIT" -ForegroundColor Green
82+
83+
# Get current branch and HEAD commit
84+
$BRANCH = "${{ env.BRANCH }}"
85+
$HEAD_COMMIT = git rev-parse HEAD
86+
Write-Host "[INFO] Current branch: $BRANCH" -ForegroundColor Green
87+
Write-Host "[INFO] Current HEAD: $HEAD_COMMIT" -ForegroundColor Green
88+
89+
# Check if tag commit is the same as HEAD
90+
if ($TAG_COMMIT -eq $HEAD_COMMIT) {
91+
Write-Host "`n[SKIP] Tag commit is identical to current HEAD. No new changes." -ForegroundColor Yellow
6392
$BUILD_NEEDED = $false
6493
}
6594
else {
66-
$BUILD_NEEDED = $true
67-
68-
# Set release type for output (adapts to your previous logic if you need it)
69-
if ($LATEST_TAG -like "*-*") {
70-
$RELEASE_TYPE = "prerelease"
71-
} else {
72-
$RELEASE_TYPE = "preminor"
95+
Write-Host "`n[INFO] Searching for merged PRs between $TAG_COMMIT and HEAD..." -ForegroundColor Cyan
96+
97+
# Get all merged PRs to the branch since the tag commit
98+
$MERGED_PRS = git log --merges --grep="Merge pull request" --pretty=format:"%h %s" "$TAG_COMMIT..HEAD"
99+
100+
# Count merges
101+
$MERGE_COUNT = ($MERGED_PRS | Measure-Object).Count
102+
Write-Host "[INFO] Found $MERGE_COUNT merged PR(s)" -ForegroundColor Green
103+
104+
if ($MERGE_COUNT -eq 0) {
105+
Write-Host "`n[SKIP] No PRs merged to $BRANCH since last tag. Skipping build." -ForegroundColor Yellow
106+
$BUILD_NEEDED = $false
107+
}
108+
else {
109+
Write-Host "`n[INFO] Merged PRs since last tag:" -ForegroundColor Cyan
110+
$MERGED_PRS | ForEach-Object { Write-Host " - $_" -ForegroundColor White }
111+
112+
if ($MERGE_COUNT -eq 1 -and $MERGED_PRS -match "Merge pull request #\d+ from .*/release/") {
113+
Write-Host "`n[SKIP] Only change since last tag is a release PR merge. Skipping build." -ForegroundColor Yellow
114+
$BUILD_NEEDED = $false
115+
}
116+
else {
117+
Write-Host "`n[BUILD] Building new prerelease version (type: $RELEASE_TYPE)." -ForegroundColor Green
118+
$BUILD_NEEDED = $true
119+
}
73120
}
74-
echo "RELEASE_TYPE=$RELEASE_TYPE" >> $env:GITHUB_OUTPUT
75121
}
76122
}
123+
124+
Write-Host "`n========================================" -ForegroundColor Cyan
125+
Write-Host "Build needed: $BUILD_NEEDED" -ForegroundColor $(if ($BUILD_NEEDED -eq $true) { "Green" } else { "Yellow" })
126+
Write-Host "Release type: $RELEASE_TYPE" -ForegroundColor Cyan
127+
Write-Host "========================================" -ForegroundColor Cyan
128+
77129
echo "BUILD_NEEDED=$BUILD_NEEDED" >> $env:GITHUB_OUTPUT
130+
echo "RELEASE_TYPE=$RELEASE_TYPE" >> $env:GITHUB_OUTPUT
78131
79132
# Step 3: Generate new semantic version number
80133
- name: Auto Increment Semver Action

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ You can update only pre-selected apps. To do so, create an "included_apps.txt" w
4040
> The lists can contain Wildcard (*). For instance ```Mozilla.Firefox*``` will take care of all Firefox channels.
4141
4242
List and Mods folder content will be copied to WAU install location:
43-
![image](https://github.com/user-attachments/assets/a37837b0-b61e-4ce7-b23c-fd8661585e40)
43+
<img width="474" height="308" alt="423074783-a37837b0-b61e-4ce7-b23c-fd8661585e40" src="https://github.com/user-attachments/assets/323fc50c-2400-4fa2-937d-83a0f0c2392d" />
4444

4545

4646
### Notification Level

0 commit comments

Comments
 (0)