Skip to content

Commit 9f00859

Browse files
authored
Fix nightly build tag creation from develop
1 parent c94bbff commit 9f00859

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.github/workflows/GitFlow_Nightly-builds.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ jobs:
1818
build:
1919
name: Create Nightly Build
2020
runs-on: windows-latest
21+
22+
env:
23+
# Define the branch as a variable
24+
BRANCH: develop
25+
2126
steps:
2227
# Step 1: Checkout the develop branch for nightly builds
2328
- name: Checkout code
@@ -26,7 +31,7 @@ jobs:
2631
lfs: "true"
2732
fetch-depth: 0
2833
# Always checkout develop for nightly builds
29-
ref: develop
34+
ref: ${{ env.BRANCH }}
3035

3136
# Step 2: Verify if a new build is required by checking for merged PRs since last tag
3237
- name: Check for merged PRs since last tag
@@ -38,7 +43,7 @@ jobs:
3843
Write-Host "Latest tag: $LATEST_TAG"
3944
4045
# Get merged PRs since last tag using Git directly
41-
$MERGED_PRS = git log --merges --grep="Merge pull request" --oneline "$LATEST_TAG..develop"
46+
$MERGED_PRS = git log --merges --grep="Merge pull request" --oneline "$LATEST_TAG..${{ env.BRANCH }}"
4247
4348
# If merged PRs exist, set BUILD_NEEDED and determine release type
4449
if ($MERGED_PRS) {
@@ -57,7 +62,7 @@ jobs:
5762
Write-Host "Next release: $RELEASE_TYPE"
5863
} else {
5964
# If no merged PRs, skip building
60-
Write-Host "No PRs merged to develop since latest tag. Skipping build."
65+
Write-Host "No PRs merged to ${{ env.BRANCH }} since latest tag. Skipping build."
6166
echo "BUILD_NEEDED=false" >> $env:GITHUB_OUTPUT
6267
}
6368
@@ -154,6 +159,7 @@ jobs:
154159
if: steps.check_prs.outputs.BUILD_NEEDED == 'true'
155160
with:
156161
tag: v${{ steps.format_version.outputs.NextSemVer }}
162+
commit: ${{ env.BRANCH }}
157163
prerelease: true
158164
generateReleaseNotes: true
159165
name: ${{ steps.format_version.outputs.ReleaseName }}
@@ -169,4 +175,4 @@ jobs:
169175
|[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>|
170176
|[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>|
171177
172-
<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>
178+
<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>

0 commit comments

Comments
 (0)