- 到 https://pypi.org/manage/account/token/ 建立 API token
- 到 GitHub repo → Settings → Secrets → Actions
- 新增 secret:
PYPI_API_TOKEN= 你的 token
-
pyproject.toml版本號已更新 -
README.md更新(如有變更) - 測試全部通過:
python -m pytest tests/test_objecttree.py
# 1. 建立 git tag
git tag v0.1.0
git push origin v0.1.0
# 2. 到 GitHub 建立 Release
# - 點擊 "Releases" → "Draft a new release"
# - 選擇剛才的 tag: v0.1.0
# - 標題:v0.1.0
# - 描述:列出變更內容
# - 點擊 "Publish release"
# 3. GitHub Actions 自動執行:
# ✓ 跑測試(Python 3.9-3.13)
# ✓ 打包
# ✓ 上傳到 PyPI到 GitHub → Actions → "Publish to PyPI" → "Run workflow"
0.1.0→0.1.1:Bug 修復0.1.0→0.2.0:新增功能(向後相容)0.1.0→1.0.0:Breaking changes
# 1. 更新版本號
vim pyproject.toml # version = "0.1.1"
# 2. 本地測試
cd schema2object/python
python -m pytest tests/test_objecttree.py -v
# 3. Commit 變更
git add pyproject.toml
git commit -m "Bump version to 0.1.1"
git push
# 4. 建立 Release(GitHub 網頁操作)
# - 自動觸發 CI/CD
# - 5-10 分鐘後在 PyPI 上線如果發布有問題:
# 1. Yank bad version (不刪除,但標記為不推薦)
pip install twine
twine upload --skip-existing dist/* # 上傳修復版本
# 2. 到 PyPI 網頁標記舊版本為 "yanked"- ✅ 啟用 GitHub Actions(自動測試)
- ✅ 啟用 Stale bot(自動關閉舊 issue)
- ✅ 在 README 寫明:"Maintenance mode - accepting critical bug fixes only"
每季度檢查一次:
- Python 新版本測試(GitHub Actions 自動跑)
- 回覆 critical issues(security/data loss)
- 合併高品質 PR
在 README 頂部加上:
> ⚠️ This project is no longer maintained. Consider using [alternatives].| 模式 | 年均時間 | 說明 |
|---|---|---|
| 零維護 | 0-2 小時 | 只處理 security issues |
| 低維護 | 2-5 小時 | 季度檢查 + critical fixes |
| 積極維護 | 20+ 小時 | 新功能 + 社群支援 |
建議:前兩年採用「低維護模式」,之後視情況轉「零維護」。