-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add PyPI publish workflow, release docs, and project metadata #60
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
779262d
feat: add PyPI publish workflow, release docs, and project metadata (…
dgenio 168731c
fix: add contents:read permission to publish job
dgenio 7a58dcf
docs: clarify PyPI vs import name in README Quickstart
dgenio ed8a829
fix: pin GitHub Actions to commit SHAs in publish workflow
dgenio eb1ab12
docs: add tagging safety note in RELEASE.md step 3
dgenio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ on: | |
| branches: ["main", "copilot/**"] | ||
| pull_request: | ||
| branches: ["main"] | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| test: | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: Publish to PyPI | ||
|
|
||
| on: | ||
| push: | ||
| tags: ["v*"] | ||
|
|
||
| jobs: | ||
| ci: | ||
| name: "CI gate" | ||
| uses: ./.github/workflows/ci.yml | ||
|
|
||
| publish: | ||
| name: "Build & publish" | ||
| needs: ci | ||
| runs-on: ubuntu-latest | ||
| environment: pypi | ||
| permissions: | ||
| contents: read # required for actions/checkout | ||
| id-token: write # required for Trusted Publisher (OIDC) | ||
| steps: | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install build tools | ||
| run: pip install build | ||
|
|
||
| - name: Build sdist and wheel | ||
| run: python -m build | ||
|
|
||
| - name: Publish to PyPI | ||
| uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 | ||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| # Release Process | ||
|
|
||
| This document describes how to publish a new version of `weaver-kernel` to PyPI. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Push access to the `dgenio/agent-kernel` repository. | ||
| - Trusted Publisher configured on PyPI for this repository | ||
| (see [Trusted Publisher setup](#trusted-publisher-setup) below). | ||
|
|
||
| ## Steps | ||
|
|
||
| ### 1. Bump the version | ||
|
|
||
| Update the `version` field in `pyproject.toml`: | ||
|
|
||
| ```toml | ||
| [project] | ||
| version = "0.3.0" | ||
| ``` | ||
|
|
||
| ### 2. Update the changelog | ||
|
|
||
| Add a new section to `CHANGELOG.md` under `## [Unreleased]`, then rename it | ||
| to the new version with today's date: | ||
|
|
||
| ```markdown | ||
| ## [0.3.0] - 2026-04-01 | ||
|
|
||
| ### Added | ||
| - ... | ||
|
|
||
| ### Fixed | ||
| - ... | ||
| ``` | ||
|
|
||
| ### 3. Commit and tag | ||
|
|
||
| > **Important:** Tag only on `main` after the release commit is merged. | ||
| > The publish workflow triggers on any `v*` tag push — tagging a non-main | ||
| > commit would publish unreleased code. | ||
|
|
||
| ```bash | ||
| git add pyproject.toml CHANGELOG.md | ||
| git commit -m "release: v0.3.0" | ||
| git tag v0.3.0 | ||
| git push origin main --tags | ||
| ``` | ||
|
|
||
| ### 4. CI takes over | ||
|
|
||
| Pushing the `v*` tag triggers `.github/workflows/publish.yml`, which: | ||
|
|
||
| 1. Runs the full CI suite (`make ci` equivalent) as a gate. | ||
| 2. Builds the sdist and wheel with `python -m build`. | ||
| 3. Publishes to PyPI using Trusted Publisher (OIDC — no API tokens stored). | ||
|
|
||
| Monitor the workflow run at: | ||
| <https://github.com/dgenio/agent-kernel/actions/workflows/publish.yml> | ||
|
|
||
| ### 5. Verify | ||
|
|
||
| ```bash | ||
| pip install weaver-kernel==0.3.0 | ||
| ``` | ||
|
|
||
| ## Trusted Publisher Setup | ||
|
|
||
| Trusted Publisher uses OpenID Connect (OIDC) so the GitHub Actions workflow can | ||
| publish to PyPI without storing API tokens as secrets. | ||
|
|
||
| To configure it (one-time setup): | ||
|
|
||
| 1. Go to <https://pypi.org/manage/project/weaver-kernel/settings/publishing/>. | ||
| 2. Add a new publisher: | ||
| - **Owner**: `dgenio` | ||
| - **Repository**: `agent-kernel` | ||
| - **Workflow name**: `publish.yml` | ||
| - **Environment**: `pypi` | ||
| 3. Save. The `publish.yml` workflow will now authenticate automatically. | ||
|
|
||
| ## Version scheme | ||
|
|
||
| This project follows [Semantic Versioning](https://semver.org/): | ||
|
|
||
| - **PATCH** (0.2.x): bug fixes, documentation updates. | ||
| - **MINOR** (0.x.0): new features, backward-compatible changes. | ||
| - **MAJOR** (x.0.0): breaking API changes. |
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
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.
Uh oh!
There was an error while loading. Please reload this page.