diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42199e30..b85f54b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,12 +44,15 @@ jobs: - os: macos-latest CMD_BUILD: | brew install create-dmg + brew install ffmpeg poetry run make bundle_mac - os: ubuntu-latest CMD_BUILD: | + sudo apt update && sudo apt install ffmpeg poetry run make bundle_linux - os: windows-latest CMD_BUILD: | + choco install ffmpeg poetry run make bundle_windows steps: - uses: actions/checkout@v3 diff --git a/Buzz.spec b/Buzz.spec index b2224518..fbbbbde3 100644 --- a/Buzz.spec +++ b/Buzz.spec @@ -1,5 +1,8 @@ # -*- mode: python ; coding: utf-8 -*- import os +import platform +import subprocess +import sys from PyInstaller.utils.hooks import collect_data_files, copy_metadata @@ -16,6 +19,16 @@ datas += copy_metadata('tokenizers') datas += collect_data_files('whisper') +def get_ffmpeg(): + if platform.system() == 'Windows': + return 'C:\\ProgramData\\chocolatey\\lib\\ffmpeg\\tools\\ffmpeg\\bin' + return subprocess.check_output( + ['which', 'ffmpeg']).decode(sys.stdout.encoding).strip() + + +datas += [(get_ffmpeg(), '.')] + + block_cipher = None