Repository navigation
Release automation: publish hindsight-sre to PyPI and image to GHCR - #6
Merged
Merged
Conversation
- release-pypi.yml: on v* tags, build sdist/wheel, verify the tag matches pyproject, check the wheel bundles the UI and sample knowledge, publish hindsight-sre to PyPI via Trusted Publishing, and create the GitHub release. workflow_dispatch publishes a .devN build to TestPyPI. - release-image.yml: on v* tags, smoke-test the image, then push ghcr.io/drdroidlab/hindsight:<version>, :<major>.<minor> and :latest for linux/amd64 and linux/arm64 using GITHUB_TOKEN. - compose.yaml pulls ghcr.io/drdroidlab/hindsight:latest (overridable with HINDSIGHT_IMAGE) and keeps build: . for local builds. - README and docs: engineers run `uv tool install hindsight-sre` (or pipx); team leads fetch the compose files and run `docker compose up -d`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- README: `mcp-name: io.github.DrDroidLab/hindsight-sre` comment, which the registry checks in the PyPI long description. - Dockerfile and GHCR metadata: io.modelcontextprotocol.server.name label and "Hindsight SRE" image title. - server.json for io.github.DrDroidLab/hindsight-sre (title "Hindsight SRE"), a pypi package run as `uvx hindsight-sre mcp-proxy`. - Add a `hindsight-sre` console script alias so that uvx command resolves. - Release workflow fails the tag if server.json versions drift from pyproject.toml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Makes the launch quickstart work without cloning or building locally.
.github/workflows/release-pypi.yml— on av*tag: checks the tag matchespyproject.toml's version, runspython -m build,twine check --strict, verifies the wheel containshindsight/static/*andhindsight/sample-knowledge/, publisheshindsight-sreto PyPI with Trusted Publishing (OIDC, no token secret), then creates a GitHub release with the dists attached.workflow_dispatchis the dry run: it rewrites the version to<version>.dev<run_number>(so repeated dry runs never collide) and publishes to TestPyPI..github/workflows/release-image.yml— on av*tag: builds amd64, runsscripts/demo-smoke.pyagainst it, then buildslinux/amd64,linux/arm64and pushesghcr.io/drdroidlab/hindsight:<version>,:<major>.<minor>and:latest(latest is skipped for PEP 440 pre-releases such asv0.2.0rc1) usingGITHUB_TOKENwithpackages: write.workflow_dispatchbuilds both platforms without pushing.compose.yaml—image: ${HINDSIGHT_IMAGE:-ghcr.io/drdroidlab/hindsight:latest}plusbuild: .. Compose pulls the image when it isn't present and only builds with--build(verified: withimage+buildand no Dockerfile in the directory,docker compose createpulls).compose.demo.yamlis unchanged and still merges cleanly..env.exampledocumentsHINDSIGHT_IMAGEfor pinning.Docs (README,
docs/getting-started.md,docs/index.md,docs/operations.md) — engineers:uv tool install hindsight-sre(orpipx install hindsight-sre). Team leads:curlthe compose file(s) frommain,docker compose up -d,bootstrap. There's nogit cloneor--build; the from-clone--buildpath is still documented as a tip. Production deploys use a separate directory so demo data doesn't share a volume.docs/demo.md(screenshot recipe from a checkout) keeps--buildon purpose.MCP Registry readiness (so Hindsight can be listed without a second release):
<!-- mcp-name: io.github.DrDroidLab/hindsight-sre -->, the ownership marker the registry looks for in the PyPI long description. I verified it's in the built wheel's METADATA.io.modelcontextprotocol.server.name=io.github.DrDroidLab/hindsight-sre(Dockerfile and metadata-action), plus the OCI title "Hindsight SRE".server.jsondeclaresio.github.DrDroidLab/hindsight-sre, title Hindsight SRE (to stay distinct fromio.github.Rbfinch/hindsight-mcpand Vectorize's Hindsight), and a PyPI package run asuvx hindsight-sre mcp-proxy. It lists the optionalHINDSIGHT_SERVER,HINDSIGHT_API_KEY(secret) andHINDSIGHT_SCOPEvariables; the credential file fromhindsight loginis the preferred source. It validates against the 2025-12-11 schema.hindsight-sreconsole-script alias (same entry point ashindsight) makesuvx hindsight-sre …resolve.server.jsonversions don't matchpyproject.toml, so bump all three together.Verification (local)
actionlint1.7.7 (with shellcheck) on all workflows: cleanpython -m build: wheel containsstatic/index.html,static/assets/{app.js,style.css}and 7 sample-knowledge files;twine check --strictpassesdocker build .+scripts/demo-smoke.py: PASSmkdocs build --strict: cleandocker compose -f compose.yaml -f compose.demo.yaml config --quiet: okruff check,ruff format --check,mypy src/hindsight,pytest(85 passed): all passThe workflows themselves haven't run yet. They only fire on a tag or a manual dispatch.
One-time maintainer setup (before the first tag)
PyPI / TestPyPI Trusted Publishing
hindsight-sre, ownerDrDroidLab, repositoryhindsight, workflowrelease-pypi.yml, environmentpypi.testpypi.pypi(recommended: required reviewers and a deployment tag rule ofv*) andtestpypi.GHCR
4. Settings → Actions → General → Workflow permissions: the job requests
packages: writeexplicitly, so the default read-only setting is fine. Just make sure the org doesn't block Actions from publishing packages (org Settings → Packages).5. After the first push, open the
hindsightpackage under the DrDroidLab org, set visibility to Public (new GHCR packages are private, anddocker compose pullwould fail anonymously), and confirm it's linked to this repo (the OCIsourcelabel should link it automatically).Release
6. Bump the version in
pyproject.tomland bothversionfields inserver.jsontogether for each release.7. Optionally run release-pypi via Run workflow to dry-run on TestPyPI, then push
v0.1.0(it must matchpyproject.toml).MCP Registry (after the first PyPI release is live)
8. Install
mcp-publisherfrom the modelcontextprotocol/registry releases, then from the repo root runmcp-publisher login github(as a DrDroidLab member, for theio.github.DrDroidLab/namespace) andmcp-publisher publish.main, so the new install commands will 404 untilv0.1.0is published. Tag right after merging, or hold the merge until you're ready to tag.🤖 Generated with Claude Code