From f049f7d73f73d5d7674e02caefbe6f3028a2eb81 Mon Sep 17 00:00:00 2001 From: Blake Ridgway Date: Wed, 19 Mar 2025 07:42:17 -0500 Subject: [PATCH] init commit of build workflow --- .github/workflows/build.yml | 85 +++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..18dd7eb --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,85 @@ +name: Build AppImage and Windows .exe + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build-linux: + runs-on: ubuntu-latest + name: Build AppImage + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install PyInstaller + run: pip install pyinstaller + + - name: Build Linux executable with PyInstaller + run: | + pyinstaller --onefile --windowed time_logix.py + mkdir -p AppDir/usr/bin + cp dist/time_logix AppDir/usr/bin/time_logix + # Create AppRun File + echo '#!/bin/bash' > AppDir/AppRun + echo 'HERE="$(dirname "$(readlink -f "${0}")")"' >> AppDir/AppRun + echo 'exec "$HERE/usr/bin/time_logix" "$@"' >> AppDir/AppRun + chmod +x AppDir/AppRun + # Create desktop file + cat < AppDir/time_logix.desktop + [Desktop Entry] + Type=Application + Name=TimeLogix + Exec=time_logix + Icon=appicon + Comment=Time tracking app for contractors + Categories=Utility; + EOF + - name: Download appimagetool + run: | + wget -q https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage + chmod +x appimagetool-x86_64.AppImage + + - name: Build AppImage + run: | + ./appimagetool-x86_64.AppImage AppDir + + - name: Upload Linux Artifacts + uses: actions/upload-artifact@v3 + with: + name: TimeLogix-AppImage + path: TimeLogix*.AppImage + + build-windows: + runs-on: windows-latest + name: Build Windows Executable + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install PyInstaller + run: pip install pyinstaller + + - name: Build Windows executable with PyInstaller + run: pyinstaller --onefile --windowed time_logix.py + + - name: Upload Windows Artifact + uses: actions/upload-artifact@v3 + with: + name: TimeLogix-Windows + path: dist/time_logix.exe + \ No newline at end of file