Skip to content

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

ci: publish Python distributions to GitHub releases

JerrettDavisf5dfdda253f0
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 13844d06a..da1bec0d1 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -395,15 +395,28 @@ jobs:
run: |
ls -la release-assets
- - name: Create GitHub Release
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
- TAG="v${{ needs.detect-version.outputs.version }}"
- TITLE="Release v${{ needs.detect-version.outputs.version }}"
+ - name: Create or update GitHub Release
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ TAG="v${{ needs.detect-version.outputs.version }}"
+ TITLE="Release v${{ needs.detect-version.outputs.version }}"
if gh release view "$TAG" > /dev/null 2>&1; then
gh release edit "$TAG" --title "$TITLE" --notes-file .changelog.md
- else
- gh release create "$TAG" --title "$TITLE" --notes-file .changelog.md
- fi
- gh release upload "$TAG" release-assets/* --clobber
+ else
+ gh release create "$TAG" --title "$TITLE" --notes-file .changelog.md
+ fi
+
+ - name: Publish ${{ env.PYPI_PACKAGE }} Python distributions to GitHub Release
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ TAG="v${{ needs.detect-version.outputs.version }}"
+ gh release upload "$TAG" release-assets/*.whl release-assets/*.tar.gz --clobber
+
+ - name: Publish Node package tarballs to GitHub Release
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ TAG="v${{ needs.detect-version.outputs.version }}"
+ gh release upload "$TAG" release-assets/*.tgz --clobber
diff --git a/docs/content/docs/releases.mdx b/docs/content/docs/releases.mdx
index 818087df4..c08c084cd 100644
--- a/docs/content/docs/releases.mdx
+++ b/docs/content/docs/releases.mdx
@@ -18,7 +18,7 @@ The release workflow also calls `.github/workflows/docker.yml` as a reusable wor
| `headroom-openclaw` | TypeScript plugin | npmjs.org | `NPM_OPENCLAW_PACKAGE` |
| `@{owner}/headroom-ai` | TypeScript SDK | GitHub Package Registry | — |
| `@{owner}/headroom-openclaw` | TypeScript plugin | GitHub Package Registry | — |
-| `headroom-ai-{version}.tar.gz` / `headroom_ai-{version}-py3-none-any.whl` | Python release assets | GitHub Release (`{owner}/headroom`) | — |
+| `headroom-ai-{version}.tar.gz` / `headroom_ai-{version}-py3-none-any.whl` | Python package distributions | GitHub Release (`{owner}/headroom`) | — |
| `headroom-ai-{version}.tgz` / `headroom-openclaw-{version}.tgz` | Node release assets | GitHub Release (`{owner}/headroom`) | — |
| `ghcr.io/{owner}/headroom` | Docker image | GitHub Container Registry | — |
@@ -102,7 +102,7 @@ Publishes both Node packages to GitHub Package Registry (`npm.pkg.github.com`) u
- `plugins/openclaw/` as `@{owner}/headroom-openclaw`
### GitHub release assets
-Uploads the built Python distributions and both npm tarballs to the GitHub Release created in the current repository. This is what makes fork-owned main-branch builds downloadable for local validation even when consumers are not pulling from PyPI or npmjs.org.
+Uploads the built Python distributions and both npm tarballs to the GitHub Release created in the current repository. GitHub Packages does not provide a PyPI-compatible package registry, so the workflow publishes Python wheels and sdists to GitHub as release assets while npm packages go to GitHub Package Registry and Docker images go to GHCR.
### publish-docker
Calls the reusable Docker workflow to publish GHCR images with the same semantic version and synced package metadata as the rest of the release.
diff --git a/tests/test_release_workflows.py b/tests/test_release_workflows.py
index 168b70fb1..fc270fc99 100644
--- a/tests/test_release_workflows.py
+++ b/tests/test_release_workflows.py
@@ -27,6 +27,17 @@ def test_release_workflow_publishes_both_node_packages_to_github_packages() -> N
assert "SDK_TARBALL: ${{ steps.gpr-sdk-publish.outputs.unscoped_sdk_tarball }}" in content
+def test_release_workflow_publishes_python_distributions_to_github_release() -> None:
+ content = (ROOT / ".github" / "workflows" / "release.yml").read_text(encoding="utf-8")
+
+ assert "Publish ${{ env.PYPI_PACKAGE }} Python distributions to GitHub Release" in content
+ assert (
+ 'gh release upload "$TAG" release-assets/*.whl release-assets/*.tar.gz --clobber' in content
+ )
+ assert "Publish Node package tarballs to GitHub Release" in content
+ assert 'gh release upload "$TAG" release-assets/*.tgz --clobber' in content
+
+
def test_create_release_runs_after_successful_build_even_if_other_publishes_fail() -> None:
content = (ROOT / ".github" / "workflows" / "release.yml").read_text(encoding="utf-8")