Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish

on:
push:
tags: ["v*"]

permissions:
contents: read

jobs:
build:
name: Build distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

- uses: astral-sh/setup-uv@v10.4.0
with:
version: "0.11.14"

- name: Build sdist and wheel
run: uv build

- name: Check package metadata
run: uvx twine check dist/*

- uses: actions/upload-artifact@v7.0.2
with:
name: dist
path: dist/

publish:
name: Publish to PyPI
needs: build
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v8.0.2
with:
name: dist
path: dist/

- uses: pypa/gh-action-pypi-publish@v1.14.3
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ All notable changes to this project are documented here. The format follows
- Require `mcp>=1,<2`; the previous `<2` bound allowed an incompatible pre-1.0 MCP release to be selected.
- CI now uses `actions/checkout@v7` and `actions/setup-python@v7`, and tests Python 3.11–3.14.
- Added `uv.lock` and switched CI and development setup to locked installs (`uv sync --locked --extra dev` / `uv sync --extra dev`).
- Added a tag-triggered PyPI publishing workflow using Trusted Publishing, with the release checklist in `docs/releasing.md`.

## [0.4.0] — 2026-11-25

Expand Down
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ CI runs exactly these on Python 3.11 and 3.12 for every push to `main` and every
set per event.
4. **Evidence is coordinate-level.** Every finding carries a location that a human can open.

## Releasing

See [`docs/releasing.md`](docs/releasing.md) for the version bump, tag, and PyPI publishing steps.

## Pull requests

- Branch from `main`; `main` is the release line.
Expand Down
47 changes: 47 additions & 0 deletions docs/releasing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Releasing

This project publishes from a version tag through `.github/workflows/publish.yml`.

## One-time PyPI setup

The workflow uses PyPI Trusted Publishing, so no API token is stored in GitHub.

1. Create the `aiitg` project on PyPI (or use an existing project).
2. Add a trusted publisher with:
- owner: `sscodeai`
- repository: `aiitg`
- workflow: `publish.yml`
- environment: `pypi`
3. Create a GitHub environment named `pypi` and add protection rules if required by the repository.

## Release checklist

1. Bump the version in both places:
- `pyproject.toml`
- `src/aiitg/_version.py`
2. Move the `[Unreleased]` entries into a dated `[X.Y.Z]` section in `CHANGELOG.md`.
3. Run the gates:
```bash
make test
make lint
make typecheck
uv build
uvx twine check dist/*
```
4. Open a release PR (`chore(release): X.Y.Z`) and merge it to `main`.
5. Create and push the annotated tag:
```bash
git tag -a vX.Y.Z -m "aiitg X.Y.Z — <summary>"
git push github vX.Y.Z
```
6. The `Publish` workflow builds the sdist/wheel and publishes to PyPI via Trusted Publishing.
7. Create the GitHub Release for the tag:
```bash
gh release create vX.Y.Z --repo sscodeai/aiitg --title "aiitg X.Y.Z" --generate-notes
```

## Notes

- `uv.lock` is checked in; run `uv lock` after changing dependencies.
- The publish workflow only runs for tags matching `v*`.
- PyPI publishes are immutable: a version number cannot be reused after upload.
Loading