Skip to content

Update linux-build.yml #7

Update linux-build.yml

Update linux-build.yml #7

Workflow file for this run

name: Linux Build Test
on:
push:
branches:
- appimage-test
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
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: List Dist Directory
run: |
ls -l dist/ # Check if main executable is here
- name: Install FUSE and AppImage tools
run: |
sudo apt-get update
sudo apt-get install -y libfuse2 wget appstream # Install appstreamcli if desired.
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
- name: Create AppDir
run: |
mkdir -p MyApp.AppDir/usr/bin
cp dist/main MyApp.AppDir/usr/bin/
# Create AppRun script
cat > MyApp.AppDir/AppRun << EOL
#!/bin/bash
HERE="\$(dirname "\$(readlink -f "\${0}")")"
export PATH="\${HERE}/usr/bin:\${PATH}"
exec "\${HERE}/usr/bin/main" "\$@"
EOL
chmod +x MyApp.AppDir/AppRun
# Create .desktop file without an icon reference.
echo "[Desktop Entry]
Name=MyApp
Exec=main
Type=Application
Categories=Utility;" > MyApp.AppDir/myapp.desktop
# No need to copy an icon since we're skipping it.
- name: Verify AppDir Contents
run: |
ls -l MyApp.AppDir/ # List contents of AppDir to verify files exist.
- name: Build AppImage
run: |
./appimagetool-x86_64.AppImage MyApp.AppDir MyApp-x86_64.AppImage
- name: Upload AppImage
uses: actions/upload-artifact@v3
with:
name: MyApp-x86_64.AppImage
path: MyApp-x86_64.AppImage