From 9c402f3ea39dab2784f9a15cb9c1b7bb64f7540c Mon Sep 17 00:00:00 2001 From: YK <1811651+ykdojo@users.noreply.github.com> Date: Fri, 31 Jul 2026 12:19:33 -0700 Subject: [PATCH] ci(release): create GitHub releases on tag push, drop release-drafter --- .github/release-drafter.yml | 77 --------------------------- .github/workflows/publish-package.yml | 8 +++ .github/workflows/release-drafter.yml | 36 ------------- AGENTS.md | 13 +++-- 4 files changed, 17 insertions(+), 117 deletions(-) delete mode 100644 .github/release-drafter.yml delete mode 100644 .github/workflows/release-drafter.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index e9009fb..0000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,77 +0,0 @@ -name-template: v$NEXT_PATCH_VERSION -tag-template: v$NEXT_PATCH_VERSION - -categories: -- title: '💥 Breaking Changes' - labels: - - 'breaking change' - - 'breaking' - -- title: '✨ Features' - labels: - - 'feat' - - 'feature' - - 'enhancement' - -- title: '🐛 Bug Fixes' - labels: - - 'fix' - - 'bug' - -- title: '🚀 Performance' - labels: - - 'perf' - - 'performance' - -- title: '♻️ Refactor' - labels: - - 'refactor' - -- title: '📖 Documentation' - labels: - - 'docs' - - 'documentation' - -- title: '✅ Tests' - labels: - - 'test' - - 'testing' - -- title: '👷 CI' - labels: - - 'ci' - -- title: '🔧 Maintenance' - labels: - - 'chore' - -- title: '⏪ Reverts' - labels: - - 'revert' - -- title: '⬆️ Dependencies' - collapse-after: 3 - labels: - - 'dependencies' - - 'deps' - -version-resolver: - major: - labels: - - 'breaking' - minor: - labels: - - 'feat' - - 'feature' - - 'enhancement' - default: patch - -change-template: '- $TITLE @$AUTHOR (#$NUMBER)' -change-title-escapes: '\<*_&' # Escapes to prevent mentions and markdown formatting - -template: | - ## What's Changed 🚀 - - $CHANGES - - **Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$NEXT_PATCH_VERSION diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 488d642..21c7765 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -18,6 +18,8 @@ jobs: environment: ${{ github.event_name == 'workflow_dispatch' && inputs.test-pypi && 'testpypi' || 'pypi' }} permissions: id-token: write + # to create the GitHub release for the tag + contents: write steps: - uses: actions/checkout@v4 with: @@ -35,3 +37,9 @@ jobs: - name: Publish to PyPI if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && !inputs.test-pypi) uses: pypa/gh-action-pypi-publish@release/v1 + + - name: Create GitHub release with generated notes + if: github.event_name == 'push' + env: + GH_TOKEN: ${{ github.token }} + run: gh release create "$GITHUB_REF_NAME" --generate-notes --verify-tag diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml deleted file mode 100644 index 3084b82..0000000 --- a/.github/workflows/release-drafter.yml +++ /dev/null @@ -1,36 +0,0 @@ -# Adapted from: https://github.com/release-drafter/release-drafter#readme - -name: Release Drafter - -on: - push: - # branches to consider in the event; optional, defaults to all - branches: - - main - workflow_dispatch: - - -permissions: - # write permission is required to create a github release - contents: write - # write permission is required for autolabeler (which we don't use here) - # otherwise, read permission is required at least - pull-requests: read - -jobs: - update_release_draft: - runs-on: ubuntu-latest - steps: - # (Optional) GitHub Enterprise requires GHE_HOST variable set - #- name: Set GHE_HOST - # run: | - # echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV - - # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@v7 - # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml - # with: - # config-name: my-config.yml - # disable-autolabeler: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/AGENTS.md b/AGENTS.md index 373b1da..3b8ff78 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -81,7 +81,12 @@ conversion. Versions are derived from git tags via `hatch-vcs`. Tag releases as `v0.1.0`, `v0.2.0`, etc. -Publishing a GitHub release triggers `.github/workflows/publish-package.yml`, -which builds a wheel and sdist with `uv build` and uploads both to PyPI via -[trusted publishing](https://docs.pypi.org/trusted-publishers/). Configure the -trusted publisher on PyPI for this repository before the first release. +Pushing a `v*` tag triggers `.github/workflows/publish-package.yml`, which +builds a wheel and sdist with `uv build`, uploads both to PyPI via +[trusted publishing](https://docs.pypi.org/trusted-publishers/), and creates a +GitHub release for the tag with auto-generated notes. To cut a release: + +``` +git tag v0.X.0 +git push origin v0.X.0 +```