Skip to content

Updated build.yml

Updated build.yml #24

Workflow file for this run

name: Build Distributables
on:
push:
tags:
- '*'
# Required for creating GitHub Releases.
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
pip install pyinstaller openai-whisper==20250625 sounddevice scipy python-docx fpdf beautifulsoup4 pywebview
# ---------------------------------------------------------
# macOS
# ---------------------------------------------------------
- name: Build for macOS
if: matrix.os == 'macos-latest'
shell: bash
run: |
pip install pillow
pyinstaller \
--onefile \
--name Scriptify \
--icon web/favicon.ico \
--add-data "ffmpeg/ffmpeg_mac.zip:ffmpeg" \
--hidden-import="whisper" \
--add-data "whisper:whisper" \
--add-data "web:web" \
--add-data "js:js" \
--add-data "index.html:." \
--add-data "launch.html:." \
--add-data "style.css:." \
--osx-bundle-identifier com.infinitode.scriptify \
--windowed \
main.py \
--version-file version_info.txt
# ---------------------------------------------------------
# Linux
# ---------------------------------------------------------
- name: Build for Linux
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y upx
pyinstaller \
--onefile \
--clean \
--strip \
--name Scriptify \
--icon web/favicon.ico \
--add-data "ffmpeg/ffmpeg_ubuntu.zip:ffmpeg" \
--hidden-import="whisper" \
--add-data "whisper:whisper" \
--exclude-module tkinter \
--exclude-module PyQt5 \
--add-data "web:web" \
--add-data "js:js" \
--add-data "index.html:." \
--add-data "launch.html:." \
--add-data "style.css:." \
--windowed \
main.py \
--version-file version_info.txt \
--upx-dir /usr/bin
strip dist/Scriptify
# ---------------------------------------------------------
# Windows
# ---------------------------------------------------------
- name: Build for Windows
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
pyinstaller `
--onefile `
--name Scriptify `
--icon web/favicon.ico `
--add-data "ffmpeg/ffmpeg_windows.zip;ffmpeg" `
--hidden-import="whisper" `
--add-data "whisper;whisper" `
--add-data "web;web" `
--add-data "js;js" `
--add-data "index.html;." `
--add-data "launch.html;." `
--add-data "style.css;." `
--windowed `
main.py `
--version-file version_info.txt
# ---------------------------------------------------------
# Upload build artifact
# ---------------------------------------------------------
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Scriptify-${{ matrix.os }}
path: |
dist/Scriptify
dist/Scriptify.exe
if-no-files-found: error
# =============================================================
# Release
# =============================================================
release:
name: Create GitHub Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download Linux artifact
uses: actions/download-artifact@v4
with:
name: Scriptify-ubuntu-latest
path: release/linux
- name: Download macOS artifact
uses: actions/download-artifact@v4
with:
name: Scriptify-macos-latest
path: release/macos
- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: Scriptify-windows-latest
path: release/windows
- name: Prepare release files
shell: bash
run: |
mkdir -p release/final
mv release/linux/Scriptify \
"release/final/Scriptify-linux"
mv release/macos/Scriptify \
"release/final/Scriptify-macos"
mv release/windows/Scriptify.exe \
"release/final/Scriptify-windows.exe"
chmod +x "release/final/Scriptify-linux"
chmod +x "release/final/Scriptify-macos"
ls -lah release/final
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${{ github.ref_name }}" \
release/final/Scriptify-linux \
release/final/Scriptify-macos \
release/final/Scriptify-windows.exe \
--title "Scriptify ${{ github.ref_name }}" \
--generate-notes