diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml new file mode 100644 index 0000000..1dfba5a --- /dev/null +++ b/.github/workflows/linux-build.yml @@ -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