From f51041722e4077afda317588c0763f6d24ada803 Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Tue, 16 Dec 2025 13:11:54 +0100 Subject: [PATCH 1/9] Improve nightly build PR check and logging Enhanced the PowerShell script in the nightly build workflow to provide clearer logging, more robust detection of merged PRs since the last release, and improved logic for determining when a build is needed. The script now distinguishes between manual and scheduled triggers, checks for changes more reliably, and outputs detailed information about the release type and build decision. --- .github/workflows/GitFlow_Nightly-builds.yml | 101 ++++++++++++++----- 1 file changed, 76 insertions(+), 25 deletions(-) diff --git a/.github/workflows/GitFlow_Nightly-builds.yml b/.github/workflows/GitFlow_Nightly-builds.yml index 14923a7e..6133d7a2 100644 --- a/.github/workflows/GitFlow_Nightly-builds.yml +++ b/.github/workflows/GitFlow_Nightly-builds.yml @@ -40,41 +40,92 @@ jobs: id: check_prs shell: powershell run: | - # Get the latest release tag (any type) + Write-Host "========================================" -ForegroundColor Cyan + Write-Host "Checking for new changes since last release" -ForegroundColor Cyan + Write-Host "========================================" -ForegroundColor Cyan + + # Get the latest release tag to determine release type $LATEST_TAG = git tag -l --sort=-version:refname | Select-Object -First 1 - Write-Host "Latest release: $LATEST_TAG" - - # Get all merged PRs since last tag (only merge commits from PRs) - $MERGED_PRS = git log --merges --grep="Merge pull request" --pretty=format:"%h %s" "$LATEST_TAG..develop" - - # Count merges - $MERGE_COUNT = ($MERGED_PRS | Measure-Object).Count - - if ($MERGE_COUNT -eq 0) { - Write-Host "No PRs merged to develop since last tag. Skipping build." - $BUILD_NEEDED = $false + Write-Host "`n[INFO] Latest release tag: $LATEST_TAG" -ForegroundColor Green + + # Determine release type based on previous tag + if ($LATEST_TAG -like "*-*") { + # Previous tag is a prerelease -> increment suffix (e.g., v2.9.1-0 -> v2.9.1-1) + $RELEASE_TYPE = "prerelease" + Write-Host "[INFO] Previous tag is a prerelease -> using 'prerelease' to increment suffix" -ForegroundColor Cyan + } else { + # Previous tag is stable -> create first prerelease (e.g., v2.9.0 -> v2.10.0-0) + $RELEASE_TYPE = "preminor" + Write-Host "[INFO] Previous tag is stable -> using 'preminor' to create first prerelease" -ForegroundColor Cyan + } + + # Manual trigger always builds + if ("${{ github.event_name }}" -eq "workflow_dispatch") { + Write-Host "`n[MANUAL] Manual trigger detected - forcing build" -ForegroundColor Magenta + Write-Host "[BUILD] Building new prerelease version (type: $RELEASE_TYPE)." -ForegroundColor Green + $BUILD_NEEDED = $true } else { - Write-Host "Merged PRs since last tag (develop):" - Write-Host $MERGED_PRS - - if ($MERGE_COUNT -eq 1 -and $MERGED_PRS -match "Merge pull request #\d+ from .*/release/") { - Write-Host "Only change since last tag is a release PR merge. Skipping build." + # Automated nightly: check for changes first + Write-Host "`n[AUTO] Scheduled nightly build - checking for changes..." -ForegroundColor Cyan + + # Get the commit date of the latest tag (compatible with PowerShell 5.1) + $TAG_DATE = git log -1 --format=%ct $LATEST_TAG + $TAG_DATE_FORMATTED = git log -1 --format=%ci $LATEST_TAG + Write-Host "[INFO] Tag creation date: $TAG_DATE_FORMATTED" -ForegroundColor Green + + # Get tag commit SHA + $TAG_COMMIT = git rev-list -n 1 $LATEST_TAG + Write-Host "[INFO] Tag commit SHA: $TAG_COMMIT" -ForegroundColor Green + + # Get current branch and HEAD commit + $BRANCH = "${{ env.BRANCH }}" + $HEAD_COMMIT = git rev-parse HEAD + Write-Host "[INFO] Current branch: $BRANCH" -ForegroundColor Green + Write-Host "[INFO] Current HEAD: $HEAD_COMMIT" -ForegroundColor Green + + # Check if tag commit is the same as HEAD + if ($TAG_COMMIT -eq $HEAD_COMMIT) { + Write-Host "`n[SKIP] Tag commit is identical to current HEAD. No new changes." -ForegroundColor Yellow $BUILD_NEEDED = $false } else { - $BUILD_NEEDED = $true - - # Set release type for output (adapts to your previous logic if you need it) - if ($LATEST_TAG -like "*-*") { - $RELEASE_TYPE = "prerelease" - } else { - $RELEASE_TYPE = "preminor" + Write-Host "`n[INFO] Searching for merged PRs between $TAG_COMMIT and HEAD..." -ForegroundColor Cyan + + # Get all merged PRs to the branch since the tag commit + $MERGED_PRS = git log $BRANCH --merges --grep="Merge pull request" --pretty=format:"%h %s" "$TAG_COMMIT..HEAD" + + # Count merges + $MERGE_COUNT = ($MERGED_PRS | Measure-Object).Count + Write-Host "[INFO] Found $MERGE_COUNT merged PR(s)" -ForegroundColor Green + + if ($MERGE_COUNT -eq 0) { + Write-Host "`n[SKIP] No PRs merged to $BRANCH since last tag. Skipping build." -ForegroundColor Yellow + $BUILD_NEEDED = $false + } + else { + Write-Host "`n[INFO] Merged PRs since last tag:" -ForegroundColor Cyan + $MERGED_PRS | ForEach-Object { Write-Host " - $_" -ForegroundColor White } + + if ($MERGE_COUNT -eq 1 -and $MERGED_PRS -match "Merge pull request #\d+ from .*/release/") { + Write-Host "`n[SKIP] Only change since last tag is a release PR merge. Skipping build." -ForegroundColor Yellow + $BUILD_NEEDED = $false + } + else { + Write-Host "`n[BUILD] Building new prerelease version (type: $RELEASE_TYPE)." -ForegroundColor Green + $BUILD_NEEDED = $true + } } - echo "RELEASE_TYPE=$RELEASE_TYPE" >> $env:GITHUB_OUTPUT } } + + Write-Host "`n========================================" -ForegroundColor Cyan + Write-Host "Build needed: $BUILD_NEEDED" -ForegroundColor $(if ($BUILD_NEEDED -eq $true) { "Green" } else { "Yellow" }) + Write-Host "Release type: $RELEASE_TYPE" -ForegroundColor Cyan + Write-Host "========================================" -ForegroundColor Cyan + echo "BUILD_NEEDED=$BUILD_NEEDED" >> $env:GITHUB_OUTPUT + echo "RELEASE_TYPE=$RELEASE_TYPE" >> $env:GITHUB_OUTPUT # Step 3: Generate new semantic version number - name: Auto Increment Semver Action From 323f148fa401da9f6b5e919b189fdfe8c85cbee7 Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Tue, 16 Dec 2025 13:33:12 +0100 Subject: [PATCH 2/9] Update .github/workflows/GitFlow_Nightly-builds.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/GitFlow_Nightly-builds.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/GitFlow_Nightly-builds.yml b/.github/workflows/GitFlow_Nightly-builds.yml index 6133d7a2..97464f0f 100644 --- a/.github/workflows/GitFlow_Nightly-builds.yml +++ b/.github/workflows/GitFlow_Nightly-builds.yml @@ -70,7 +70,6 @@ jobs: Write-Host "`n[AUTO] Scheduled nightly build - checking for changes..." -ForegroundColor Cyan # Get the commit date of the latest tag (compatible with PowerShell 5.1) - $TAG_DATE = git log -1 --format=%ct $LATEST_TAG $TAG_DATE_FORMATTED = git log -1 --format=%ci $LATEST_TAG Write-Host "[INFO] Tag creation date: $TAG_DATE_FORMATTED" -ForegroundColor Green From c22fc95b6f27133436a5e24d34fd9a16e13c70fb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 16 Dec 2025 12:34:32 +0000 Subject: [PATCH 3/9] Initial plan From 1aee357c15bd8bb6411c390c160d3f22f4ccaa0b Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Tue, 16 Dec 2025 13:34:58 +0100 Subject: [PATCH 4/9] Update GitFlow_Nightly-builds.yml --- .github/workflows/GitFlow_Nightly-builds.yml | 31 ++++++++++++-------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/GitFlow_Nightly-builds.yml b/.github/workflows/GitFlow_Nightly-builds.yml index 6133d7a2..c20e6908 100644 --- a/.github/workflows/GitFlow_Nightly-builds.yml +++ b/.github/workflows/GitFlow_Nightly-builds.yml @@ -44,19 +44,27 @@ jobs: Write-Host "Checking for new changes since last release" -ForegroundColor Cyan Write-Host "========================================" -ForegroundColor Cyan + # Initialize variables with default values + $BUILD_NEEDED = $false + $RELEASE_TYPE = "prerelease" + # Get the latest release tag to determine release type $LATEST_TAG = git tag -l --sort=-version:refname | Select-Object -First 1 Write-Host "`n[INFO] Latest release tag: $LATEST_TAG" -ForegroundColor Green - # Determine release type based on previous tag - if ($LATEST_TAG -like "*-*") { - # Previous tag is a prerelease -> increment suffix (e.g., v2.9.1-0 -> v2.9.1-1) - $RELEASE_TYPE = "prerelease" - Write-Host "[INFO] Previous tag is a prerelease -> using 'prerelease' to increment suffix" -ForegroundColor Cyan + # Determine release type based on previous tag (if tag exists) + if ($LATEST_TAG) { + if ($LATEST_TAG -like "*-*") { + # Previous tag is a prerelease -> increment suffix (e.g., v2.9.1-0 -> v2.9.1-1) + $RELEASE_TYPE = "prerelease" + Write-Host "[INFO] Previous tag is a prerelease -> using 'prerelease' to increment suffix" -ForegroundColor Cyan + } else { + # Previous tag is stable -> create first prerelease (e.g., v2.9.0 -> v2.10.0-0) + $RELEASE_TYPE = "preminor" + Write-Host "[INFO] Previous tag is stable -> using 'preminor' to create first prerelease" -ForegroundColor Cyan + } } else { - # Previous tag is stable -> create first prerelease (e.g., v2.9.0 -> v2.10.0-0) - $RELEASE_TYPE = "preminor" - Write-Host "[INFO] Previous tag is stable -> using 'preminor' to create first prerelease" -ForegroundColor Cyan + Write-Host "[WARN] No existing tag found, using default 'prerelease' type" -ForegroundColor Yellow } # Manual trigger always builds @@ -69,8 +77,7 @@ jobs: # Automated nightly: check for changes first Write-Host "`n[AUTO] Scheduled nightly build - checking for changes..." -ForegroundColor Cyan - # Get the commit date of the latest tag (compatible with PowerShell 5.1) - $TAG_DATE = git log -1 --format=%ct $LATEST_TAG + # Get the commit date of the latest tag for display $TAG_DATE_FORMATTED = git log -1 --format=%ci $LATEST_TAG Write-Host "[INFO] Tag creation date: $TAG_DATE_FORMATTED" -ForegroundColor Green @@ -92,8 +99,8 @@ jobs: else { Write-Host "`n[INFO] Searching for merged PRs between $TAG_COMMIT and HEAD..." -ForegroundColor Cyan - # Get all merged PRs to the branch since the tag commit - $MERGED_PRS = git log $BRANCH --merges --grep="Merge pull request" --pretty=format:"%h %s" "$TAG_COMMIT..HEAD" + # Get all merged PRs since the tag commit (HEAD already represents current branch) + $MERGED_PRS = git log --merges --grep="Merge pull request" --pretty=format:"%h %s" "$TAG_COMMIT..HEAD" # Count merges $MERGE_COUNT = ($MERGED_PRS | Measure-Object).Count From 8bd0b28d5aa96622fe39bb72577b95482ea1a69f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 16 Dec 2025 12:36:53 +0000 Subject: [PATCH 5/9] Add default RELEASE_TYPE initialization to handle edge cases Co-authored-by: Romanitho <96626929+Romanitho@users.noreply.github.com> --- .github/workflows/GitFlow_Nightly-builds.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/GitFlow_Nightly-builds.yml b/.github/workflows/GitFlow_Nightly-builds.yml index 97464f0f..44507789 100644 --- a/.github/workflows/GitFlow_Nightly-builds.yml +++ b/.github/workflows/GitFlow_Nightly-builds.yml @@ -44,6 +44,9 @@ jobs: Write-Host "Checking for new changes since last release" -ForegroundColor Cyan Write-Host "========================================" -ForegroundColor Cyan + # Initialize RELEASE_TYPE with a default value to handle edge cases + $RELEASE_TYPE = "preminor" + # Get the latest release tag to determine release type $LATEST_TAG = git tag -l --sort=-version:refname | Select-Object -First 1 Write-Host "`n[INFO] Latest release tag: $LATEST_TAG" -ForegroundColor Green From ae51f888bd853887ff40e488393573dbee0edfc0 Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Tue, 16 Dec 2025 13:42:09 +0100 Subject: [PATCH 6/9] Update .github/workflows/GitFlow_Nightly-builds.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/GitFlow_Nightly-builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/GitFlow_Nightly-builds.yml b/.github/workflows/GitFlow_Nightly-builds.yml index 44507789..3ea48994 100644 --- a/.github/workflows/GitFlow_Nightly-builds.yml +++ b/.github/workflows/GitFlow_Nightly-builds.yml @@ -95,7 +95,7 @@ jobs: Write-Host "`n[INFO] Searching for merged PRs between $TAG_COMMIT and HEAD..." -ForegroundColor Cyan # Get all merged PRs to the branch since the tag commit - $MERGED_PRS = git log $BRANCH --merges --grep="Merge pull request" --pretty=format:"%h %s" "$TAG_COMMIT..HEAD" + $MERGED_PRS = git log --merges --grep="Merge pull request" --pretty=format:"%h %s" "$TAG_COMMIT..HEAD" # Count merges $MERGE_COUNT = ($MERGED_PRS | Measure-Object).Count From 7cd77b2f1af5145386b9b81d00f8d8768e7c231b Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Tue, 16 Dec 2025 13:51:28 +0100 Subject: [PATCH 7/9] Update nightly build script variable initialization --- .github/workflows/GitFlow_Nightly-builds.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/GitFlow_Nightly-builds.yml b/.github/workflows/GitFlow_Nightly-builds.yml index 3ea48994..bb9a822f 100644 --- a/.github/workflows/GitFlow_Nightly-builds.yml +++ b/.github/workflows/GitFlow_Nightly-builds.yml @@ -44,8 +44,8 @@ jobs: Write-Host "Checking for new changes since last release" -ForegroundColor Cyan Write-Host "========================================" -ForegroundColor Cyan - # Initialize RELEASE_TYPE with a default value to handle edge cases - $RELEASE_TYPE = "preminor" + # Initialize BUILD_NEEDED with default value + $BUILD_NEEDED = $false # Get the latest release tag to determine release type $LATEST_TAG = git tag -l --sort=-version:refname | Select-Object -First 1 From 5fdb19182cde91be4ce98e962ad5d7f2c074ea14 Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Wed, 17 Dec 2025 03:21:07 +0100 Subject: [PATCH 8/9] Change GitHub token for PR creation step --- .github/workflows/GitFlow_Create-Release-Branch-and-PR.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/GitFlow_Create-Release-Branch-and-PR.yaml b/.github/workflows/GitFlow_Create-Release-Branch-and-PR.yaml index b4e4720b..6d6edd2d 100644 --- a/.github/workflows/GitFlow_Create-Release-Branch-and-PR.yaml +++ b/.github/workflows/GitFlow_Create-Release-Branch-and-PR.yaml @@ -58,7 +58,7 @@ jobs: # Step 4: Create a pull request from release branch to main - name: Create Pull Request with GitHub CLI env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GH_PAT_SYNC }} run: | # Use GitHub CLI to create a properly formatted Pull Request gh pr create \ @@ -68,4 +68,4 @@ jobs: --label "release" \ --body "# Release ${{ steps.versioning.outputs.version }} - This PR is automatically created to perform the final tests and validations before the release is created." \ No newline at end of file + This PR is automatically created to perform the final tests and validations before the release is created." From 75a2b82d0de503c56c15294c78f6ea63fce8bd18 Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Wed, 17 Dec 2025 03:24:02 +0100 Subject: [PATCH 9/9] Replace image link with updated version Updated image link in README.md for better clarity. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7e200754..84f954cf 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ You can update only pre-selected apps. To do so, create an "included_apps.txt" w > The lists can contain Wildcard (*). For instance ```Mozilla.Firefox*``` will take care of all Firefox channels. List and Mods folder content will be copied to WAU install location: -![image](https://github.com/user-attachments/assets/a37837b0-b61e-4ce7-b23c-fd8661585e40) +423074783-a37837b0-b61e-4ce7-b23c-fd8661585e40 ### Notification Level