Skip to content

ci: publish the image to its own package and the Python package to PyPI - #3

Merged
Alex (Alexkuva) merged 1 commit into
mainfrom
fix/ci-publish
Oct 22, 2026
Merged

Alex (Alexkuva) merged 1 commit into
mainfrom
fix/ci-publish

Conversation

@fuzcap

@fuzcap fuzcap commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Fixes the red CI on main and makes the repository able to publish publicly.

The failure

The build job pushed ghcr.io/kaitencloud/mcp:main and was refused: denied: permission_denied: read_package. That package already exists (private, last pushed 2026-09-21 as 26.09.8) and is linked to kaiten-internal, so this repo's GITHUB_TOKEN cannot write it; only the package's settings (UI) can grant that. The red PR run in the report is the same job on a re-run of merged PR #1, where the GitHub Actions cache token is read-only (failed to reserve cache).

The change

  • Image: ghcr.io/kaitencloud/kaiten-mcp, a new package created by this repo's first publish and linked to it. It takes the repository's visibility, so the repository must be public before the first publish to get a public package. The old mcp package and its private 26.09.x versions are left alone.
  • Cache: a buildcache tag of that package, not the Actions cache. Pushes write it; pull requests log in to GHCR to read it.
  • PyPI: kaiten-mcp is taken there by an unrelated project, so the project is kaitencloud-mcp (free). The console script kaiten-mcp and the module kaiten_mcp keep their names. A v* tag runs a publish job after lint, test and build, checks the tag against pyproject.toml's version, and publishes with trusted publishing (no stored token, pypi environment).
  • uv.lock is relocked for the rename and kept at revision 3, which the pinned uv 0.9.1 reads (checked with uv lock --check).
  • CONTRIBUTING gains a Releasing section.

Before the first release

  1. Make the repo public (infra-scm).
  2. On PyPI, add a pending trusted publisher for kaitencloud-mcp: owner kaitencloud, repo mcp, workflow ci.yml, environment pypi. Create the pypi environment on the repo.

Checked

ruff, pytest (56 passed), uv build under the new name, docker build, and uv lock --check with uv 0.9.1. The workflow itself can only be proven by CI on this PR (the PR build exercises the registry cache; a push to main exercises the publish).

The build job failed on main with permission_denied: read_package: it pushed
ghcr.io/kaitencloud/mcp, an older private package linked to kaiten-internal
that this repository's token cannot write, and which only the package's
settings can open to it. The image now goes to ghcr.io/kaitencloud/kaiten-mcp,
created by this repository's first publish and linked to it by the image's
source label, so it takes the repository's visibility.

The build cache moves from the GitHub Actions cache to a tag of the image's
own package: the gha cache is read-only on a re-run of an old pull request
("failed to reserve cache"). Only pushes write it; pull requests log in to
read it.

A v* tag now also publishes the Python package. kaiten-mcp is taken on PyPI by
an unrelated project, so the project is renamed kaitencloud-mcp; the
console script and the module keep their names. The publish job runs after
lint, test and build, checks the tag against pyproject.toml's version, and
publishes with trusted publishing (no stored token, id-token: write, the pypi
environment). uv.lock stays at revision 3, which the pinned uv 0.9.1 reads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tom Ribuot <tom.ribuot@kaiten.sh>
@Alexkuva
Alex (Alexkuva) merged commit a89e2a1 into main Oct 22, 2026
5 checks passed
@Alexkuva
Alex (Alexkuva) deleted the fix/ci-publish branch October 22, 2026 09:16
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.

2 participants