Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,38 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/download-artifact@v8
with:
name: dist
path: dist/
# A release without a real description is incomplete, so the body comes from this
# version's CHANGELOG section; generated notes still add the PR and contributor list.
- name: Extract this version's CHANGELOG section
id: changelog
run: |
version="${GITHUB_REF_NAME#v}"
body=$(awk -v v="$version" '
index($0, "## [" v "]") == 1 { found = 1; next }
found && /^## / { exit }
found { print }
' CHANGELOG.md)
if [ -z "$body" ]; then
echo "::error::CHANGELOG.md has no section for $version"
exit 1
fi
{
echo 'body<<CHANGELOG_EOF'
echo "$body"
echo 'CHANGELOG_EOF'
} >> "$GITHUB_OUTPUT"
- name: Create release
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
with:
generate_release_notes: true
body: ${{ steps.changelog.outputs.body }}
files: |
dist/*.whl
dist/*.tar.gz
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

### Changed

- The GitHub release body now comes from the tagged version's CHANGELOG section (generated notes
still add the PR list), and the release fails if that section is missing.

- CI runs on `pull_request` and `workflow_dispatch` only; the
`push: branches: [main]` trigger is gone. A new
`coverage-baseline.yml` refreshes the Codecov baseline for `main`
Expand Down
Loading