Skip to content

Add GitHub Actions workflows for CI and automated PyPI publishing#14

Open
jcpitre wants to merge 5 commits into
mainfrom
3-infrastructure-generic-gtfs-diff-engine-publish-package
Open

Add GitHub Actions workflows for CI and automated PyPI publishing#14
jcpitre wants to merge 5 commits into
mainfrom
3-infrastructure-generic-gtfs-diff-engine-publish-package

Conversation

@jcpitre
Copy link
Copy Markdown
Contributor

@jcpitre jcpitre commented Jun 4, 2026

Closes #3

What this adds

  • python-test.yml — runs the test suite on Python 3.10–3.13 on every release or manually.
  • python-release.yml — triggered when a GitHub Release is published. Runs the full test matrix first, then builds and publishes the package to PyPI using Trusted Publisher (OIDC) — no API token required.

How to cut a release

See the new Releasing a New Version section in README.md.

⚠️ Post-merge requirements

These workflows can only be fully tested after this PR is merged, because:

  1. GitHub requires workflow files to exist on the default branch before they can be triggered manually or via workflow_dispatch.
  2. PyPI's Trusted Publisher configuration must reference the exact workflow file on the default branch. A maintainer will need to register the Trusted Publisher on PyPI (instructions) pointing to MobilityData/gtfs-diff-engine, workflow python-release.yml, environment pypi.

Recommended follow-up (requires admin): Enable branch protection on main to require ci.yml status checks to pass before merging. This prevents a release from being cut from a broken main. Go to Settings → Branches → Add branch ruleset, and require the test, lint, and models-freshness jobs as required status checks.

@jcpitre jcpitre linked an issue Jun 4, 2026 that may be closed by this pull request
6 tasks
@@ -0,0 +1,29 @@
name: Python Tests
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is already covered by ci.yml

Copy link
Copy Markdown
Contributor Author

@jcpitre jcpitre Jun 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want tests to run before release? Or do we trust that ci.yml ran properly?
python-test.yml is essentially called from python-release.yml.
It could have been embedded in python-release.yml.

  • ci.yml is a smart gate — runs conditionally on path changes, designed for PR feedback speed
  • python-test.yml is a release safety net — runs unconditionally, designed for correctness at publish time

I suggest we keep both.

@jcpitre jcpitre requested a review from cka-y June 5, 2026 15:01
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.

Infrastructure: Generic GTFS Diff Engine publish package

2 participants