@@ -5,14 +5,14 @@ This guide will help you quickly set up and publish your packages to PyPI.
55## Prerequisites
66
77- GitHub repository with the workflows
8- - PyPI account (https://pypi.org/account/register/ )
9- - TestPyPI account (https://test.pypi.org/account/register/ ) - optional but recommended
8+ - PyPI account (< https://pypi.org/account/register/ > )
9+ - TestPyPI account (< https://test.pypi.org/account/register/ > ) - optional but recommended
1010
1111## Step 1: Get PyPI Tokens
1212
1313### For PyPI
1414
15- 1 . Visit https://pypi.org/manage/account/token/
15+ 1 . Visit < https://pypi.org/manage/account/token/ >
16162 . Click "Add API token"
17173 . Fill in:
1818 - Token name: ` GitHub Actions - NetDriver `
@@ -22,7 +22,7 @@ This guide will help you quickly set up and publish your packages to PyPI.
2222
2323### For TestPyPI (Recommended for testing)
2424
25- 1 . Visit https://test.pypi.org/manage/account/token/
25+ 1 . Visit < https://test.pypi.org/manage/account/token/ >
26262 . Follow same steps as above
27273 . Copy the token
2828
@@ -41,29 +41,25 @@ This guide will help you quickly set up and publish your packages to PyPI.
4141 - Name: ` TEST_PYPI_API_TOKEN `
4242 - Secret: Paste your TestPyPI token
4343
44- ## Step 3: Choose Your Workflow
44+ ## Step 3: Build CI Docker Image
4545
46- ### Option A: Standard Workflow (Recommended for first-time)
46+ The ` publish-pypi.yml ` workflow uses a pre-built Docker image for faster execution.
4747
48- Use ` publish-pypi.yml ` - installs everything on- the-fly
48+ ** Build the image: **
4949
50- ** No additional setup needed!**
51-
52- ### Option B: Docker-based Workflow (Faster)
53-
54- Use ` publish-pypi-docker.yml ` - uses pre-built image
50+ 1 . Go to ** Actions** → ** "Build CI Image"**
51+ 2 . Click ** "Run workflow"**
52+ 3 . Select branch: ` master `
53+ 4 . Click ** "Run workflow"**
5554
56- ** Additional setup :**
55+ ** Or build locally :**
5756
58- 1 . Build the CI image first:
59- ``` bash
60- # Go to Actions → "Build CI Image" → Run workflow
61- # Or build locally and push
62- docker build -t ghcr.io/opensecflow/netdriver/ci:latest -f .github/Dockerfile.ci .
63- docker push ghcr.io/opensecflow/netdriver/ci:latest
64- ```
57+ ``` bash
58+ docker build -t ghcr.io/opensecflow/netdriver/python-poetry:3.12 -f .github/Dockerfile.ci .
59+ docker push ghcr.io/opensecflow/netdriver/python-poetry:3.12
60+ ```
6561
66- 2 . Update your workflow to use the image (already configured in ` publish-pypi-docker.yml ` )
62+ ** Note ** : This only needs to be done once. The image will be cached and reused.
6763
6864## Step 4: Test Publishing (Recommended)
6965
@@ -82,10 +78,11 @@ Before publishing to production PyPI, test with TestPyPI:
8278### Verify on TestPyPI
8379
84801 . Check your packages:
85- - https://test.pypi.org/project/netdriver-agent/
86- - https://test.pypi.org/project/netdriver-simunet/
81+ - < https://test.pypi.org/project/netdriver-agent/ >
82+ - < https://test.pypi.org/project/netdriver-simunet/ >
8783
88842 . Test installation:
85+
8986 ``` bash
9087 pip install --index-url https://test.pypi.org/simple/ netdriver-agent
9188 ```
@@ -114,12 +111,15 @@ git add projects/*/pyproject.toml
114111git commit -m " chore: bump version to 0.3.1"
115112git push
116113
117- # 3. Create and push tag
118- git tag v0 .3.1
119- git push origin v0 .3.1
114+ # 3. Create and push tag (without 'v' prefix)
115+ git tag 0 .3.1
116+ git push origin 0 .3.1
120117```
121118
119+ ** Note** : Both ` 0.3.1 ` and ` v0.3.1 ` tag formats are supported.
120+
122121The ` release.yml ` workflow will automatically:
122+
123123- ✅ Create a GitHub Release
124124- ✅ Build both packages
125125- ✅ Publish to PyPI
@@ -128,10 +128,11 @@ The `release.yml` workflow will automatically:
128128## Step 6: Verify Publication
129129
1301301 . Check on PyPI:
131- - https://pypi.org/project/netdriver-agent/
132- - https://pypi.org/project/netdriver-simunet/
131+ - < https://pypi.org/project/netdriver-agent/ >
132+ - < https://pypi.org/project/netdriver-simunet/ >
133133
1341342 . Test installation:
135+
135136 ``` bash
136137 pip install netdriver-agent
137138 pip install netdriver-simunet
@@ -160,11 +161,15 @@ poetry version -P projects/simunet patch
160161# Then rebuild and publish
161162```
162163
163- ### Workflow fails with "Poetry not found"
164+ ### Workflow fails with "Poetry not found" or image pull error
164165
165- ** Solution:**
166- - If using standard workflow: Check Poetry installation step
167- - If using Docker workflow: Build the CI image first
166+ ** Solution:** Build the CI Docker image first
167+
168+ ``` bash
169+ # Go to Actions → "Build CI Image" → Run workflow
170+ ```
171+
172+ Or check the image name matches: ` ghcr.io/opensecflow/netdriver/python-poetry:3.12 `
168173
169174### Package shows as "0 B" or malformed
170175
@@ -179,11 +184,13 @@ unzip -l projects/agent/dist/netdriver_agent-*.whl
179184### Version Management
180185
181186✅ ** DO:**
187+
182188- Keep version numbers in sync across ` projects/agent/pyproject.toml ` and ` projects/simunet/pyproject.toml `
183189- Use semantic versioning: ` MAJOR.MINOR.PATCH `
184190- Test on TestPyPI before production
185191
186192❌ ** DON'T:**
193+
187194- Publish the same version twice
188195- Skip testing on TestPyPI
189196- Use local version identifiers for production (e.g., ` 0.3.0+local ` )
@@ -214,6 +221,6 @@ unzip -l projects/agent/dist/netdriver_agent-*.whl
214221## Need Help?
215222
216223- 📖 Full documentation: ` .github/workflows/README.md `
217- - 🐛 Report issues: https://github.com/OpenSecFlow/netdriver/issues
218- - 📝 PyPI Help: https://pypi.org/help/
219- - 🎯 GitHub Actions: https://docs.github.com/en/actions
224+ - 🐛 Report issues: < https://github.com/OpenSecFlow/netdriver/issues >
225+ - 📝 PyPI Help: < https://pypi.org/help/ >
226+ - 🎯 GitHub Actions: < https://docs.github.com/en/actions >
0 commit comments