Skip to content

Commit

Permalink
Update Linux build woorkflow
Browse files Browse the repository at this point in the history
  • Loading branch information
faytor committed Oct 3, 2024
1 parent 1d7a6e6 commit e73074d
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Linux Build Test

on:
push:
branches:
- appimage-test

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install PyQt5 pyinstaller
- name: Build application
run: |
pyinstaller --onefile --windowed main.py
- name: Install AppImage tools
run: |
sudo apt-get update
sudo apt-get install -y wget
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
sudo mv appimagetool-x86_64.AppImage /usr/local/bin/appimagetool
- name: Create AppDir
run: |
mkdir -p MyApp.AppDir/usr/bin
cp dist/main MyApp.AppDir/usr/bin/
cat > MyApp.AppDir/AppRun << EOL
#!/bin/bash
HERE="$(dirname "$(readlink -f "${0}")")"
export PATH="${HERE}/usr/bin/:${PATH}"
export LD_LIBRARY_PATH="${HERE}/usr/lib/:${LD_LIBRARY_PATH}"
exec "${HERE}/usr/bin/main" "$@"
EOL
chmod +x MyApp.AppDir/AppRun
echo "[Desktop Entry]
Name=MyApp
Exec=main
Icon=myapp
Type=Application
Categories=Utility;" > MyApp.AppDir/myapp.desktop
touch MyApp.AppDir/myapp.png # Replace this with your actual icon
- name: Build AppImage
run: |
appimagetool MyApp.AppDir MyApp-x86_64.AppImage
- name: Upload AppImage
uses: actions/upload-artifact@v2
with:
name: MyApp-x86_64.AppImage
path: MyApp-x86_64.AppImage

0 comments on commit e73074d

Please sign in to comment.