Skip to content

Build PLP (ELF + AppImage + macOS) #17

Build PLP (ELF + AppImage + macOS)

Build PLP (ELF + AppImage + macOS) #17

Workflow file for this run

name: Build PLP (ELF + AppImage + macOS)
on:
push:
tags: ["v*"]
workflow_dispatch:
jobs:
# =========================
# 🐧 Linux ELF
# =========================
linux-elf:
name: Linux ELF
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install system deps
run: |
sudo apt update
sudo apt install -y \
ffmpeg \
libgl1 \
libxcb-xinerama0 \
libxkbcommon-x11-0
- name: Install Python deps
run: |
pip install pyinstaller PyQt6
- name: Build ELF binary
run: |
pyinstaller \
--onefile \
--clean \
--name plp \
--icon plp_logo.ico \
--add-data "fonts:fonts" \
--add-data "icons:icons" \
--add-data "plp_logo.png:." \
--add-data "plp_logo.ico:." \
plp2.1.1.py
- uses: actions/upload-artifact@v4
with:
name: plp-linux-elf
path: dist/plp
# =========================
# 🐧 Linux AppImage
# =========================
linux-appimage:
name: Linux AppImage
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install deps
run: |
sudo apt update
sudo apt install -y ffmpeg wget fuse
pip install pyinstaller PyQt6
- name: Build app dir (onedir)
run: |
pyinstaller \
--clean \
--name plp \
--icon plp_logo.ico \
--add-data "fonts:fonts" \
--add-data "icons:icons" \
--add-data "plp_logo.png:." \
--add-data "plp_logo.ico:." \
plp2.1.1.py
- name: Prepare AppDir
run: |
mkdir -p AppDir/usr/bin
mkdir -p AppDir/usr/share/applications
mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps
cp dist/plp/plp AppDir/usr/bin/plp
cp plp_logo.png AppDir/usr/share/icons/hicolor/256x256/apps/plp.png
cat > AppDir/usr/share/applications/plp.desktop << 'EOF'
[Desktop Entry]
Type=Application
Name=Pars Local Player
Exec=plp
Icon=plp
Categories=AudioVideo;Player;
Terminal=false
EOF
- name: Build AppImage
run: |
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-x86_64.AppImage
./linuxdeploy-x86_64.AppImage \
--appdir AppDir \
--desktop-file AppDir/usr/share/applications/plp.desktop \
--icon-file AppDir/usr/share/icons/hicolor/256x256/apps/plp.png \
--output appimage
- uses: actions/upload-artifact@v4
with:
name: PLP-x86_64.AppImage
path: "*.AppImage"
# =========================
# 🍎 macOS .app
# =========================
macos-app:
name: macOS .app
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install deps
run: |
pip install pyinstaller PyQt6 Pillow
- name: Build .app
run: |
pyinstaller \
--windowed \
--name PLP \
--icon plp_logo.ico \
--add-data "fonts:fonts" \
--add-data "icons:icons" \
--add-data "plp_logo.png:." \
--add-data "plp_logo.ico:." \
plp2.1.1.py
- uses: actions/upload-artifact@v4
with:
name: PLP-macOS.app
path: dist/PLP.app