1+ name : Build and Release Linux App
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*'
7+
8+ permissions :
9+ contents : write
10+
11+ jobs :
12+ build-linux :
13+ runs-on : ubuntu-22.04
14+
15+ steps :
16+ - name : Checkout repository
17+ uses : actions/checkout@v3
18+
19+ - name : Set up Python
20+ uses : actions/setup-python@v4
21+ with :
22+ python-version : ' 3.11'
23+
24+ - name : Install system dependencies
25+ run : |
26+ sudo apt-get update
27+ sudo apt-get install -y \
28+ libxcb-keysyms1 \
29+ libxcb-render-util0 \
30+ libxkbcommon-x11-0 \
31+ libxcb-xinerama0 \
32+ libxcb-image0 \
33+ libxcb-xkb1 \
34+ libxcb-shape0 \
35+ libxcb-icccm4 \
36+ appstream \
37+ libfuse2
38+
39+ - name : Install Python dependencies
40+ run : |
41+ pip install -r requirements.txt
42+ pip install pyinstaller
43+
44+ - name : Build Linux App
45+ run : |
46+ pyinstaller --noconfirm --onefile --windowed --name YoutubeGo \
47+ --add-data "assets:assets" \
48+ --add-data "ui/themes:ui/themes" \
49+ main.py
50+
51+ mkdir -p AppDir/usr/bin
52+ mkdir -p AppDir/usr/share/applications
53+ mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps
54+
55+ cp dist/YoutubeGo AppDir/usr/bin/YoutubeGo
56+ cp assets/app.png AppDir/usr/share/icons/hicolor/256x256/apps/YoutubeGo.png
57+ cp assets/app.png AppDir/YoutubeGo.png
58+
59+ echo "[Desktop Entry]" > AppDir/YoutubeGo.desktop
60+ echo "Name=YoutubeGo" >> AppDir/YoutubeGo.desktop
61+ echo "Exec=YoutubeGo" >> AppDir/YoutubeGo.desktop
62+ echo "Icon=YoutubeGo" >> AppDir/YoutubeGo.desktop
63+ echo "Type=Application" >> AppDir/YoutubeGo.desktop
64+ echo "Categories=AudioVideo;Video;" >> AppDir/YoutubeGo.desktop
65+ echo "Comment=YouTube video downloader" >> AppDir/YoutubeGo.desktop
66+
67+ echo '#!/bin/sh' > AppDir/AppRun
68+ echo 'exec "$APPDIR/usr/bin/YoutubeGo" "$@"' >> AppDir/AppRun
69+ chmod +x AppDir/AppRun
70+
71+ - name : Create AppImage
72+ run : |
73+ curl -L https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -o appimagetool
74+ chmod +x appimagetool
75+ ./appimagetool AppDir
76+ mkdir -p dist
77+ mv YoutubeGo-x86_64.AppImage dist/
78+
79+ - name : Upload to GitHub Releases
80+ uses : softprops/action-gh-release@v1
81+ with :
82+ files : ' dist/YoutubeGo-x86_64.AppImage'
83+ env :
84+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments