Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/GitFlow_Create-Release-Branch-and-PR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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."
This PR is automatically created to perform the final tests and validations before the release is created."
103 changes: 78 additions & 25 deletions .github/workflows/GitFlow_Nightly-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,41 +40,94 @@ 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

# 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
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_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 --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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
<img width="474" height="308" alt="423074783-a37837b0-b61e-4ce7-b23c-fd8661585e40" src="https://github.com/user-attachments/assets/323fc50c-2400-4fa2-937d-83a0f0c2392d" />


### Notification Level
Expand Down
Loading