释放
- 作者仓库星标 1,396
- 作者仓库 psd-tools
- 领域
- 工程开发
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @psd-tools · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 即装即用
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- Python
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
提供的版本:$ARGUMENTS
获取标签: !`git fetch --tags -q || echo "Warning: failed to fetch tags — check network/auth and consider retrying."` 最后一个标签: !`git describe --tags --abbrev=0 2>/dev/null || echo "(none)"` 今天的日期: !`date +%Y-%m-%d` 现在通过运行以下命令之一列出自上次发布以来的提交:
阅读`docs/changelog.rst` 了解当前格式,然后使用此 RST 格式为 VERSION 起草一个新条目: 重要提示:`-` 下划线必须至少与标题行一样长(RST 要求)。计算`VERSION (YYYY-MM-DD)`中的确切字符并使用那么多的破折号。使用这些类别(每个项目符号选择最具体的一个):
将批准的变更日志条目直接添加到 `Changelog` 标题块和下面的空行之后,在标题和新条目之间留下一个空行。
然后使用编辑工具更新 `src/psd_tools/version.py` — 将现有的 `__version__` 行替换为: `VERSION` 是没有 `v` 前缀的裸 PEP 440 字符串(例如 `1.15.0`,而不是 `v1.15.0`)。然后暂存更改的文件并提交:将 `VERSION` 替换为实际版本字符串(例如 `1.15.0`)。
使用 `--title "Release vVERSION"` 和 `--body` 运行`gh pr create`,其中包含: A `## Release vVERSION` 标题 A `### Changelog` 部分,其中将步骤 2 中批准的条目粘贴到 A `### Release checklist` 部分,其中包含以下项目: `[ ] Changelog entry reviewed and accurate`
打印 PR URL。提醒用户:PR 获得批准并合并后,`auto-tag` GitHub Actions 工作流程会自动将合并提交标记为`vVERSION`。该标签推送会触发`release`工作流程,为所有平台构建轮子并发布到 PyPI。无需手动标记或发布。将 `VERSION` 替换为实际版本字符串。
## Step 0 — Determine target version
**Provided version**: $ARGUMENTS
### If a version was provided (above is non-empty)
Validate it as a PEP 440 string (e.g. `1.2.3`, `1.2.3a1`, `1.2.3rc1`, `1.2.3.post1`).
Note: PEP 440 versions must **not** start with `v` — that prefix belongs on the git tag, not
the version string.
Stop and ask the user to correct it if invalid. Store it as **VERSION** for all subsequent steps.
### If no version was provided (above is empty)
Analyze the commits listed in Step 1 to recommend the correct next version.
The last tag shown in Step 1 uses a `v` prefix (e.g. `v1.14.3`); strip it when computing
the next version so the result is a bare PEP 440 string (e.g. `1.14.4`, not `v1.14.4`).
Apply these semver rules:
- **Major bump** (`X+1.0.0`) — any commit that breaks a public API or documented behaviour
- **Minor bump** (`X.Y+1.0`) — any new public feature or API addition, no breaking changes
- **Patch bump** (`X.Y.Z+1`) — bug fixes, security patches, chores, docs, or refactoring only
Show your reasoning and proposed version to the user, then ask them to confirm or override it.
Store the confirmed version as **VERSION** for all subsequent steps.
## Step 1 — Review commits since the last release
Fetch tags:
!`git fetch --tags -q || echo "Warning: failed to fetch tags — check network/auth and consider retrying."`
Last tag: !`git describe --tags --abbrev=0 2>/dev/null || echo "(none)"`
Today's date: !`date +%Y-%m-%d`
Now list the commits since the last release by running one of these commands:
- If "Last tag" above is `(none)`: run `git log --oneline`
- Otherwise: run `git log <LAST_TAG>..HEAD --oneline` (substituting the actual tag)
You must run this command and review the output before proceeding to Step 0 or Step 2.
## Step 2 — Draft changelog entry
Read `docs/changelog.rst` to understand the current format, then draft a new entry for **VERSION**
using this RST format:
```
VERSION (YYYY-MM-DD)
--------------------
- [category] Description (#PR)
```
**Important**: The `-` underline must be at least as long as the title line (RST requirement).
Count the exact characters in `VERSION (YYYY-MM-DD)` and use that many dashes.
Use these categories (pick the most specific one per bullet):
- `api` — public API additions or changes
- `psd` — low-level PSD parsing/writing
- `fix` — bug fixes
- `refactor` — internal restructuring, no behaviour change
- `docs` — documentation only
- `ci` — CI/CD, GitHub Actions
- `chore` — dependency bumps, tooling, housekeeping
- `security` — security fixes
Group related changes. Omit purely internal churn that users won't care about. Reference PR numbers where available.
Show the draft to the user and ask for approval or edits before continuing.
## Step 3 — Update docs/changelog.rst
Prepend the approved changelog entry directly after the `Changelog` header block and the
following blank line, leaving a blank line between the header and the new entry.
## Step 4 — Create release branch and commit
```bash
git checkout -b release/vVERSION
```
Then update `src/psd_tools/version.py` using the Edit tool — replace the existing
`__version__` line with:
```python
__version__ = "VERSION"
```
`VERSION` is the bare PEP 440 string **without** the `v` prefix (e.g. `1.15.0`, not `v1.15.0`).
Then stage both changed files and commit:
```bash
git add docs/changelog.rst src/psd_tools/version.py
git commit -m "docs: release vVERSION"
git push -u origin release/vVERSION
```
Replace `VERSION` with the actual version string (e.g. `1.15.0`).
## Step 5 — Open a pull request
Run `gh pr create` with `--title "Release vVERSION"` and a `--body` containing:
- A `## Release vVERSION` heading
- A `### Changelog` section with the approved entry from Step 2 pasted in
- A `### Release checklist` section with these items:
- `[ ] Changelog entry reviewed and accurate`
- `[ ] Version follows PEP 440`
- A closing note: "After this PR is merged, the `auto-tag` workflow will tag the merge commit
as `vVERSION` and the `release` workflow will build wheels and publish to PyPI automatically."
Replace `VERSION` with the actual version string throughout.
## Step 6 — Done
Print the PR URL. Remind the user:
> After the PR is approved and merged, the `auto-tag` GitHub Actions workflow tags the merge
> commit as `vVERSION` automatically. That tag push triggers the `release` workflow to build
> wheels for all platforms and publish to PyPI. No manual tagging or publishing is needed.
Replace `VERSION` with the actual version string.
按说明文件中的顺序排列。
步骤 0 — 确定目标版本
如果提供了版本(以上非空)
如果没有提供版本(上面是空的)
第 1 步 - 审查自上次发布以来的提交
第 2 步 - 草稿变更日志条目
文件/命令 -> 1.2.3 · 1.2.3a1 · 1.2.3rc1 · 1.2.3.post1 · prefix (e.g. · 1.14.4 · v1.14.4 · X+1.0.0
内容校验值 -> 4c41e60ad95b
当前原文的自动摘译,尚未人工审校。
如果提供了版本(以上非空)
将其验证为 PEP 440 字符串(例如
1.2.3、1.2.3a1、1.2.3rc1、1.2.3.post1)。注意:PEP 440 版本不得以v开头 — 该前缀属于 git 标签,而不是版本字符串。如果无效请停止并要求用户更正。将其存储为 VERSION 以供所有后续步骤使用。如果没有提供版本(上面是空的)
分析步骤 1 中列出的提交以推荐正确的下一个版本。步骤 1 中显示的最后一个标签使用
v前缀(例如v1.14.3);在计算下一个版本时将其剥离,以便结果是一个裸 PEP 440 字符串(例如1.14.4,而不是v1.14.4)。应用这些 semver 规则: 主要碰撞 (X+1.0.0) — 任何破坏公共 API 或记录行为的提交