Skip to content

Commit bf96ae7

Browse files
committed
Scope PyPI release tags for the CLI package
- Change the PyPI release workflow to trigger only on pypi-glasskit-ai-v* tags so this monorepo can support other package release streams later. - Validate the package version against the package-specific tag prefix and title GitHub Releases as PyPI: glasskit.ai vX.Y.Z. - Replace GitHub repo-wide generated release notes with a small package-scoped note body and cli/ commit list since the previous PyPI package tag. - Update CLI release docs and agent notes to use the new package-specific tag format. - Verified with UV_PYTHON=3.12 uv run ty check, uv run pytest, uv run ruff check --fix, uv run ruff format, source CLI help checks, uv build --no-sources --clear, isolated wheel/sdist help smoke tests, a release-note shell simulation with pipefail, and git diff --check.
1 parent bda5e29 commit bf96ae7

3 files changed

Lines changed: 39 additions & 11 deletions

File tree

.github/workflows/release.yml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ env:
66
on:
77
push:
88
tags:
9-
- "v*"
9+
- "pypi-glasskit-ai-v*"
1010

1111
concurrency:
1212
group: release-${{ github.ref }}
@@ -55,7 +55,7 @@ jobs:
5555
shell: bash
5656
run: |
5757
PACKAGE_VERSION="$(uv version --short)"
58-
TAG_VERSION="${GITHUB_REF_NAME#v}"
58+
TAG_VERSION="${GITHUB_REF_NAME#pypi-glasskit-ai-v}"
5959
6060
if [[ "${PACKAGE_VERSION}" != "${TAG_VERSION}" ]]; then
6161
echo "::error::pyproject.toml version ${PACKAGE_VERSION} does not match tag ${TAG_VERSION}"
@@ -94,9 +94,37 @@ jobs:
9494
- name: Create GitHub Release
9595
env:
9696
GH_TOKEN: ${{ github.token }}
97+
RELEASE_TAG_PREFIX: pypi-glasskit-ai-v
9798
run: |
99+
VERSION="${GITHUB_REF_NAME#${RELEASE_TAG_PREFIX}}"
100+
PREVIOUS_TAG="$(
101+
git tag --list "${RELEASE_TAG_PREFIX}*" --sort=-v:refname \
102+
| grep -Fxv "${GITHUB_REF_NAME}" \
103+
| head -n 1 \
104+
|| true
105+
)"
106+
107+
{
108+
echo "PyPI package: glasskit.ai"
109+
echo "Version: ${VERSION}"
110+
111+
if [[ -n "${PREVIOUS_TAG}" ]]; then
112+
echo
113+
echo "CLI changes since ${PREVIOUS_TAG}:"
114+
git log --format='- %s (%h)' "${PREVIOUS_TAG}..${GITHUB_REF_NAME}" -- cli > /tmp/cli-release-changes.txt
115+
if [[ -s /tmp/cli-release-changes.txt ]]; then
116+
cat /tmp/cli-release-changes.txt
117+
else
118+
echo "- No changes under cli/."
119+
fi
120+
else
121+
echo
122+
echo "Initial PyPI release for glasskit.ai."
123+
fi
124+
} > release-notes.md
125+
98126
gh release create "${GITHUB_REF_NAME}" dist/* \
99127
--repo "${GITHUB_REPOSITORY}" \
100128
--verify-tag \
101-
--title "${GITHUB_REF_NAME}" \
102-
--generate-notes
129+
--title "PyPI: glasskit.ai v${VERSION}" \
130+
--notes-file release-notes.md

cli/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ GlassKit CLI turns recorded smart-glasses workflows into repeatable eval suites
3030
- `uv run ty check && uv run pytest && uv run ruff check --fix && uv run ruff format`: run after changes.
3131
- `uv run glasskit --help` and `uv run glasskit eval --help`: smoke-check the console entry point.
3232
- `uv build --no-sources --clear` plus isolated `dist/*.whl` and `dist/*.tar.gz` smoke tests: verify publishable artifacts before release.
33-
- Releases are tag-triggered from the repository root workflow. `pyproject.toml` version and the pushed `vX.Y.Z` tag must match.
33+
- PyPI releases are tag-triggered from the repository root workflow. `pyproject.toml` version and the pushed `pypi-glasskit-ai-vX.Y.Z` tag must match.
3434
- For local testing against the Origami backend, run the CLI from the app backend directory so local adapter imports resolve naturally: `cd REPO-ROOT/examples/origami/backend && uv run --with-editable ../../../cli --env-file .env glasskit eval run --adapter eval_adapter.py:create_evaluator --suite eval-suite`

cli/PUBLISHING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Publishing GlassKit CLI
22

3-
The PyPI project is `glasskit.ai`, and the installed command is `glasskit`. Releases are tag-driven from GitHub Actions using PyPI Trusted Publishing, so no PyPI token should be stored in GitHub.
3+
The PyPI project is `glasskit.ai`, and the installed command is `glasskit`. PyPI releases are tag-driven from GitHub Actions using PyPI Trusted Publishing, so no PyPI token should be stored in GitHub.
44

55
## One-Time Setup (Done)
66

@@ -33,18 +33,18 @@ uv run --isolated --no-project --with dist/*.whl glasskit --help
3333
uv run --isolated --no-project --with dist/*.tar.gz glasskit --help
3434
```
3535

36-
For a normal future release, bump the version, commit the version change, tag the commit, and push both the branch and tag:
36+
For a normal future release, bump the version, commit the version change, tag the commit with the PyPI package-specific tag format, and push both the branch and tag:
3737

3838
```bash
3939
uv version --bump patch
4040
VERSION="$(uv version --short)"
4141
git add pyproject.toml uv.lock
42-
git commit -m "Release v${VERSION}"
43-
git tag -a "v${VERSION}" -m "v${VERSION}"
42+
git commit -m "Release glasskit.ai v${VERSION}"
43+
git tag -a "pypi-glasskit-ai-v${VERSION}" -m "pypi-glasskit-ai-v${VERSION}"
4444
git push origin main
45-
git push origin "v${VERSION}"
45+
git push origin "pypi-glasskit-ai-v${VERSION}"
4646
```
4747

48-
Pushing the tag runs `.github/workflows/release.yml`. The workflow checks that the tag matches `pyproject.toml`, runs type checks, tests, lint, formatting checks, source CLI help checks, builds wheel and sdist artifacts, smoke-tests both artifacts, publishes to PyPI with `uv publish --trusted-publishing always`, and creates a GitHub Release with the built artifacts attached.
48+
Pushing the `pypi-glasskit-ai-vX.Y.Z` tag runs `.github/workflows/release.yml`. The workflow checks that the tag matches `pyproject.toml`, runs type checks, tests, lint, formatting checks, source CLI help checks, builds wheel and sdist artifacts, smoke-tests both artifacts, publishes to PyPI with `uv publish --trusted-publishing always`, and creates a package-scoped GitHub Release with the built artifacts attached.
4949

5050
After pushing the release tag, open the GitHub Actions release run and approve the `pypi` deployment when GitHub asks for review.

0 commit comments

Comments
 (0)