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
35 changes: 32 additions & 3 deletions .github/workflows/windows-build-nsis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
name: Windows Build with NSIS

# Add permissions needed for creating releases
permissions:
contents: write

on:
push:
branches: [ "main", "dev", "win-*" ]
tags:
- "*" # This will trigger on any tag push
pull_request:
branches: [ "main", "dev" ]
workflow_dispatch:
Expand All @@ -13,6 +19,20 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Extract metadata
id: meta
shell: bash
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
echo "IS_TAG=true" >> $GITHUB_OUTPUT
else
echo "VERSION=$(cat version.txt)" >> $GITHUB_OUTPUT
echo "IS_TAG=false" >> $GITHUB_OUTPUT
fi

- name: Set up Python
uses: actions/setup-python@v4
Expand Down Expand Up @@ -76,11 +96,12 @@ jobs:
& "C:\Program Files (x86)\NSIS\makensis.exe" $MakensisArgs

# Check if installer was created
$installerPath = "distribution\windows\installer\installer\Huntarr_Setup.exe"
$version = (Get-Content version.txt).Trim()
$installerPath = "distribution\windows\installer\installer\Huntarr-${version}-win.exe"
if (Test-Path $installerPath) {
Write-Host "Installer created successfully at $installerPath"
# Copy to expected upload location
Copy-Item -Path $installerPath -Destination "installer\Huntarr_Setup.exe" -Force
Copy-Item -Path $installerPath -Destination "installer\Huntarr-${version}-win.exe" -Force
} else {
Write-Error "Installer was not created. Check the logs above for errors."
exit 1
Expand All @@ -93,4 +114,12 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: huntarr-installer
path: installer/Huntarr_Setup.exe
path: installer/Huntarr-*-win.exe

- name: Upload to release
if: steps.meta.outputs.IS_TAG == 'true'
uses: softprops/action-gh-release@v1
with:
files: installer/Huntarr-*-win.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion distribution/windows/installer/huntarr_installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@

; General settings
Name "${APPNAME}"
OutFile "installer\${APPNAME}_Setup.exe"
!echo "Creating installer: Huntarr-${VERSION}-win.exe"
OutFile "installer\Huntarr-${VERSION}-win.exe"
InstallDir "$PROGRAMFILES64\${APPNAME}"
InstallDirRegKey HKLM "Software\${APPNAME}" "Install_Dir"
RequestExecutionLevel admin ; Request admin privileges
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0.5
7.0.7