Automate label-based Python release versioning with Release Drafter

未關閉
#23 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@imshubham22apr-gif 已經在處理了。

開始於 2026年11月10日。

  • #24 來自 @imshubham22apr-gif —— 未關閉

評估

難度
5/5
預估耗時
一週以上
新手友好度
20/100
Issue 類型
功能
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
github, github-actions, python
領域
ci-cd, release

研究方向

Read .github/workflows/release.yml, the existing publishing workflow, pyproject.toml, uv.lock, and the release guidance in CONTRIBUTING.md; first trace how a pushed v* tag reaches PyPI publishing. Define how PR labels resolve version bumps and how release creation triggers publishing despite GitHub token event restrictions. Done means the acceptance checks pass, including version and lockfile consistency, preserved publishing checks, and repeat runs without duplicate releases or publications.

由索引模型根據 Issue 內容生成。

描述

enhancement good first issue help wanted

Problem / Motivation

PyPI publishing is already automated for pushed v* tags, but preparing a release still requires manually updating the package version and creating a matching tag. There is currently no Release Drafter configuration or workflow to calculate the next version from pull-request labels and maintain release notes.

Current State

  • pyproject.toml declares a static package version (0.1.0).
  • .github/workflows/release.yml runs on pushed v* tags and rejects tags that do not match the declared package version.
  • CONTRIBUTING.md documents manually setting the version and pushing a matching tag.
  • The existing pipeline builds, verifies, publishes through PyPI Trusted Publishing, and verifies the published package.

Proposed Solution

Use Release Drafter to maintain draft release notes and resolve the next semantic version from labels on merged pull requests. Connect that resolved version to release preparation so package metadata, the lockfile, the GitHub release, and its tag stay consistent without manual version editing. Maintainers should retain control over when a release is published.

Acceptance Criteria

  • Add Release Drafter configuration and a workflow that maintains a draft release from merged PRs on the default branch.
  • Define and document labels for major, minor, and patch releases; use the highest applicable bump across merged PRs and document the behavior for unlabeled PRs.
  • Automatically prepare the resolved package version in pyproject.toml and keep uv.lock consistent before building release artifacts.
  • Ensure the release tag and published Python package version match, using a Python-compatible version format.
  • Explicitly connect the release/tag creation mechanism to the publishing pipeline, accounting for GitHub token event-trigger restrictions so an automated release actually starts publishing.
  • Preserve the existing build/verification checks, tag/version mismatch guard, and PyPI Trusted Publishing flow.
  • Verify patch/minor/major resolution, mixed-label precedence, unlabeled PR behavior, version/lockfile consistency, and repeat runs without duplicate releases or publications.
  • Update CONTRIBUTING.md with the label policy and maintainer release process.

Related Files

  • .github/workflows/release.yml
  • .github/workflows/publish-testpypi.yml
  • pyproject.toml
  • uv.lock
  • CONTRIBUTING.md
主要語言
Python
星號
0
分支
4
平均合併
1 天 14 小時
30 天內合併 PR
11

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。