Skip to content

Commit e44c35a

Browse files
author
wangxinxin
committed
merge: release/v0.1.0 into main
2 parents 5775998 + 1d5e186 commit e44c35a

11 files changed

Lines changed: 453 additions & 116 deletions

File tree

.github/workflows/publish-pypi.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Publish to PyPI
2+
3+
# 仅在推送版本标签时触发,例如 v0.1.0
4+
on:
5+
push:
6+
tags:
7+
- "v*"
8+
9+
jobs:
10+
publish:
11+
# 在 GitHub 托管的 Ubuntu 运行环境中执行
12+
runs-on: ubuntu-latest
13+
permissions:
14+
# 需要写仓库内容权限,用于创建/更新 GitHub Release
15+
contents: write
16+
# 需要 OIDC 令牌权限,供发布动作进行认证流程
17+
id-token: write
18+
19+
steps:
20+
# 1) 检出仓库代码到运行环境
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
# 2) 准备构建/发布使用的 Python 环境
25+
- name: Setup Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: "3.13"
29+
30+
# 3) 安全校验:tag 版本必须与 pyproject.toml 中版本一致
31+
- name: Verify tag matches pyproject version
32+
run: |
33+
python - <<'PY'
34+
import os
35+
import tomllib
36+
from pathlib import Path
37+
38+
tag = os.environ["GITHUB_REF_NAME"]
39+
if not tag.startswith("v"):
40+
raise SystemExit(f"Tag must start with v, got: {tag}")
41+
42+
tag_version = tag[1:]
43+
pyproject = Path("pyproject.toml")
44+
data = tomllib.loads(pyproject.read_text(encoding="utf-8"))
45+
project_version = data["project"]["version"]
46+
47+
if tag_version != project_version:
48+
raise SystemExit(
49+
f"Tag version ({tag_version}) != pyproject version ({project_version})"
50+
)
51+
52+
print(f"Version check passed: {project_version}")
53+
PY
54+
55+
# 4) 构建 wheel/sdist,并校验包元数据
56+
- name: Build package
57+
run: |
58+
python -m pip install --upgrade pip
59+
python -m pip install build twine
60+
python -m build
61+
python -m twine check dist/*
62+
63+
# 5) 上传构建产物到 PyPI
64+
- name: Publish package to PyPI
65+
uses: pypa/gh-action-pypi-publish@release/v1
66+
with:
67+
password: ${{ secrets.PYPI_API_TOKEN }}
68+
69+
# 6) 基于当前 tag 创建 GitHub Release,并附加 dist 文件
70+
- name: Create GitHub Release
71+
uses: softprops/action-gh-release@v2
72+
with:
73+
tag_name: ${{ github.ref_name }}
74+
name: Release ${{ github.ref_name }}
75+
generate_release_notes: true
76+
files: |
77+
dist/*

AGENT.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
## 1) 信息源与优先级
66

77
- 用户的最新明确指令优先级最高。
8-
- 需求、计划、架构文档是实现依据,位置通常在 `docs/requirements/``docs/plan/``docs/architecture/`
8+
- 需求、计划、架构信息是实现依据;其中需求与 BUG 统一以 GitHub Issues 为准,计划与架构信息位于 `docs/plan/``docs/architecture/`
9+
- Git 工作流与发布流程统一以 `docs/Git 使用规范.md` 为准。
910
- 本文件定义通用协作规则,不限定具体业务功能。
1011

1112
冲突处理优先级(从高到低):
@@ -15,34 +16,50 @@
1516
3. 本文件(AGENT.md)
1617
4. 计划与路线图文档
1718

18-
## 2) 任务分解与执行顺序
19+
## 2) Git 工作流强约束(必须遵守)
20+
21+
- 分支策略严格遵循 `docs/Git 使用规范.md`
22+
- 禁止直接向 `main` 提交或推送代码;必须通过合并流程进入 `main`
23+
- 新功能开发分支必须从 `develop` 创建,并合并回 `develop`
24+
- 发布分支使用 `release/*`,生产紧急修复使用 `hotfix/*`
25+
- `hotfix/*` 修复完成后必须同时回合并到 `main``develop`
26+
- 版本标签遵循语义化版本(`vMAJOR.MINOR.PATCH`),并与发布记录一致。
27+
- 客户定制化优先采用配置/模块化/功能开关;仅在无法解耦时使用客户长期分支。
28+
29+
智能体在执行 Git 相关操作时必须:
30+
31+
1. 先确认当前分支是否符合规范再开始编码。
32+
2. 若分支不符合规范,先提示并给出正确分支建议(例如从 `develop``feature/*`)。
33+
3. 未经用户明确要求,不得直接在 `main` 上提交代码。
34+
35+
## 3) 任务分解与执行顺序
1936

2037
- 先读需求与计划,再编码;禁止未读上下文直接改代码。
2138
- 优先完成前置依赖任务,再做后置任务;不得跳过关键前置条件。
2239
- 每次提交应是最小可验证改动,避免把多个不相关改动混在一起。
2340
- 若需求不完整,先按仓库既有模式做最小可行实现,并在说明中列出假设。
2441

25-
## 3) 架构与目录约束
42+
## 4) 架构与目录约束
2643

2744
- 遵循仓库已有目录边界与模块职责;无必要不重排目录。
2845
- 接口层、业务层、基础设施层应尽量分离,避免耦合实现细节。
2946
- 新增模块优先放在语义清晰、可发现的目录,并与现有命名风格一致。
3047
- 不在单个函数中混合参数解析、核心业务、外部 I/O 和输出格式化。
3148

32-
## 4) 编码约定
49+
## 5) 编码约定
3350

3451
- 优先可读性与可维护性:短函数、清晰命名、单一职责。
3552
- 仅在必要时添加注释;注释解释“为什么”,不重复“做了什么”。
3653
- 新增依赖要最小化,并在变更说明中写明必要性与替代方案评估。
3754
- 严禁提交密钥、密码、Token、私钥、真实账号等敏感信息。
3855

39-
## 5) 输出与兼容性约定
56+
## 6) 输出与兼容性约定
4057

4158
- 任何对外行为变更(CLI/API/配置)都要保持兼容,或明确记录破坏性变化。
4259
- 结构化输出(如 JSON)应保持字段稳定;新增字段优先向后兼容。
4360
- 错误信息应可诊断、可区分,避免仅返回模糊失败文案。
4461

45-
## 6) 质量门禁(DoD)
62+
## 7) 质量门禁(DoD)
4663

4764
每个可交付改动至少满足:
4865

@@ -51,13 +68,13 @@
5168
- 文档在行为变化时同步更新(README、用法、配置或设计文档)。
5269
- 不引入与当前任务无关的大规模改动。
5370

54-
## 7) 变更纪律
71+
## 8) 变更纪律
5572

5673
- 未经明确要求,不进行大范围重构或风格化清理。
5774
- 不随意修改公共接口命名、配置键名、文件格式。
5875
- 若必须做破坏性调整,先在文档标注影响范围与迁移方案。
5976

60-
## 8) 智能体开工检查清单
77+
## 9) 智能体开工检查清单
6178

6279
1. 已阅读本文件与任务相关文档。
6380
2. 已确认前置依赖与影响范围。

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on Keep a Changelog, and this project follows Semantic Versioning.
6+
7+
## [Unreleased]
8+
9+
## [0.1.0] - 2026-02-14
10+
11+
### Added
12+
- PyPI release workflow triggered by version tags (`v*`).
13+
- Automatic GitHub Release creation with built package artifacts attached.
14+
- Initial EmailCLI scaffolding with package entrypoint `mailcli`.
15+
- Core command groups: `account`, `folder`, `envelope`, `message`, `attachment`.
16+
- Exmail-focused IMAP/SMTP workflows for list/search/read/send/attachment download.
17+
- Folder listing command and server folder name visibility.
18+
- Unified output mode support (`plain` and `json`) and debug mode.
19+
- Basic test coverage for core and CLI flows.
20+
- Chinese user documentation and release guide.

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ Mail CLI - An open-source email command-line tool for managing emails from the t
66

77
- Chinese product standard doc: `docs/README.zh-CN.md`
88
- Chinese command reference: `docs/COMMANDS.zh-CN.md`
9-
- Bug list template: `docs/BUGLIST.zh-CN.md`
9+
- Release guide (Chinese): `docs/RELEASING.zh-CN.md`
10+
- Changelog: `CHANGELOG.md`
11+
- Requirements issues: `https://github.com/andyWang1688/mailcli/issues?q=is%3Aissue+is%3Aopen+label%3Arequirement`
12+
- Bug issues: `https://github.com/andyWang1688/mailcli/issues?q=is%3Aissue+label%3Abug`
1013

1114
## Quick Start
1215

@@ -17,10 +20,13 @@ Preferred installation method: `pip` direct install.
1720
#### Option A: Install from PyPI (target release channel)
1821

1922
```bash
20-
pip install mailcli
23+
pip install exmail-cli
2124
```
2225

2326
After publishing to PyPI, this is the recommended way for all users.
27+
The installed CLI command remains `mailcli`.
28+
29+
Publishing strategy: merge to `main` does not publish; pushing a version tag like `v0.1.0` publishes to PyPI.
2430

2531
#### Option B: Install from local source (current development stage)
2632

@@ -79,7 +85,6 @@ Detailed command guide (Chinese):
7985

8086
## Architecture
8187

82-
- `docs/requirements/`: source requirements
8388
- `docs/plan/`: execution plans and milestones
8489
- `docs/architecture/`: architecture and directory conventions
8590
- `src/mailcli/core/`: business logic

docs/BUGLIST.zh-CN.md

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)