stages: - test - lint - build - release default: tags: - windows before_script: - py -3.12 -m pip install --disable-pip-version-check -r requirements.txt test: stage: test script: - py -3.12 -m pytest lint: stage: lint script: - py -3.12 -m ruff check . build: stage: build needs: ["test", "lint"] script: - py -3.12 -m PyInstaller --clean --noconfirm packaging/pyinstaller.spec - powershell -NoProfile -Command "$hash=(Get-FileHash dist/LogitechBatteryWidget.exe -Algorithm SHA256).Hash.ToLower(); \"$hash LogitechBatteryWidget.exe\" | Set-Content -Encoding ascii dist/LogitechBatteryWidget.exe.sha256" artifacts: name: "LogitechBatteryWidget-$CI_COMMIT_SHORT_SHA" paths: - dist/LogitechBatteryWidget.exe - dist/LogitechBatteryWidget.exe.sha256 expire_in: 30 days release: stage: release needs: - job: build artifacts: true script: - powershell -NoProfile -Command "Get-Content dist/LogitechBatteryWidget.exe.sha256" artifacts: paths: - dist/LogitechBatteryWidget.exe - dist/LogitechBatteryWidget.exe.sha256 rules: - if: '$CI_COMMIT_TAG'