Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue182 Adding .exe Files. #183

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
51feac6
testing build
Nov 11, 2024
ae56864
testing
Nov 11, 2024
e9e9774
testingg
Nov 11, 2024
358286d
test
Nov 11, 2024
0d84dce
teswt 2
Nov 11, 2024
d9d5762
test again
Nov 11, 2024
c842b35
test againn
Nov 11, 2024
978b0fb
adding branch
Nov 11, 2024
c79f6bf
test 2
Nov 11, 2024
69e4cb9
test 3
Nov 11, 2024
87dc9b1
.
Nov 11, 2024
9fdc267
testing buildss
Nov 11, 2024
d854a8a
testing
Nov 11, 2024
d43cf07
branch
Nov 11, 2024
d4fe482
trying to test
Nov 11, 2024
1e3810a
test
Nov 11, 2024
5a10fef
testing
Nov 11, 2024
8a6cd99
testing
Nov 11, 2024
88e36d5
push
Nov 11, 2024
ef0a7d3
release
Nov 11, 2024
f414591
release changes 1
Nov 11, 2024
68e37ba
testing again
Nov 11, 2024
def00c0
release changfe
Nov 11, 2024
86e9709
testing again
Nov 11, 2024
0e12452
macos change
Nov 11, 2024
7cb5dc2
testt
Nov 11, 2024
0abb2b5
trying to figure out issues
Nov 11, 2024
b348fad
making changes
Nov 12, 2024
6b940d1
changing release file back
Nov 12, 2024
d02583e
ensuring java is installed
Nov 12, 2024
3ef3b34
ensuring java and ctkframe
Nov 12, 2024
ff2b390
adding submodules update
Nov 12, 2024
a975fcb
adjusting name underneath upload of exe
Nov 12, 2024
4d921ae
added some changes
Nov 14, 2024
f2c8cee
trying bash
Nov 14, 2024
34f3b74
adding bash + java + nltk, etc installtions
Nov 14, 2024
a838ec5
fixing path
Nov 14, 2024
6af029c
fixing path again.
Nov 14, 2024
6e45d28
removing debug
Nov 14, 2024
512ede2
adding pyinstaller
Nov 14, 2024
e41b945
Adding changes
Nov 18, 2024
85d7f41
Adding tokenizers to build-saltify.sh
Nov 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/build-saltify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/bash

# Ensure the script runs only on macOS
OS=$(uname -s)
if [[ "$OS" != "Darwin" ]]; then
echo "This script is designed to run only on macOS."
exit 1
fi

# Step 1: Create a virtual environment
echo "Setting up Python virtual environment..."
python3 -m venv venv
source venv/bin/activate

# Step 2: Upgrade pip and install dependencies
echo "Installing Python dependencies..."
pip install --upgrade pip
pip install -r requirements.txt pyinstaller customtkinter

# Ensure 'typing' is not installed
if pip show typing &> /dev/null; then
echo "Removing obsolete 'typing' package..."
pip uninstall -y typing
fi

# Step 3: Download NLTK corpora
echo "Downloading NLTK corpora..."
python -m nltk.downloader all

# Step 4: Ensure Java is installed and accessible
if command -v java &> /dev/null; then
echo "Java is installed:"
java -version
else
echo "Java is not installed. Please install it and try again."
deactivate
exit 1
fi

# Step 5: Build the executable with PyInstaller
echo "Building the Saltify macOS executable..."
pyinstaller --name Saltify --windowed --noconfirm --onefile \
--copy-metadata torch \
--copy-metadata tqdm \
--copy-metadata regex \
--copy-metadata sacremoses \
--copy-metadata tokenizers \
--copy-metadata requests \
--copy-metadata packaging \
--copy-metadata filelock \
--copy-metadata numpy \
--copy-metadata tokenizers \
--copy-metadata customtkinter \
--copy-metadata importlib_metadata \
--collect-data sv_ttk \
--collect-data customtkinter \
--recursive-copy-metadata "openai-whisper" \
--collect-data whisper \
GUI.py

# Step 6: Zip the output
echo "Zipping the macOS output..."
zip -r dist/Saltify.zip dist/Saltify

# Step 7: Clean up and deactivate the virtual environment
echo "Deactivating virtual environment..."
deactivate

echo "Build completed. Check the dist/ directory for the macOS executable."
71 changes: 42 additions & 29 deletions .github/workflows/macos-build.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,54 @@
on:
name: Build macOS Executable

on:
push:
branches:
- main
- fix-mac-exe
- testingv4artifact
- issue169_dependency
- issue178_build-test-failures
- issue182_releaseprocess

jobs:
build-macos:
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install Java
# Step 1: Checkout the code
- name: Checkout code
uses: actions/checkout@v4

# Step 2: Set up Homebrew
- name: Set up Homebrew
run: |
if ! java -version; then
brew install openjdk@11
fi
- name: Install Specific Python Version
uses: actions/setup-python@v4
with:
python-version: 3.11.7
- name: Install NLTK
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
brew update

# Step 3: Install required tools
- name: Install Required System Tools
run: |
pip install nltk
python -m nltk.downloader all
- run: brew install mysql pkg-config portaudio
- run: pip install -r requirements.txt pyinstaller importlib-metadata sacremoses tokenizers
- run: pip uninstall -y typing
- 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 GUI.py
- uses: actions/upload-artifact@v4
if: always()
brew install pkg-config mysql-client java
export PATH="/usr/local/opt/mysql-client/bin:$PATH"
export PKG_CONFIG_PATH="/usr/local/opt/mysql-client/lib/pkgconfig"
export MYSQLCLIENT_CFLAGS="-I/usr/local/opt/mysql-client/include"
export MYSQLCLIENT_LDFLAGS="-L/usr/local/opt/mysql-client/lib"

# Step 4: Configure Java environment
- name: Configure Java Environment
run: |
export JAVA_HOME=$(/usr/libexec/java_home)
export PATH="$JAVA_HOME/bin:$PATH"
java -version

# Step 5: Make the build script executable
- name: Make build script executable
run: chmod +x .github/workflows/build-saltify.sh

# Step 6: Run the Saltify build script
- name: Run Saltify Build Script
run: ./.github/workflows/build-saltify.sh

# Step 7: Upload the built artifact
- name: Upload macOS Build Artifact
uses: actions/upload-artifact@v4
with:
name: SpeechTranscription_macos
path: dist/Saltify
name: Saltify_macOS
path: dist/Saltify.zip
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Release
on:
push:
branches:
- issue178_build-test-failures
- main
- issue182_releaseprocess
permissions:
contents: write
packages: read
Expand Down
Loading