Skip to content

ci: add release workflow and document the release procedure#130

Merged
mertsatilmaz merged 1 commit into
mainfrom
ci/release-workflow
May 17, 2026
Merged

ci: add release workflow and document the release procedure#130
mertsatilmaz merged 1 commit into
mainfrom
ci/release-workflow

Conversation

@mertsatilmaz
Copy link
Copy Markdown
Collaborator

Summary

Adds `.github/workflows/release.yml` and `docs/releasing.md`. Pushing a tag matching `v..` (or `…rc`) runs four gated jobs in sequence:

  1. verify — pytest, ruff, mypy on the tagged commit
  2. build — `python -m build` produces sdist + wheel
  3. publish-pypi — uploads to PyPI via OIDC trusted publishing (no long-lived token)
  4. github-release — attaches sdist + wheel to the GitHub release with auto-generated notes

One-time setup you'll need to do before the first real tag

The workflow is dormant until two things are configured:

On PyPI (one-time, ~3 minutes):

  1. Go to https://pypi.org/manage/account/publishing/ → Add a pending publisher
  2. Fill in:
    • PyPI Project Name: `owasp-agent-security-regression-harness`
    • Owner: `OWASP`
    • Repository: `Agent-Security-Regression-Harness`
    • Workflow: `release.yml`
    • Environment: `pypi`

On GitHub (one-time, ~1 minute):

  1. Repo Settings → Environments → New environment named `pypi`
  2. Add yourself as a required reviewer so a tag can't silently publish

Both steps are in `docs/releasing.md` so future maintainers find them too.

Rehearsal before v0.1.0

Once those are configured, we can rehearse with a release candidate tag like `v0.1.0rc1` (the workflow accepts `rcN` suffixes). PyPI treats RC versions as pre-releases. If it works, we tag `v0.1.0` for the real release.

Test plan

  • `python -m pytest -q` — 315 passed (no code changes)
  • `ruff check src tests` — clean
  • `mypy` — clean
  • Workflow YAML reviewed for syntax
  • Trusted publishing configured on PyPI side (you)
  • `pypi` environment configured on GitHub side (you)
  • Rehearsal with `v0.1.0rc1` (after the version bump in release: bump version to 0.1.0 and update classifier to Alpha #116)

Closes #114

Add .github/workflows/release.yml. Pushing a tag matching
v<major>.<minor>.<patch> (or ...rc<N>) runs the workflow with four
gated jobs:

1. verify — pytest, ruff, mypy on the tagged commit
2. build — python -m build produces sdist + wheel
3. publish-pypi — uploads to PyPI via trusted publishing (OIDC, no
   long-lived token in the repo). Requires the `pypi` GitHub environment
   for approval gating.
4. github-release — attaches sdist + wheel to the GitHub release page
   with auto-generated release notes from PRs since the previous tag

Add docs/releasing.md for maintainers. It covers:

- One-time PyPI trusted-publishing setup (pending publisher registration
  on PyPI side + `pypi` environment on GitHub side with required reviewer)
- Per-release checklist (CHANGELOG cut-over, version bump in
  pyproject.toml + __init__.py + cli.py + README, release-prep PR, tag,
  verify on PyPI)
- Recovery procedures for failed publishes, including the PyPI
  "no re-upload of the same version" constraint

Link the procedure from CONTRIBUTING.md.

Closes #114
@mertsatilmaz mertsatilmaz merged commit f38d2aa into main May 17, 2026
3 checks passed
@mertsatilmaz mertsatilmaz deleted the ci/release-workflow branch May 17, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

release: add PyPI publish workflow on tag

1 participant