mirror of
https://github.com/yashshah9/agentbox.git
synced 2026-11-18 18:03:44 +00:00
ci: add OIDC PyPI publish workflow
Trusted-publishing workflow on release/workflow_dispatch, plus docs/PUBLISH.md.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
name: Publish to PyPI
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
environment: pypi
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.12"
|
||||
- name: Build
|
||||
run: |
|
||||
pip install -q build
|
||||
python -m build
|
||||
- name: Publish
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
# Publishing to PyPI
|
||||
|
||||
API-token upload is currently blocked (old token 403). Prefer **Trusted Publishing** (OIDC).
|
||||
|
||||
## One-time setup (per package on pypi.org)
|
||||
|
||||
For each project (`duckcheck`, `embedsync`, `agentbox-sandbox`, `mcp-tool-evals`, `pytest-llm-vcr`):
|
||||
|
||||
1. PyPI → Project → Publishing → **Add a new pending publisher**
|
||||
2. Owner: `yashshah9`
|
||||
3. Repo: matching GitHub repo name
|
||||
4. Workflow: `publish.yml`
|
||||
5. Environment: `pypi`
|
||||
|
||||
Also create a GitHub Environment named `pypi` on each repo (Settings → Environments).
|
||||
|
||||
## Publish a release
|
||||
|
||||
```bash
|
||||
gh release create vX.Y.Z --generate-notes
|
||||
# or: Actions → "Publish to PyPI" → Run workflow
|
||||
```
|
||||
|
||||
## Manual token upload (fallback)
|
||||
|
||||
```bash
|
||||
export TWINE_USERNAME=__token__
|
||||
export TWINE_PASSWORD=pypi-... # fresh token
|
||||
cd <repo> && python -m build && twine upload dist/*
|
||||
```
|
||||
Reference in New Issue
Block a user