docs: check off remaining acceptance criteria — specification complete #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build executables | |
| # Builds both executables (windowed signApp + console signApp-cli) on | |
| # Windows AND Linux using the shared signApp.spec, then publishes the | |
| # downloadable artifacts. Triggered on push/tag/manual. | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ["v*"] | |
| pull_request: | |
| workflow_dispatch: | |
| env: | |
| # 3.14 works too (win_amd64 wheels exist for the whole compiled base), | |
| # but 3.13 is the most battle-tested for PyInstaller + tkinter. | |
| PYTHON_VERSION: "3.13" | |
| jobs: | |
| build: | |
| name: Build (${{ matrix.os }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ env.PYTHON_VERSION }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| cache: pip | |
| # poppler-utils: only to enable a future smoke-test of the GUI preview; | |
| # not bundled into the binary (runtime dependency on the user's side). | |
| - name: Linux system deps | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y poppler-utils | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt -r requirements-build.txt | |
| - name: Build with PyInstaller | |
| run: pyinstaller --noconfirm --clean signApp.spec | |
| # Smoke-test WITHOUT a card: we generate the fixtures with the project's | |
| # generators (make_pdf writes a valid raw PDF; make_png a PNG), then we | |
| # exercise the CLI binary's image mode end to end. We do NOT use Pillow's | |
| # Image.save(".pdf"): its PDF writer requires the JPEG encoder, which is | |
| # absent from some Pillow wheels (KeyError: 'JPEG'). eID mode requires | |
| # hardware -> not tested here. | |
| - name: Smoke test (CLI image mode, no eID hardware) | |
| shell: bash | |
| run: | | |
| python - <<'PY' | |
| from test_sign_pdfs_beid import make_pdf, make_png | |
| make_pdf("smoke.pdf", [(595, 842)]) | |
| make_png("sig.png") | |
| print("fixtures written") | |
| PY | |
| CLI=$(ls dist/signApp-cli* | head -1) | |
| echo "CLI binary: $CLI" | |
| "$CLI" --help >/dev/null | |
| "$CLI" --mode image --image-path sig.png --input smoke.pdf \ | |
| --output smoke_out --page 1 --x 100 --y 100 | |
| test -n "$(ls smoke_out/*.pdf 2>/dev/null)" || { echo "FAIL: no output PDF"; exit 1; } | |
| echo "OK: image mode works in the frozen binary." | |
| - name: Verify both binaries exist | |
| shell: bash | |
| run: | | |
| ls -la dist/ | |
| # the windowed binary + the console binary must both be present | |
| test -n "$(ls dist/signApp dist/signApp.exe 2>/dev/null)" || { echo "FAIL: signApp missing"; exit 1; } | |
| test -n "$(ls dist/signApp-cli dist/signApp-cli.exe 2>/dev/null)" || { echo "FAIL: signApp-cli missing"; exit 1; } | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| # unique name per OS: upload-artifact@v4 rejects duplicate names. | |
| name: signApp-${{ matrix.os }} | |
| path: | | |
| dist/signApp | |
| dist/signApp.exe | |
| dist/signApp-cli | |
| dist/signApp-cli.exe | |
| if-no-files-found: error | |
| retention-days: 30 |