Skip to content

Commit d0d6e8c

Browse files
authored
Merge pull request #478 from plexguide/main
update
2 parents d0b9db5 + 1be25b6 commit d0d6e8c

File tree

3 files changed

+35
-5
lines changed

3 files changed

+35
-5
lines changed

.github/workflows/windows-build-nsis.yml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
name: Windows Build with NSIS
22

3+
# Add permissions needed for creating releases
4+
permissions:
5+
contents: write
6+
37
on:
48
push:
59
branches: [ "main", "dev", "win-*" ]
10+
tags:
11+
- "*" # This will trigger on any tag push
612
pull_request:
713
branches: [ "main", "dev" ]
814
workflow_dispatch:
@@ -13,6 +19,20 @@ jobs:
1319

1420
steps:
1521
- uses: actions/checkout@v3
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Extract metadata
26+
id: meta
27+
shell: bash
28+
run: |
29+
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
30+
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
31+
echo "IS_TAG=true" >> $GITHUB_OUTPUT
32+
else
33+
echo "VERSION=$(cat version.txt)" >> $GITHUB_OUTPUT
34+
echo "IS_TAG=false" >> $GITHUB_OUTPUT
35+
fi
1636
1737
- name: Set up Python
1838
uses: actions/setup-python@v4
@@ -76,11 +96,12 @@ jobs:
7696
& "C:\Program Files (x86)\NSIS\makensis.exe" $MakensisArgs
7797
7898
# Check if installer was created
79-
$installerPath = "distribution\windows\installer\installer\Huntarr_Setup.exe"
99+
$version = (Get-Content version.txt).Trim()
100+
$installerPath = "distribution\windows\installer\installer\Huntarr-${version}-win.exe"
80101
if (Test-Path $installerPath) {
81102
Write-Host "Installer created successfully at $installerPath"
82103
# Copy to expected upload location
83-
Copy-Item -Path $installerPath -Destination "installer\Huntarr_Setup.exe" -Force
104+
Copy-Item -Path $installerPath -Destination "installer\Huntarr-${version}-win.exe" -Force
84105
} else {
85106
Write-Error "Installer was not created. Check the logs above for errors."
86107
exit 1
@@ -93,4 +114,12 @@ jobs:
93114
uses: actions/upload-artifact@v4
94115
with:
95116
name: huntarr-installer
96-
path: installer/Huntarr_Setup.exe
117+
path: installer/Huntarr-*-win.exe
118+
119+
- name: Upload to release
120+
if: steps.meta.outputs.IS_TAG == 'true'
121+
uses: softprops/action-gh-release@v1
122+
with:
123+
files: installer/Huntarr-*-win.exe
124+
env:
125+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

distribution/windows/installer/huntarr_installer.nsi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141

4242
; General settings
4343
Name "${APPNAME}"
44-
OutFile "installer\${APPNAME}_Setup.exe"
44+
!echo "Creating installer: Huntarr-${VERSION}-win.exe"
45+
OutFile "installer\Huntarr-${VERSION}-win.exe"
4546
InstallDir "$PROGRAMFILES64\${APPNAME}"
4647
InstallDirRegKey HKLM "Software\${APPNAME}" "Install_Dir"
4748
RequestExecutionLevel admin ; Request admin privileges

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.0.5
1+
7.0.7

0 commit comments

Comments
 (0)