Skip to content

Add tag-triggered release pipeline (release.yml + publish.yml) - #248

Merged
chrishayuk merged 2 commits into
mainfrom
ci/release-pipeline
Jul 22, 2026
Merged

Add tag-triggered release pipeline (release.yml + publish.yml)#248
chrishayuk merged 2 commits into
mainfrom
ci/release-pipeline

Conversation

@chrishayuk

Copy link
Copy Markdown
Collaborator

Summary

Adds an automated release pipeline, modeled on the one in chuk-artifacts:

  • release.yml — triggered by pushing a v*.*.* tag (or manual workflow_dispatch with a tag input). Verifies the tag matches pyproject.toml's version, generates a changelog from git log since the previous tag, and creates a GitHub Release.
  • publish.yml — triggered when a release is published. Gates on the full test suite (ci.yml, now reusable via workflow_call), builds the package with uv build, and publishes to PyPI using trusted publishing (OIDC) — no stored API token.
  • ci.yml — added workflow_call: as a trigger so publish.yml can reuse the exact same test suite as a gate instead of duplicating test logic.

Required one-time setup

Trusted publishing needs to be configured on PyPI before the first tagged release: on the mcp-cli project's Publishing settings page, add IBM/mcp-cli as a trusted publisher for workflow publish.yml, environment pypi. Until that's done, build/test will still succeed but the final PyPI upload step will fail.

Release flow going forward

  1. Bump version in pyproject.toml, commit to main.
  2. git tag vX.Y.Z && git push origin vX.Y.Z
  3. release.yml creates the GitHub Release automatically.
  4. Publishing that release triggers publish.yml, which tests, builds, and publishes to PyPI.

Test plan

  • All three workflow YAML files parse cleanly
  • First real tag push (after PyPI trusted-publisher setup) to confirm end-to-end

Mirrors the pattern used in chuk-artifacts: pushing a v*.*.* tag runs
release.yml, which verifies the tag matches pyproject.toml's version,
generates a changelog from git log since the previous tag, and creates
a GitHub Release. Publishing that release triggers publish.yml, which
gates on the full ci.yml test suite (now reusable via workflow_call),
builds the package with `uv build`, and publishes to PyPI using
trusted publishing (OIDC) rather than a stored API token.

Trusted publishing requires a one-time setup step on pypi.org: under
the mcp-cli project's Publishing settings, add IBM/mcp-cli as a
trusted publisher for the publish.yml workflow, environment "pypi".
Until that's configured, the publish job will fail at the PyPI upload
step (the build and test stages will still succeed).

Signed-off-by: chris hay <chris.hay@uk.ibm.com>
@chrishayuk
chrishayuk merged commit 2e786ed into main Jul 22, 2026
19 checks passed
@chrishayuk
chrishayuk deleted the ci/release-pipeline branch July 22, 2026 09:10
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