feat: release pipeline + dynamic version from git tag #8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/release-pipeline"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Release pipeline + dynamic version from git tag
How it works
v0.2.0) and publish a release in Forgejorelease.ymlworkflow fires onrelease:publishedv0.2.0→0.2.0)__init__.pywith the tagged versionpython -m buildzai-tray-checker --version).whlfile to the releaseVersion handling
pyproject.tomlnow usesdynamic = ["version"]instead of a hardcoded stringzai_tray_checker.__init__.__version__via[tool.setuptools.dynamic]__init__.pybefore building so the wheel carries the tag version0.1.0in__init__.pyCLI
--versionRuns before
QApplicationinitializes, so it works headless. Also supports-V.To create a release
The pipeline will build the wheel and attach it automatically.
Tests: 69 total, all passing
3 new tests in
test_version.py:--versionflag prints correct version-Vshortcut works🤖 Hermes automated review: minor comments
Reviewed the full diff of
feature/release-pipeline(152aa84) againstmain(fa69758) — 6 files, +124/-1. The release pipeline + dynamic version design is sound: tag →sedpatch__init__.py→python -m build --wheel→ verify--version→ attach asset. The CLI--version/-Vhandling runs beforeQApplicationinitializes (correct, headless-safe).pyproject.tomldynamic-version wiring via[tool.setuptools.dynamic]is correct.Local checks:
pytest -q→ 69 passed in 0.74s (including the 3 newtest_version.pycases). No CI result was posted yet for this head SHA at review time (PR is minutes old), so tests were run locally per the CI-absent policy.Minor (non-blocking) findings
release.yml:30—sedwith unescaped$VERSIONin replacement.VERSION="${TAG#v}"is interpolated into asedregex/replacement. Since only[^/]+-style git tags are expected this is fine in practice, but a tag containing/,&, or shell metacharacters could break the substitution or corrupt__init__.py. Low risk (requires push/tag rights). Optional hardening: validateVERSIONagainst a semver regex (^[0-9]+\.[0-9]+\.[0-9]+) before thesed, or use a Python one-liner (python -c "...") to rewrite the line instead ofsed.release.yml:38—python -m build --wheel --no-isolation.--no-isolationrequiressetuptoolsandwheelto already be present in the venv.pip install builddoes pullsetuptoolsas a dependency, so this almost certainly works on a default runner image — but if the runner's base image ever ships a stripped-downpip, the build step would fail with an opaque error. Consider dropping--no-isolation(it adds a few seconds but is more robust), or explicitlypip install wheel setuptoolsin the setup step.main.py:773— substring-based flag check."-V" in sys.argvwould false-positive if-Vever appeared as a substring of another token. Harmless for this single-purpose CLI; flagging only for awareness if richer argument parsing is added later.No issues found
${GH_TOKEN}is used correctly in thecurlAuthorizationheader.Note: This is a PR conversation comment, not a formal Forgejo review approval — the current MCP integration cannot create review approval states or inline diff comments.
Automated daily review. I never merge PRs.