mirror of
https://github.com/plexguide/Huntarr-Sonarr.git
synced 2025-12-16 20:04:16 -06:00
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.
This commit is contained in:
22
.github/workflows/macos-installer-arm.yml
vendored
22
.github/workflows/macos-installer-arm.yml
vendored
@@ -342,6 +342,26 @@ jobs:
|
||||
'qrcode.image.pil',
|
||||
'routes',
|
||||
'main',
|
||||
# Apprise notification support
|
||||
'apprise',
|
||||
'apprise.common',
|
||||
'apprise.conversion',
|
||||
'apprise.decorators',
|
||||
'apprise.locale',
|
||||
'apprise.logger',
|
||||
'apprise.manager',
|
||||
'apprise.utils',
|
||||
'apprise.URLBase',
|
||||
'apprise.AppriseAsset',
|
||||
'apprise.AppriseAttachment',
|
||||
'apprise.AppriseConfig',
|
||||
'apprise.cli',
|
||||
'apprise.config',
|
||||
'apprise.attachment',
|
||||
'apprise.plugins',
|
||||
'markdown',
|
||||
'yaml',
|
||||
'cryptography',
|
||||
],
|
||||
hookspath=['hooks'],
|
||||
hooksconfig={},
|
||||
@@ -406,7 +426,7 @@ jobs:
|
||||
EOF
|
||||
|
||||
- name: Build macOS app bundle
|
||||
run: python -m PyInstaller Huntarr.spec --clean
|
||||
run: python -m PyInstaller Huntarr.spec --clean --collect-all apprise
|
||||
|
||||
- name: Create PKG installer
|
||||
run: |
|
||||
|
||||
22
.github/workflows/macos-installer-intel.yml
vendored
22
.github/workflows/macos-installer-intel.yml
vendored
@@ -338,6 +338,26 @@ jobs:
|
||||
'qrcode.image.pil',
|
||||
'routes',
|
||||
'main',
|
||||
# Apprise notification support
|
||||
'apprise',
|
||||
'apprise.common',
|
||||
'apprise.conversion',
|
||||
'apprise.decorators',
|
||||
'apprise.locale',
|
||||
'apprise.logger',
|
||||
'apprise.manager',
|
||||
'apprise.utils',
|
||||
'apprise.URLBase',
|
||||
'apprise.AppriseAsset',
|
||||
'apprise.AppriseAttachment',
|
||||
'apprise.AppriseConfig',
|
||||
'apprise.cli',
|
||||
'apprise.config',
|
||||
'apprise.attachment',
|
||||
'apprise.plugins',
|
||||
'markdown',
|
||||
'yaml',
|
||||
'cryptography',
|
||||
],
|
||||
hookspath=['hooks'],
|
||||
hooksconfig={},
|
||||
@@ -402,7 +422,7 @@ jobs:
|
||||
EOF
|
||||
|
||||
- name: Build macOS app bundle
|
||||
run: python -m PyInstaller Huntarr.spec --clean
|
||||
run: python -m PyInstaller Huntarr.spec --clean --collect-all apprise
|
||||
|
||||
- name: Create PKG installer
|
||||
run: |
|
||||
|
||||
8
.github/workflows/windows-build-nsis.yml
vendored
8
.github/workflows/windows-build-nsis.yml
vendored
@@ -45,6 +45,10 @@ jobs:
|
||||
pip install -r requirements.txt
|
||||
pip install pyinstaller==5.13.0
|
||||
pip install pywin32
|
||||
# Explicitly install apprise and its dependencies for Windows build
|
||||
pip install apprise==1.6.0
|
||||
pip install markdown==3.4.3
|
||||
pip install pyyaml==6.0
|
||||
|
||||
- name: Create directories
|
||||
run: |
|
||||
@@ -60,7 +64,9 @@ jobs:
|
||||
# Use the dedicated build script from the distribution directory
|
||||
python -m pip install -r requirements.txt
|
||||
python -m pip install pywin32
|
||||
pyinstaller -y distribution/windows/huntarr.spec
|
||||
|
||||
# Build with apprise support - use --collect-all apprise to fix attachment directory error
|
||||
pyinstaller -y --collect-all apprise distribution/windows/huntarr.spec
|
||||
|
||||
# Display contents of dist/Huntarr
|
||||
dir dist/Huntarr
|
||||
|
||||
@@ -64,7 +64,8 @@ def build_exe():
|
||||
# Make sure we're in the project root directory when running PyInstaller
|
||||
# This helps with finding relative paths
|
||||
# Add the -y option to force overwrite of the output directory
|
||||
result = run_command([sys.executable, "-m", "PyInstaller", "-y", str(spec_file)], cwd=str(ROOT_DIR))
|
||||
# Add --collect-all apprise to bundle all apprise data files and dependencies
|
||||
result = run_command([sys.executable, "-m", "PyInstaller", "-y", "--collect-all", "apprise", str(spec_file)], cwd=str(ROOT_DIR))
|
||||
|
||||
if not result:
|
||||
print("ERROR: PyInstaller failed to build the executable")
|
||||
|
||||
@@ -41,6 +41,27 @@ datas = [
|
||||
(str(project_dir / 'src'), 'src'),
|
||||
]
|
||||
|
||||
# Add apprise data files to fix attachment directory error
|
||||
try:
|
||||
import apprise
|
||||
import os
|
||||
apprise_path = os.path.dirname(apprise.__file__)
|
||||
# Add apprise's attachment, plugins, and config directories
|
||||
apprise_attachment_path = os.path.join(apprise_path, 'attachment')
|
||||
apprise_plugins_path = os.path.join(apprise_path, 'plugins')
|
||||
apprise_config_path = os.path.join(apprise_path, 'config')
|
||||
|
||||
if os.path.exists(apprise_attachment_path):
|
||||
datas.append((apprise_attachment_path, 'apprise/attachment'))
|
||||
if os.path.exists(apprise_plugins_path):
|
||||
datas.append((apprise_plugins_path, 'apprise/plugins'))
|
||||
if os.path.exists(apprise_config_path):
|
||||
datas.append((apprise_config_path, 'apprise/config'))
|
||||
|
||||
print(f"Added apprise data directories from: {apprise_path}")
|
||||
except ImportError:
|
||||
print("Warning: apprise not found, skipping apprise data files")
|
||||
|
||||
# Add tools directory if it exists
|
||||
if os.path.exists(str(project_dir / 'tools')):
|
||||
datas.append((str(project_dir / 'tools'), 'tools'))
|
||||
|
||||
Reference in New Issue
Block a user