Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install ruff
- run: ruff check .
- run: ruff format --check .

test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python: ["3.10", "3.12"]
runs-on: ${{ matrix.os }}
env:
QT_QPA_PLATFORM: offscreen
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: pip
- name: Qt runtime libraries
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libegl1 libxkbcommon0 libfontconfig1 libdbus-1-3
- run: python -m pip install --upgrade pip
- run: python -m pip install -e ".[dev]"
- run: python -m pytest
48 changes: 36 additions & 12 deletions .github/workflows/release-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ permissions:
jobs:
build:
runs-on: windows-latest
env:
QT_QPA_PLATFORM: offscreen

steps:
- name: Checkout
Expand All @@ -20,39 +22,61 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
cache: pip

- name: Install dependencies
shell: pwsh
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"

- name: Resolve version
id: version
shell: pwsh
run: |
$version = python -c "import apptrackr; print(apptrackr.__version__)"
if ("${{ github.ref_type }}" -eq "tag" -and "${{ github.ref_name }}" -ne "v$version") {
Write-Error "Tag ${{ github.ref_name }} does not match apptrackr.__version__ ($version)"
exit 1
}
"value=$version" >> $env:GITHUB_OUTPUT

- name: Test
run: python -m pytest

- name: Build PyInstaller app
run: pyinstaller --noconfirm packaging/apptrackr.spec

- name: Smoke test the bundle
shell: pwsh
run: |
pyinstaller packaging/apptrackr.spec
$p = Start-Process -FilePath "dist/AppTrackr/AppTrackr.exe" -ArgumentList "--self-test" -Wait -PassThru
if ($p.ExitCode -ne 0) { Write-Error "Bundle self-test failed ($($p.ExitCode))"; exit 1 }

- name: Zip portable build
shell: pwsh
run: |
Compress-Archive -Path "dist/AppTrackr/*" -DestinationPath "dist/AppTrackr_Portable.zip" -Force
run: Compress-Archive -Path "dist/AppTrackr/*" -DestinationPath "dist/AppTrackr_Portable.zip" -Force

- name: Install Inno Setup
shell: pwsh
run: |
choco install innosetup --no-progress -y
run: choco install innosetup --no-progress -y

- name: Build installer
shell: pwsh
run: |
& "C:/Program Files (x86)/Inno Setup 6/ISCC.exe" "packaging/installer.iss"
run: '& "C:/Program Files (x86)/Inno Setup 6/ISCC.exe" "/DAppVersion=${{ steps.version.outputs.value }}" "packaging/installer.iss"'

- name: Upload workflow artifacts
uses: actions/upload-artifact@v4
with:
name: AppTrackr-${{ steps.version.outputs.value }}
path: |
packaging/Output/AppTrackr_Setup.exe
dist/AppTrackr_Portable.zip

- name: Upload release artifacts
- name: Publish release
if: github.ref_type == 'tag'
uses: softprops/action-gh-release@v2
with:
files: |
packaging/Output/AppTrackr_Setup.exe
dist/AppTrackr_Portable.zip
README.md
generate_release_notes: true
26 changes: 11 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,35 +1,31 @@
# Python cache
# Python
__pycache__/
*.py[cod]
*.pyo
*.pyd
*.so

# Virtual envs
.venv/
venv/
.env/
.pytest_cache/
.ruff_cache/
.coverage
htmlcov/

# Build artifacts
# Build output
build/
dist/
*.egg-info/
packaging/Output/
*.spec
!packaging/apptrackr.spec

# Installer outputs
Output/
*.exe

# Logs and local DB
# Local data, logs and databases
*.log
*.sqlite
*.sqlite-wal
*.sqlite-shm
*.db

# IDE
# Editors and OS
.vscode/
.idea/

# OS
.DS_Store
Thumbs.db
Loading
Loading