-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (98 loc) · 4.2 KB
/
build.yml
File metadata and controls
114 lines (98 loc) · 4.2 KB
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
109
110
111
112
113
114
name: Build Distributables
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
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.12' # Specify your Python version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller openai-whisper==20240930 sounddevice scipy python-docx fpdf beautifulsoup4 pywebview
- name: Build for macOS
if: matrix.os == 'macos-latest'
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
- name: Build for Linux
if: matrix.os == 'ubuntu-latest'
run: |
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
- name: Build for Windows
if: matrix.os == 'windows-latest'
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
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Scriptify-${{ matrix.os }}
path: dist/Scriptify*
release:
needs: build
runs-on: ubuntu-latest
steps:
# Download all the artifacts from the build job.
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: .
# Create a release using the commit SHA as the version.
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
tag_name: "v${{ github.sha }}"
release_name: "Release v${{ github.sha }}"
draft: false
prerelease: false
# Upload the Linux asset. Adjust the path if your file name differs.
- name: Upload Linux asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Scriptify-ubuntu-latest/Scriptify
asset_name: Scriptify-linux
asset_content_type: application/octet-stream
# Upload the macOS asset.
- name: Upload macOS asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Scriptify-macos-latest/Scriptify
asset_name: Scriptify-macos
asset_content_type: application/octet-stream
# Upload the Windows asset.
- name: Upload Windows asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Scriptify-windows-latest/Scriptify.exe
asset_name: Scriptify-windows.exe
asset_content_type: application/octet-stream