Skip to content

Commit 7619e10

Browse files
authored
Merge pull request #60 from dgenio/copilot/37-pypi-publish
feat: add PyPI publish workflow, release docs, and project metadata
2 parents e19db7d + eb1ab12 commit 7619e10

6 files changed

Lines changed: 146 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches: ["main", "copilot/**"]
66
pull_request:
77
branches: ["main"]
8+
workflow_call:
89

910
jobs:
1011
test:

.github/workflows/publish.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
7+
jobs:
8+
ci:
9+
name: "CI gate"
10+
uses: ./.github/workflows/ci.yml
11+
12+
publish:
13+
name: "Build & publish"
14+
needs: ci
15+
runs-on: ubuntu-latest
16+
environment: pypi
17+
permissions:
18+
contents: read # required for actions/checkout
19+
id-token: write # required for Trusted Publisher (OIDC)
20+
steps:
21+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
25+
with:
26+
python-version: "3.12"
27+
28+
- name: Install build tools
29+
run: pip install build
30+
31+
- name: Build sdist and wheel
32+
run: python -m build
33+
34+
- name: Publish to PyPI
35+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
- PyPI publish workflow (`.github/workflows/publish.yml`) with Trusted Publisher (OIDC) (#37).
12+
- `RELEASE.md` documenting the full release process.
13+
- `[project.urls]` in `pyproject.toml` (Homepage, Repository, Documentation, Changelog).
14+
- Optional dependency groups: `mcp` and `otel` in `pyproject.toml`.
15+
16+
### Changed
17+
- Renamed PyPI package from `agent-kernel` to `weaver-kernel` to align with Weaver ecosystem.
18+
- Added `workflow_call` trigger to CI workflow so publish workflow can reuse it as a gate.
19+
1020
## [0.2.0] - 2026-03-06
1121

1222
### Added

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ graph LR
3838
## Quickstart
3939

4040
```bash
41-
pip install agent-kernel
41+
pip install weaver-kernel
4242
```
4343

44+
> **Note:** The PyPI package is `weaver-kernel` (Weaver ecosystem), but the Python import remains `agent_kernel`.
45+
4446
```python
4547
import asyncio, os
4648
os.environ["AGENT_KERNEL_SECRET"] = "my-secret"

RELEASE.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Release Process
2+
3+
This document describes how to publish a new version of `weaver-kernel` to PyPI.
4+
5+
## Prerequisites
6+
7+
- Push access to the `dgenio/agent-kernel` repository.
8+
- Trusted Publisher configured on PyPI for this repository
9+
(see [Trusted Publisher setup](#trusted-publisher-setup) below).
10+
11+
## Steps
12+
13+
### 1. Bump the version
14+
15+
Update the `version` field in `pyproject.toml`:
16+
17+
```toml
18+
[project]
19+
version = "0.3.0"
20+
```
21+
22+
### 2. Update the changelog
23+
24+
Add a new section to `CHANGELOG.md` under `## [Unreleased]`, then rename it
25+
to the new version with today's date:
26+
27+
```markdown
28+
## [0.3.0] - 2026-04-01
29+
30+
### Added
31+
- ...
32+
33+
### Fixed
34+
- ...
35+
```
36+
37+
### 3. Commit and tag
38+
39+
> **Important:** Tag only on `main` after the release commit is merged.
40+
> The publish workflow triggers on any `v*` tag push — tagging a non-main
41+
> commit would publish unreleased code.
42+
43+
```bash
44+
git add pyproject.toml CHANGELOG.md
45+
git commit -m "release: v0.3.0"
46+
git tag v0.3.0
47+
git push origin main --tags
48+
```
49+
50+
### 4. CI takes over
51+
52+
Pushing the `v*` tag triggers `.github/workflows/publish.yml`, which:
53+
54+
1. Runs the full CI suite (`make ci` equivalent) as a gate.
55+
2. Builds the sdist and wheel with `python -m build`.
56+
3. Publishes to PyPI using Trusted Publisher (OIDC — no API tokens stored).
57+
58+
Monitor the workflow run at:
59+
<https://github.com/dgenio/agent-kernel/actions/workflows/publish.yml>
60+
61+
### 5. Verify
62+
63+
```bash
64+
pip install weaver-kernel==0.3.0
65+
```
66+
67+
## Trusted Publisher Setup
68+
69+
Trusted Publisher uses OpenID Connect (OIDC) so the GitHub Actions workflow can
70+
publish to PyPI without storing API tokens as secrets.
71+
72+
To configure it (one-time setup):
73+
74+
1. Go to <https://pypi.org/manage/project/weaver-kernel/settings/publishing/>.
75+
2. Add a new publisher:
76+
- **Owner**: `dgenio`
77+
- **Repository**: `agent-kernel`
78+
- **Workflow name**: `publish.yml`
79+
- **Environment**: `pypi`
80+
3. Save. The `publish.yml` workflow will now authenticate automatically.
81+
82+
## Version scheme
83+
84+
This project follows [Semantic Versioning](https://semver.org/):
85+
86+
- **PATCH** (0.2.x): bug fixes, documentation updates.
87+
- **MINOR** (0.x.0): new features, backward-compatible changes.
88+
- **MAJOR** (x.0.0): breaking API changes.

pyproject.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["hatchling"]
33
build-backend = "hatchling.build"
44

55
[project]
6-
name = "agent-kernel"
6+
name = "weaver-kernel"
77
version = "0.2.0"
88
description = "Capability-based security kernel for AI agents operating in large tool ecosystems"
99
readme = "README.md"
@@ -24,6 +24,12 @@ classifiers = [
2424
]
2525
dependencies = ["httpx>=0.27"]
2626

27+
[project.urls]
28+
Homepage = "https://github.com/dgenio/agent-kernel"
29+
Repository = "https://github.com/dgenio/agent-kernel"
30+
Documentation = "https://github.com/dgenio/agent-kernel/tree/main/docs"
31+
Changelog = "https://github.com/dgenio/agent-kernel/blob/main/CHANGELOG.md"
32+
2733
[project.optional-dependencies]
2834
dev = [
2935
"pytest>=8.0",
@@ -33,6 +39,8 @@ dev = [
3339
"mypy>=1.10",
3440
"httpx>=0.27",
3541
]
42+
mcp = ["mcp>=1.0"]
43+
otel = ["opentelemetry-api>=1.20"]
3644

3745
[tool.hatch.build.targets.wheel]
3846
packages = ["src/agent_kernel"]

0 commit comments

Comments
 (0)