Skip to content

finding the path

finding the path #93

Workflow file for this run

on:
push:
branches:
- main
- fix-mac-exe
- testingv4artifact
- issue169_dependency
- issue178_build-test-failures
- 182_fixing_executable
jobs:
build-macos:
runs-on: macos-latest
steps:
# Step 1: Check out the repository
- uses: actions/checkout@v4
# Step 2: Set up Python
- uses: actions/setup-python@v4
with:
python-version: 3.11
# Step 3: Install Homebrew
- name: Install Homebrew
run: |
if ! command -v brew &> /dev/null; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# Step 4: Install MySQL and other Homebrew packages
- name: Install MySQL and required packages
run: |
brew install mysql pkg-config portaudio
brew services start mysql
pip install pyaudio
# Set MySQL environment variables
- name: Set MySQL environment variables
run: |
export MYSQLCLIENT_CFLAGS='pkg-config mysqlclient --cflags'
export MYSQLCLIENT_LDFLAGS='pkg-config mysqlclient --libs'
# Step 5: Install Java (if required)
- name: Install Java
run: |
if ! java -version; then
brew install openjdk@11
fi
# Step 6: Install dependencies
- name: Install Python dependencies
run: |
pip install -r requirements.txt
pip install pyinstaller importlib-metadata sacremoses tokenizers
# Uninstall incompatible typing package
- run: pip uninstall -y typing
# - name: Install Specific Python Version
# uses: actions/setup-python@v4
# with:
# python-version: 3.11.7
# Step 7: Install and configure NLTK
- name: Install NLTK and fix SSL issues
run: |
pip install nltk certifi
CERT_PATH=$(python -m certifi)
export SSL_CERT_FILE=${CERT_PATH}
export REQUESTS_CA_BUNDLE=${CERT_PATH}
echo "Downloading NLTK resources..."
python -c "import nltk; nltk.download('punkt'); nltk.download('averaged_perceptron_tagger')"
#checking
- name: Display all environment variables
run: env
- name: Display specific variables
run: |
echo "PORTAUDIO_PATH: $PORTAUDIO_PATH"
echo "FFMPEG_PATH: $FFMPEG_PATH"
echo "FFPROBE_PATH: $FFPROBE_PATH"
#paths
- name: Resolve binary paths
id: resolve-paths
run: |
echo "PORTAUDIO_PATH=$(brew --prefix portaudio)/lib/libportaudio.dylib" >> $GITHUB_ENV
echo "FFMPEG_PATH=$(which ffmpeg)" >> $GITHUB_ENV
echo "FFPROBE_PATH=$(which ffprobe)" >> $GITHUB_ENV
# Step 8: Build the executable
- name: Build executable
run: |
pyinstaller --name Saltify --windowed --noconfirm --onefile -c \
--copy-metadata torch --copy-metadata tqdm --copy-metadata regex \
--copy-metadata sacremoses --copy-metadata requests --copy-metadata packaging \
--copy-metadata filelock --copy-metadata numpy --copy-metadata tokenizers \
--copy-metadata importlib_metadata --collect-data sv_ttk \
--recursive-copy-metadata "openai-whisper" --collect-data whisper \
--add-data "images:images" \
--add-data "build_assets/en-model.slp:pattern/text/en" \
--add-data "CTkXYFrame:CTkXYFrame" \
--add-binary "$PORTAUDIO_PATH:." \
--add-binary "$FFMPEG_PATH:." \
--add-binary "$FFPROBE_PATH:." \
GUI.py
# Step 9: Run the Saltify build script
- name: Run Saltify Build Script
#run: ./.github/workflows/build-saltify.sh
run: |
chmod +x .github/workflows/build-saltify.sh
./.github/workflows/build-saltify.sh
# Step 10: Upload the built artifact
- name: Upload macOS Build Artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: SpeechTranscription_macos
path: dist/Saltify