From 452c7e78e8b11edfa9aa75517307814d1e367c59 Mon Sep 17 00:00:00 2001 From: Alexander Schwartzman Date: Wed, 14 Oct 2026 16:23:14 -0400 Subject: [PATCH 1/2] ci(release): start a release's notes at the previous release, not the previous tag A tag that main's CI keeps off PyPI gets no GitHub release. Starting the next release's notes at that tag left its pull requests out of every release's notes. --- .github/workflows/publish-pypi.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 9a98eb19..f36330b8 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -5,7 +5,7 @@ name: Publish to PyPI # distribution the way the release does (agentenv-framework pinned to the exact agentenv-framework-protocol it was # released with) and runs in its own environment, because PyPI binds a pending publisher to one workflow and # environment per project. Once both are on PyPI, it creates the tag's GitHub release, whose notes list the pull -# requests merged since the previous tag. Files already on PyPI and a release that already exists are skipped, so a +# requests merged since the previous release. Files already on PyPI and a release that already exists are skipped, so a # rerun is safe. on: @@ -110,7 +110,7 @@ jobs: with: fetch-depth: 0 persist-credentials: false - - name: Create the GitHub release, with notes from the pull requests since the previous tag + - name: Create the GitHub release, with notes from the pull requests since the previous release env: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} @@ -124,8 +124,11 @@ jobs: protocol=$(sed -n 's/^version = "\(.*\)"/\1/p' packages/agentenv-protocol/pyproject.toml) header="On PyPI: [agentenv-framework ${framework}](https://pypi.org/project/agentenv-framework/${framework}/) ยท [agentenv-framework-protocol ${protocol}](https://pypi.org/project/agentenv-framework-protocol/${protocol}/)" args=(--verify-tag --title "$tag" --generate-notes --notes "$header") - # Without a start tag, GitHub counts from the previous release rather than the previous tag. - previous=$(git tag --list 'v*' --sort=-v:refname | grep -A1 -x "$tag" | sed -n 2p) + # From the newest earlier tag with a release, not the previous tag: a tag main's CI kept off PyPI has no + # release, and its pull requests belong in these notes. + released=$(gh release list --limit 100 --json tagName --jq '.[].tagName') + previous=$(git tag --list 'v*' --sort=-v:refname | awk -v tag="$tag" 'after; $0 == tag {after = 1}' | + grep -m1 -Fx -f <(printf '%s\n' "$released") || true) if [ -n "$previous" ]; then args+=(--notes-start-tag "$previous") fi From 244953951df42b0ec9c06cf230b33f8641d45e35 Mon Sep 17 00:00:00 2001 From: Alexander Schwartzman Date: Wed, 14 Oct 2026 19:16:40 -0400 Subject: [PATCH 2/2] ci(release): address greptile review findings - Read every release, not the newest 100, so an old tag's re-run still finds the release before it. - CONTRIBUTING.md: release notes start at the previous release, and a tag that main's CI kept off PyPI has none. --- .github/workflows/publish-pypi.yml | 2 +- CONTRIBUTING.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index f36330b8..cd8b32ed 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -126,7 +126,7 @@ jobs: args=(--verify-tag --title "$tag" --generate-notes --notes "$header") # From the newest earlier tag with a release, not the previous tag: a tag main's CI kept off PyPI has no # release, and its pull requests belong in these notes. - released=$(gh release list --limit 100 --json tagName --jq '.[].tagName') + released=$(gh api --paginate "repos/${GH_REPO}/releases?per_page=100" --jq '.[].tag_name') previous=$(git tag --list 'v*' --sort=-v:refname | awk -v tag="$tag" 'after; $0 == tag {after = 1}' | grep -m1 -Fx -f <(printf '%s\n' "$released") || true) if [ -n "$previous" ]; then diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f117d040..191d21b3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -83,7 +83,8 @@ contributors should not edit `version` in `pyproject.toml`. Each release publish `agentenv-framework` and `agentenv-framework-protocol` to PyPI (`.github/workflows/publish-pypi.yml`, trusted publishing on the release tag); the import package `agent_env` and the command `agent-env` keep their names. Once both are on PyPI, the same workflow creates the GitHub release, whose notes are the titles of the pull requests merged since -the previous tag, so a clear pull request title is also the release note. +the previous release, so a clear pull request title is also the release note. A tag whose commit does not pass +`main`'s CI is not published and gets no release; its pull requests are in the next release's notes. ## Getting help