Skip to content

Commit 8c884a1

Browse files
committed
Add Apprise support for macOS and Windows builds
- Updated macOS installer workflows to include Apprise and its dependencies for notification support. - Modified Windows build script to explicitly install Apprise and its dependencies. - Enhanced huntarr.spec to bundle Apprise data files, addressing attachment directory issues. - Ensured all relevant Apprise modules are collected during the build process for both macOS and Windows.
1 parent c2f63f5 commit 8c884a1

File tree

5 files changed

+72
-4
lines changed

5 files changed

+72
-4
lines changed

.github/workflows/macos-installer-arm.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,26 @@ jobs:
342342
'qrcode.image.pil',
343343
'routes',
344344
'main',
345+
# Apprise notification support
346+
'apprise',
347+
'apprise.common',
348+
'apprise.conversion',
349+
'apprise.decorators',
350+
'apprise.locale',
351+
'apprise.logger',
352+
'apprise.manager',
353+
'apprise.utils',
354+
'apprise.URLBase',
355+
'apprise.AppriseAsset',
356+
'apprise.AppriseAttachment',
357+
'apprise.AppriseConfig',
358+
'apprise.cli',
359+
'apprise.config',
360+
'apprise.attachment',
361+
'apprise.plugins',
362+
'markdown',
363+
'yaml',
364+
'cryptography',
345365
],
346366
hookspath=['hooks'],
347367
hooksconfig={},
@@ -406,7 +426,7 @@ jobs:
406426
EOF
407427
408428
- name: Build macOS app bundle
409-
run: python -m PyInstaller Huntarr.spec --clean
429+
run: python -m PyInstaller Huntarr.spec --clean --collect-all apprise
410430

411431
- name: Create PKG installer
412432
run: |

.github/workflows/macos-installer-intel.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,26 @@ jobs:
338338
'qrcode.image.pil',
339339
'routes',
340340
'main',
341+
# Apprise notification support
342+
'apprise',
343+
'apprise.common',
344+
'apprise.conversion',
345+
'apprise.decorators',
346+
'apprise.locale',
347+
'apprise.logger',
348+
'apprise.manager',
349+
'apprise.utils',
350+
'apprise.URLBase',
351+
'apprise.AppriseAsset',
352+
'apprise.AppriseAttachment',
353+
'apprise.AppriseConfig',
354+
'apprise.cli',
355+
'apprise.config',
356+
'apprise.attachment',
357+
'apprise.plugins',
358+
'markdown',
359+
'yaml',
360+
'cryptography',
341361
],
342362
hookspath=['hooks'],
343363
hooksconfig={},
@@ -402,7 +422,7 @@ jobs:
402422
EOF
403423
404424
- name: Build macOS app bundle
405-
run: python -m PyInstaller Huntarr.spec --clean
425+
run: python -m PyInstaller Huntarr.spec --clean --collect-all apprise
406426

407427
- name: Create PKG installer
408428
run: |

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ jobs:
4545
pip install -r requirements.txt
4646
pip install pyinstaller==5.13.0
4747
pip install pywin32
48+
# Explicitly install apprise and its dependencies for Windows build
49+
pip install apprise==1.6.0
50+
pip install markdown==3.4.3
51+
pip install pyyaml==6.0
4852
4953
- name: Create directories
5054
run: |
@@ -60,7 +64,9 @@ jobs:
6064
# Use the dedicated build script from the distribution directory
6165
python -m pip install -r requirements.txt
6266
python -m pip install pywin32
63-
pyinstaller -y distribution/windows/huntarr.spec
67+
68+
# Build with apprise support - use --collect-all apprise to fix attachment directory error
69+
pyinstaller -y --collect-all apprise distribution/windows/huntarr.spec
6470
6571
# Display contents of dist/Huntarr
6672
dir dist/Huntarr

distribution/windows/build.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ def build_exe():
6464
# Make sure we're in the project root directory when running PyInstaller
6565
# This helps with finding relative paths
6666
# Add the -y option to force overwrite of the output directory
67-
result = run_command([sys.executable, "-m", "PyInstaller", "-y", str(spec_file)], cwd=str(ROOT_DIR))
67+
# Add --collect-all apprise to bundle all apprise data files and dependencies
68+
result = run_command([sys.executable, "-m", "PyInstaller", "-y", "--collect-all", "apprise", str(spec_file)], cwd=str(ROOT_DIR))
6869

6970
if not result:
7071
print("ERROR: PyInstaller failed to build the executable")

distribution/windows/huntarr.spec

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,27 @@ datas = [
4141
(str(project_dir / 'src'), 'src'),
4242
]
4343

44+
# Add apprise data files to fix attachment directory error
45+
try:
46+
import apprise
47+
import os
48+
apprise_path = os.path.dirname(apprise.__file__)
49+
# Add apprise's attachment, plugins, and config directories
50+
apprise_attachment_path = os.path.join(apprise_path, 'attachment')
51+
apprise_plugins_path = os.path.join(apprise_path, 'plugins')
52+
apprise_config_path = os.path.join(apprise_path, 'config')
53+
54+
if os.path.exists(apprise_attachment_path):
55+
datas.append((apprise_attachment_path, 'apprise/attachment'))
56+
if os.path.exists(apprise_plugins_path):
57+
datas.append((apprise_plugins_path, 'apprise/plugins'))
58+
if os.path.exists(apprise_config_path):
59+
datas.append((apprise_config_path, 'apprise/config'))
60+
61+
print(f"Added apprise data directories from: {apprise_path}")
62+
except ImportError:
63+
print("Warning: apprise not found, skipping apprise data files")
64+
4465
# Add tools directory if it exists
4566
if os.path.exists(str(project_dir / 'tools')):
4667
datas.append((str(project_dir / 'tools'), 'tools'))

0 commit comments

Comments
 (0)