Skip to content

Commit 3345f32

Browse files
committed
Add PyPI trusted-publishing workflow; cap inspect-ai, enrich metadata
Release workflow publishes via PyPI Trusted Publishing (OIDC, no stored token); a build + twine check job gates the publish job, which runs in the 'pypi' environment and triggers only on a published GitHub Release. pyproject caps inspect-ai <0.4 (pre-1.0 churn) and adds classifiers, keywords, project URLs.
1 parent a8b29fa commit 3345f32

2 files changed

Lines changed: 72 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: publish
2+
3+
# Publishes to PyPI via Trusted Publishing (OIDC) — no API token is stored in
4+
# the repo or in Actions secrets. Register the pending publisher once on PyPI
5+
# (Project → Publishing): owner CTWalk, repo decision-contract-audit,
6+
# workflow publish.yml, environment pypi.
7+
#
8+
# Runs only when a GitHub Release is published (or manually via workflow_dispatch),
9+
# never on an ordinary push. The build job validates the distribution before the
10+
# publish job runs, and publish is gated on the `pypi` environment so a required
11+
# reviewer can approve the upload.
12+
13+
on:
14+
release:
15+
types: [published]
16+
workflow_dispatch:
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-python@v5
24+
with:
25+
python-version: "3.12"
26+
- run: python -m pip install --upgrade build twine
27+
- run: python -m build
28+
# Dry run / safety gate: validate metadata + README rendering. Fails the
29+
# job — and therefore blocks publish — on any problem.
30+
- run: python -m twine check dist/*
31+
- uses: actions/upload-artifact@v4
32+
with:
33+
name: dist
34+
path: dist/
35+
36+
publish:
37+
needs: build
38+
runs-on: ubuntu-latest
39+
environment: pypi
40+
permissions:
41+
id-token: write # OIDC token for PyPI Trusted Publishing; no stored secret
42+
steps:
43+
- uses: actions/download-artifact@v4
44+
with:
45+
name: dist
46+
path: dist/
47+
- uses: pypa/gh-action-pypi-publish@release/v1

pyproject.toml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,34 @@ readme = "README.md"
1010
license = "Apache-2.0"
1111
license-files = ["LICENSE", "NOTICE"]
1212
requires-python = ">=3.10"
13-
dependencies = ["inspect-ai>=0.3.248"]
13+
# Upper cap: inspect-ai is pre-1.0 and its scorer/solver API still churns, so a
14+
# minor bump can break installs. Relax when a tested newer floor is verified.
15+
dependencies = ["inspect-ai>=0.3.248,<0.4"]
16+
keywords = [
17+
"inspect-ai",
18+
"llm",
19+
"llm-evaluation",
20+
"reliability",
21+
"contract-testing",
22+
"metamorphic-testing",
23+
"test-oracles",
24+
]
25+
classifiers = [
26+
"Development Status :: 4 - Beta",
27+
"Intended Audience :: Developers",
28+
"Programming Language :: Python :: 3",
29+
"Programming Language :: Python :: 3.10",
30+
"Programming Language :: Python :: 3.11",
31+
"Programming Language :: Python :: 3.12",
32+
"Topic :: Software Development :: Testing",
33+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
34+
"Operating System :: OS Independent",
35+
]
1436

1537
[project.urls]
38+
Homepage = "https://github.com/CTWalk/decision-contract-audit"
1639
Repository = "https://github.com/CTWalk/decision-contract-audit"
40+
Issues = "https://github.com/CTWalk/decision-contract-audit/issues"
1741

1842
[tool.setuptools]
1943
packages = ["decision_contracts"]

0 commit comments

Comments
 (0)