fixing 2 #91
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release | |
on: | |
push: | |
branches: | |
- main | |
- exe_fix | |
permissions: | |
contents: write | |
jobs: | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
# Step 1: Check out the repository | |
- name: Check out the code | |
uses: actions/checkout@v4 | |
with: | |
submodules: true # Automatically initializes and updates submodules | |
# Step 2: Set up Python | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
# Step 3: Install dependencies | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install -r requirements.txt pyinstaller | |
# Step 4: Build executable with PyInstaller | |
- 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 customtkinter \ | |
--recursive-copy-metadata "openai-whisper" \ | |
GUI.py | |
# Step 5: Upload artifact | |
- name: Upload Windows executable | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Saltify_windows | |
path: dist/Saltify.exe | |
build-macos: | |
runs-on: macOS-latest | |
steps: | |
# Step 1: Check out the repository | |
- name: Check out the code | |
uses: actions/checkout@v4 | |
with: | |
submodules: true # Automatically initializes and updates submodules | |
# Step 2: Set up Python | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
# Step 3: Install dependencies | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install -r requirements.txt pyinstaller | |
# Step 4: Build executable with PyInstaller | |
- 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 customtkinter \ | |
--recursive-copy-metadata "openai-whisper" \ | |
GUI.py | |
# Step 5: Upload artifact | |
- name: Upload macOS executable | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Saltify_macos | |
path: dist/Saltify | |
release: | |
needs: [build-windows, build-macos] | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Check out the repository | |
- name: Check out the code | |
uses: actions/checkout@v4 | |
# Step 2: Create release notes | |
- name: Create release notes | |
run: | | |
echo "Release Notes" > release_notes.md | |
echo "Build Number: ${{ github.run_number }}" >> release_notes.md | |
echo "Commit: ${{ github.sha }}" >> release_notes.md | |
# Step 3: Download artifacts | |
- name: Download Windows artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: Saltify_windows | |
path: artifacts/windows | |
- name: Download macOS artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: Saltify_macos | |
path: artifacts/macos | |
# Step 4: Create ZIP files for releases | |
- name: Create ZIP files | |
run: | | |
zip -j artifacts/Saltify_windows.zip artifacts/windows/* | |
zip -j artifacts/Saltify_macos.zip artifacts/macos/* | |
# Step 5: Create GitHub Release | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ github.run_number }} | |
release_name: Release ${{ github.run_number }} | |
body_path: ./release_notes.md | |
draft: false | |
prerelease: false | |
# Step 6: Upload Release Assets | |
- name: Upload Windows executable | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: artifacts/Saltify_windows.zip | |
asset_name: Saltify_windows.zip | |
asset_content_type: application/zip | |
- name: Upload macOS executable | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: artifacts/Saltify_macos.zip | |
asset_name: Saltify_macos.zip | |
asset_content_type: application/zip |