发布

diegosouzapw2026-10-28查看 646复制 1894

如何将新版 pgdbm 库发布到 PyPI

Download (.md)

📘如何使用这个技能

  1. 1
    复制技能内容·点击上方「Copy SKILL.md」复制全部内容,或 Download 下载到本地
  2. 2
    打开你的 AI 客户端·支持 Claude Code、Trae、Cursor、ChatGPT、DeepSeek、Kimi 等任意 AI 助手
  3. 3
    粘贴为系统提示/知识文件·Claude Code:放入 .claude/skills/ 目录;普通对话:作为首条消息发送并说「请严格按这份技能文档执行」
  4. 4
    直接提出你的需求·AI 会按技能定义的工作流、格式和约束来处理,无需再解释背景

💡 提示:技能生效后,每次对话只需一句需求,AI 会按 SKILL.md 的流程执行。

SKILL.md2108 chars
---
name: release
description: How to release a new pgdbm library version to PyPI
---

# Releasing pgdbm

## Overview

This skill guides you through releasing a new version of the pgdbm library.

## Prerequisites

- All tests passing
- Changes committed to main branch
- CHANGELOG.md updated with changes

## Release Checklist

### 1. Run Tests

```bash
uv run pytest
```

All tests must pass before releasing.

### 2. Update Version Numbers

Three files need version updates:

```bash
# Check current version
grep "^version" pyproject.toml
```

Update these files to the new version:

| File | Location |
|------|----------|
| `pyproject.toml` | `version = "X.Y.Z"` |
| `src/pgdbm/__version__.py` | `__version__ = "X.Y.Z"` |
| `.claude-plugin/plugin.json` | `"version": "X.Y.Z"` |

**Important**: The plugin.json version controls Claude Code skill caching. Always bump it when releasing.

### 3. Update CHANGELOG.md

Add entry at the top:

```markdown
## [X.Y.Z] - YYYY-MM-DD

### Added
- New features

### Changed
- Changes to existing features

### Fixed
- Bug fixes
```

### 4. Commit the Release

```bash
git add pyproject.toml src/pgdbm/__version__.py .claude-plugin/plugin.json CHANGELOG.md uv.lock
git commit -m "chore: bump version to X.Y.Z

- Summary of changes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>"
```

### 5. Create Git Tag

```bash
git tag -a vX.Y.Z -m "Release X.Y.Z"
```

### 6. Push to GitHub

```bash
git push origin main
git push origin vX.Y.Z
```

### 7. Publish to PyPI

**Important**: Clean the dist/ directory first to avoid uploading old versions.

```bash
rm -rf dist/
uv build
uv publish
```

Or if using twine:

```bash
rm -rf dist/
uv build
twine upload dist/*
```

### 8. Verify Release

```bash
# Check PyPI
pip index versions pgdbm

# Check plugin update works
claude plugin update pgdbm@juanre-ai-tools
```

## Version Numbering

Follow semver:
- **MAJOR** (X.0.0): Breaking API changes
- **MINOR** (0.X.0): New features, backward compatible
- **PATCH** (0.0.X): Bug fixes, documentation

## Related Skills

- For skill updates: See `publish-skills` skill
来源:skillsdirectory

评论0

登录后参与评论

还没有评论,来抢沙发吧