Update GitHub Actions workflow to resolve FUSE issues #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Install FUSE and AppImage tools | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libfuse2 wget | |
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/ | |
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-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 |