forked from agermanidis/autosub
-
-
Notifications
You must be signed in to change notification settings - Fork 601
112 lines (96 loc) · 3.18 KB
/
linux-pyinstaller.yml
File metadata and controls
112 lines (96 loc) · 3.18 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
name: Linux PyInstaller
on:
push:
branches:
- master
- develop
pull_request:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all tags
- name: Get latest Git tag
id: get_version
run: |
VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.1.0")
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Resolved version: $VERSION"
- name: Install missing system libraries (XCB, TBB, etc.)
run: |
sudo apt-get update
sudo apt-get install -y \
libxcb1 \
libxcb-keysyms1 \
libxcb-shape0 \
libxcb-xkb1 \
libxcb-render-util0 \
libxcb-image0 \
libxcb-xinerama0 \
libxkbcommon-x11-0 \
libxcb-icccm4 \
libtbb12 \
libsox-dev
- name: Install FFmpeg
run: sudo apt update && sudo apt install -y ffmpeg
- name: Verify FFmpeg installation
run: |
which ffmpeg
ffmpeg -version
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Set up Python virtual environment
run: |
python -m venv .venv
- name: Activate virtual environment and install dependencies
run: |
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
- name: Verify existence of Whisper assets directory
run: |
source .venv/bin/activate # Activate the virtual environment
ASSETS_PATH=$(python -c "import whisper; import os; print(os.path.join(os.path.dirname(whisper.__file__), 'assets'))")
if [ -d "$ASSETS_PATH" ]; then
echo "The 'assets' directory exists at: $ASSETS_PATH"
echo "ASSETS_PATH=$ASSETS_PATH" >> $GITHUB_ENV
else
echo "The 'assets' directory does NOT exist."
exit 1
fi
- name: Compile with pyInstaller
run: |
source .venv/bin/activate
FFMPPEG_PATH=$(which ffmpeg)
pyinstaller main.py \
--path="$(pwd)" \
--onefile \
--add-binary="$FFMPPEG_PATH:." \
--add-binary="pytranscriber.sqlite:." \
--add-data="pytranscriber/gui/*.qm:pytranscriber/gui/" \
--add-data="$ASSETS_PATH:whisper/assets"
- name: Rename and zip the binary with version number
run: |
cd dist
mv main "pyTranscriber-${VERSION}"
- name: Upload built executable
uses: actions/upload-artifact@v4
with:
name: pyTranscriber-linux-pyinstaller-${{ env.VERSION }}
path: ./dist/pyTranscriber-${{ env.VERSION }}
download:
runs-on: ubuntu-22.04
needs: build
steps:
- name: Download built executable
uses: actions/download-artifact@v4
with:
path: ./output
- name: List downloaded files
run: ls -la ./output