From 4436d2d11855c33a246a1ed2e15a774b7ff766a3 Mon Sep 17 00:00:00 2001 From: EONRaider Date: Fri, 4 Sep 2026 17:56:42 -0300 Subject: [PATCH] release: create the GitHub release automatically after publish MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v2.2.0's GitHub release had to be created by hand after the fact, because release.yml only ran CI and uv publish — the same gap existed for every prior tag. Add a github-release job that runs after publish succeeds, extracts the tag's own section from CHANGELOG.md, and calls gh release create with it, so a tag push produces the PyPI upload and the GitHub release together. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/release.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1c882c0..0661f7e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -59,3 +59,36 @@ jobs: fi echo "Tag ${GITHUB_REF_NAME} matches packaged version ${built}." - run: uv publish --trusted-publishing always + + github-release: + needs: publish + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v5 + # CHANGELOG.md is the single source of truth for release notes, so + # extract this tag's own section rather than maintaining a second + # copy anywhere. A missing section fails loudly instead of + # publishing an empty-body release. + - name: Extract this version's CHANGELOG section + run: | + set -euo pipefail + version="${GITHUB_REF_NAME#v}" + awk -v ver="$version" ' + found && /^## \[/ { exit } + found { print } + $0 ~ "^## \\[" ver "\\]" { found=1 } + ' CHANGELOG.md > release-notes.md + if [ ! -s release-notes.md ]; then + echo "::error::No '## [${version}]' section found in CHANGELOG.md." + exit 1 + fi + - name: Create GitHub release + env: + GITHUB_TOKEN: ${{ github.token }} + run: | + gh release create "${GITHUB_REF_NAME}" \ + --title "netprotocols ${GITHUB_REF_NAME#v}" \ + --notes-file release-notes.md \ + --latest