-
Notifications
You must be signed in to change notification settings - Fork 0
Document tag-driven releases and Control Tower roadmap #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,12 @@ | ||
| name: publish-pypi | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
| push: | ||
| tags: | ||
| - "v*" | ||
|
|
||
| permissions: | ||
| contents: read | ||
| contents: write | ||
|
|
||
| jobs: | ||
| build: | ||
|
|
@@ -52,9 +50,58 @@ jobs: | |
| - name: Publish to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
|
||
| publish-mcp-registry: | ||
| create-github-release: | ||
| runs-on: ubuntu-latest | ||
| needs: publish-pypi | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a pushed tag lacks the exact AGENTS.md reference: AGENTS.md:L170-L179 Useful? React with 👍 / 👎. |
||
| steps: | ||
| - uses: actions/checkout@v7 | ||
|
|
||
| - name: Extract changelog section | ||
| env: | ||
| RELEASE_TAG: ${{ github.ref_name }} | ||
| run: | | ||
| python - <<'PY' | ||
| from pathlib import Path | ||
| import os | ||
|
|
||
| tag = os.environ["RELEASE_TAG"] | ||
| version = tag.removeprefix("v") | ||
| changelog = Path("CHANGELOG.md").read_text(encoding="utf-8").splitlines() | ||
|
|
||
| start = None | ||
| end = None | ||
| heading = f"## {version} - " | ||
| for index, line in enumerate(changelog): | ||
| if line.startswith(heading): | ||
| start = index | ||
| continue | ||
| if start is not None and line.startswith("## "): | ||
| end = index | ||
| break | ||
|
|
||
| if start is None: | ||
| raise SystemExit( | ||
| f"Could not find CHANGELOG.md section for version {version}." | ||
| ) | ||
|
|
||
| if end is None: | ||
| end = len(changelog) | ||
|
|
||
| section = "\n".join(changelog[start:end]).strip() + "\n" | ||
| Path("release-notes.md").write_text(section, encoding="utf-8") | ||
| PY | ||
|
|
||
| - name: Create GitHub release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| tag_name: ${{ github.ref_name }} | ||
| name: ${{ github.ref_name }} | ||
| body_path: release-notes.md | ||
| generate_release_notes: false | ||
|
|
||
| publish-mcp-registry: | ||
| runs-on: ubuntu-latest | ||
| needs: create-github-release | ||
| permissions: | ||
| id-token: write # required for GitHub OIDC authentication with MCP Registry | ||
| contents: read | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This workflow-level grant is inherited by the
buildjob, so checkout, dependency setup, build commands, and third-party actions all run with a token capable of modifying repository contents even though onlycreate-github-releaseneeds that privilege. A compromised dependency or action during a tag build could therefore alter tags or repository content; keep workflow/build access atcontents: readand grantcontents: writeonly on the release-creation job.Useful? React with 👍 / 👎.