-
Notifications
You must be signed in to change notification settings - Fork 4
108 lines (106 loc) · 4.05 KB
/
macos-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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