Skip to content
Closed
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
39 changes: 22 additions & 17 deletions .github/workflows/GitFlow_Nightly-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# - Checks for merged PRs since the last tag
# - Creates a pre-release version if changes are detected
# - Builds and packages the software
# - Creates GitHub release with artifacts and download counters
# - Creates GitHub release with artifacts

name: GitFlow | Nightly Builds

Expand Down Expand Up @@ -43,28 +43,28 @@ jobs:
# Get the latest release tag (any 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
}
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."
$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"
Expand Down Expand Up @@ -158,19 +158,26 @@ jobs:

# Package ADMX policy templates
echo "### Zip ADMX ###"
Compress-Archive -Path .\Sources\Policies\ADMX -DestinationPath .\WAU_ADMX.zip -Force
$admxPath = ".\Sources\Policies\ADMX\WAU.admx"
try {
(Get-Content $admxPath -Raw -ErrorAction Stop) -match 'revision="([\d\.]+)"' | Out-Null
$ADMXversion = $matches[1]
$admxZip = "WAU_ADMX_$($ADMXversion).zip"
}
catch {
Write-Host "Error getting WAU ADMX version!"
$admxZip = "WAU_ADMX.zip"
}
Compress-Archive -Path .\Sources\Policies\ADMX -DestinationPath .\$admxZip -Force
Get-Item .\*.zip
echo "admx_zip_name=$admxZip" >> $env:GITHUB_OUTPUT

# Calculate ADMX package hash for verification
echo "### Get ADMX zip SHA ###"
$ADMXSHA = (Get-FileHash .\WAU_ADMX.zip).hash
echo " - WAU_ADMX.zip SHA256: $ADMXSHA"
$ADMXSHA = (Get-FileHash .\$admxZip).hash
echo " - $admxZip SHA256: $ADMXSHA"
echo "admx_sha=$ADMXSHA" >> $env:GITHUB_OUTPUT

# Create installation counter file for tracking installs
echo "### Create install counter file ###"
echo "Install counter file." > WAU_InstallCounter

# Step 6: Create GitHub release with all artifacts
- name: Create release
uses: ncipollo/release-action@bcfe5470707e8832e12347755757cec0eb3c22af # v1.18.0
Expand All @@ -181,7 +188,7 @@ jobs:
prerelease: true
generateReleaseNotes: true
name: ${{ steps.format_version.outputs.ReleaseName }}
artifacts: "WAU.msi,WAU_ADMX.zip,WAU_InstallCounter"
artifacts: "WAU.msi,${{ steps.build_project.outputs.admx_zip_name }}"
body: |
${{ steps.format_version.outputs.ReleaseBodyIntro }}

Expand All @@ -191,6 +198,4 @@ jobs:
|Files|Hash (SHA256)|Downloads|
|---|---|---|
|[WAU.msi](https://github.com/Romanitho/Winget-AutoUpdate/releases/download/v${{ steps.format_version.outputs.NextSemVer }}/WAU.msi) (x64)|`${{ steps.build_project.outputs.msi_sha }}`|<picture>![WAU.msi](https://img.shields.io/github/downloads/Romanitho/Winget-AutoUpdate/v${{ steps.format_version.outputs.NextSemVer }}/WAU.msi?style=flat-square&label=&color=blue)</picture>|
|[WAU_ADMX.zip](https://github.com/Romanitho/Winget-AutoUpdate/releases/download/v${{ steps.format_version.outputs.NextSemVer }}/WAU_ADMX.zip)|`${{ steps.build_project.outputs.admx_sha }}`|<picture>![WAU_ADMX.zip](https://img.shields.io/github/downloads/Romanitho/Winget-AutoUpdate/v${{ steps.format_version.outputs.NextSemVer }}/WAU_ADMX.zip?style=flat-square&label=&color=blue)</picture>|

<picture>![Install counter](https://img.shields.io/github/downloads/Romanitho/Winget-AutoUpdate/v${{ steps.format_version.outputs.NextSemVer }}/WAU_InstallCounter?style=flat-square&label=Total%20reported%20installations%20for%20this%20release&color=blue)</picture>
|[${{ steps.build_project.outputs.admx_zip_name }}](https://github.com/Romanitho/Winget-AutoUpdate/releases/download/v${{ steps.format_version.outputs.NextSemVer }}/${{ steps.build_project.outputs.admx_zip_name }})|`${{ steps.build_project.outputs.admx_sha }}`|<picture>![${{ steps.build_project.outputs.admx_zip_name }}](https://img.shields.io/github/downloads/Romanitho/Winget-AutoUpdate/v${{ steps.format_version.outputs.NextSemVer }}/${{ steps.build_project.outputs.admx_zip_name }}?style=flat-square&label=&color=blue)</picture>|
3 changes: 2 additions & 1 deletion Sources/Winget-AutoUpdate/config/default_excluded_apps.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
AnyDesk.AnyDesk
Brave.Brave*
Google.Chrome*
Microsoft.Edge*
Expand All @@ -8,4 +9,4 @@ Microsoft.Teams*
Mozilla.Firefox*
Opera.Opera*
TeamViewer.TeamViewer*
Romanitho.Winget-AutoUpdate
Romanitho.Winget-AutoUpdate
Loading