time_logix/.github/workflows/build.yml
2025-03-19 09:06:47 -05:00

90 lines
No EOL
2.4 KiB
YAML

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: Create AppDir structure and files without icon
run: |
mkdir -p AppDir/usr/bin
pyinstaller --onefile --windowed time_tracker.py
cp dist/time_tracker AppDir/usr/bin/time_tracker
# Create AppRun file
cat <<'EOF' > AppDir/AppRun
#!/bin/bash
HERE="$(dirname "$(readlink -f "${0}")")"
exec "$HERE/usr/bin/time_tracker" "$@"
EOF
chmod +x AppDir/AppRun
# Create desktop file without an icon reference
cat <<EOF > AppDir/time_logix.desktop
[Desktop Entry]
Type=Application
Name=TimeLogix
Exec=time_tracker
Comment=Time tracking app for contractors
Categories=Utility;
EOF
- name: Install FUSE library
run: sudo apt-get update && sudo apt-get install -y libfuse2
- 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@v4
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@v4
with:
name: TimeLogix-Windows
path: dist/time_logix.exe