Add ffmpeg to ci.yml (#84)

This commit is contained in:
Chidi Williams 2022-10-16 09:46:25 +01:00 committed by GitHub
commit 042cf55a0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View file

@ -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

View file

@ -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