ci: GitHub Actions CI + PyPI 自動發佈(推 tag 觸發,OIDC)#1
Merged
Conversation
- ci.yml: on push(master)/PR, run pytest + smoke + the ChatGPT instructions build (8000-char guard) across Python 3.10/3.11/3.12. All offline — the live-API regression runner stays manual (needs FINMIND_TOKEN). - publish.yml: pushing a version tag (vX.Y.Z) builds with `uv build`, runs `twine check`, then uploads via PyPI Trusted Publishing (OIDC, pypa/gh-action-pypi-publish) — no API token stored. Guards that the pushed tag matches the pyproject version. Also runnable via workflow_dispatch. One-time PyPI-side setup (documented in publish.yml header): add a pending trusted publisher (project finmind-mcp, repo FinMind/FinMind-MCP, workflow publish.yml, environment pypi) + create the `pypi` GitHub environment. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
內容
新增兩個 GitHub Actions workflow:
ci.yml— 持續整合push 到 master / 開 PR 時,在 Python 3.10/3.11/3.12 上跑:
pytest+smoke.py+chatgpt/build_instructions.py(順便當 8000 字上限的守門)。全部離線。(
regression/runner.py會打 live API、需FINMIND_TOKEN,所以不放 CI,發版前人工跑。)publish.yml— 自動發佈 PyPI(推 tag 觸發)推一個版本 tag(
vX.Y.Z)就自動uv build→twine check→ 上傳 PyPI。用 PyPI Trusted Publishing(OIDC),pypa/gh-action-pypi-publish,不存任何 API token。會檢查「推的 tag 要跟pyproject.toml的 version 一致」,不一致就擋下。finmind-mcp· OwnerFinMind· RepoFinMind-MCP· Workflowpublish.yml· Environmentpypipypi的 environment(名稱要跟 PyPI 設定一致)。之後的發版流程
🤖 Generated with Claude Code