@@ -34,3 +34,40 @@ make html
3434cd ../
3535open docs/_build/html/index.html
3636```
37+
38+ # Publishing on PyPI
39+
40+ This project is configured to automatically publish to PyPI using GitHub Actions with trusted publishing (OIDC).
41+
42+ ## Setup (One-time configuration)
43+
44+ ### 1. Create PyPI Account and Project
45+
46+ 1 . Create an account on [ PyPI] ( https://pypi.org/ )
47+ 2 . Create a new project or claim your project name
48+
49+ ### 2. Configure Trusted Publishing on PyPI
50+
51+ 1 . Go to your PyPI project settings
52+ 2 . Navigate to "Publishing" → "Add a new publisher"
53+ 3 . Configure the trusted publisher with these details:
54+ - ** PyPI Project Name** : ` template-python ` (or your project name)
55+ - ** Owner** : Your GitHub username/organization
56+ - ** Repository name** : ` template-python `
57+ - ** Workflow name** : ` publish_pypi.yml `
58+ - ** Environment name** : ` pypi `
59+
60+ ### 3. Configure GitHub Environment (Optional but Recommended)
61+
62+ 1 . Go to your GitHub repository → Settings → Environments
63+ 2 . Create an environment named ` pypi `
64+ 3 . Add protection rules:
65+ - Deployment branches: Only ` main ` branch
66+
67+ ## Publishing Process
68+
69+ Once configured, publishing is automatic:
70+
71+ 1 . ** Merge to main branch** : Any push to the ` main ` branch triggers the workflow
72+ 2 . ** Automatic build** : The workflow builds the Python package
73+ 3 . ** Automatic publish** : The package is automatically published to PyPI using trusted publishing
0 commit comments