Skip to content

Add manually-triggered release workflow (version bump + PyPI publish) - #19

Merged
jakehadar merged 1 commit into
masterfrom
18-release-workflow
Jul 31, 2026
Merged

Add manually-triggered release workflow (version bump + PyPI publish)#19
jakehadar merged 1 commit into
masterfrom
18-release-workflow

Conversation

@jakehadar

Copy link
Copy Markdown
Owner

Summary

  • New .github/workflows/release.yml, triggered manually via workflow_dispatch with a bump_type input (patch/minor/major, default patch)
  • Runs pytest as a gate before doing anything irreversible
  • bumpversion <bump_type> bumps .bumpversion.cfg, commits ("Bump version: X -> Y"), and tags — pushed back to master
  • Builds sdist + wheel via python -m build, publishes to PyPI via Trusted Publishing (OIDC — no API token stored as a secret)
  • Creates a GitHub Release for the new tag with the built artifacts attached
  • Removes the old local python setup.py upload command (UploadCommand in setup.py) and its now-unused imports/helper, since this workflow fully replaces it

Before merging / first run

  • PyPI-side setup required: on the gbfs-client PyPI project page, under Publishing → Trusted Publishers, add a trusted publisher pointing at this repo (jakehadar/bikeshare-client-python) and workflow filename (release.yml). Without this, the publish step will fail authentication.
  • Repo Actions permissions: confirm Settings → Actions → General → Workflow permissions is set to "Read and write permissions" (needed for the workflow to push the version bump commit/tag back to master).
  • I added environment: release to the job — optional, but lets you add required reviewers on that environment (Settings → Environments) as an extra manual approval gate before a publish actually runs, since this is the one workflow in the repo that does something irreversible.

Test plan

  • Verified setup.py still installs, tests pass, and both sdist/wheel build cleanly after removing UploadCommand (fresh venv, Python 3.13)
  • Verified bumpversion patch behaves as expected (0.1.8 -> 0.1.9, correct commit message and tag) in an isolated throwaway clone — didn't touch this repo's real tags
  • Workflow YAML parses correctly
  • End-to-end dispatch run (can't trigger this from here — needs the PyPI trusted publisher configured first, then a manual run from the Actions tab)

Refs #18

🤖 Generated with Claude Code

New workflow_dispatch workflow (bump_type: patch/minor/major) runs the
test suite as a gate, bumps the version via bumpversion, pushes the
resulting commit and tag, builds sdist+wheel, publishes to PyPI via
Trusted Publishing (OIDC, no stored API token), and creates a GitHub
Release for the new tag.

This fully replaces the local `python setup.py upload` path (twine +
manual bumpversion + manual git push), which is removed from setup.py
along with its now-unused imports and the read_current_version() helper
that only it called.

Refs #18

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@jakehadar
jakehadar merged commit a4c14e1 into master Jul 31, 2026
6 checks passed
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.

1 participant