Automated via .github/workflows/release.yml: push a tag vX.Y.Z that matches version in pyproject.toml and __version__ in src/adk_aerospike/__init__.py.
Use a PyPI account that can create projects for the Aerospike org (or register a pending publisher before the project exists).
- Sign in at https://pypi.org/manage/account/publishing/
- Add a new pending publisher (first release) or Add a new publisher (after the project exists).
- Set:
Field Value PyPI project name adk-aerospikeOwner aerospike-communityRepository name adk-aerospikeWorkflow name release.ymlEnvironment name pypi
The workflow filename is the basename only (release.yml), not .github/workflows/release.yml.
After the first successful publish, the pending publisher becomes a normal project publisher.
In https://github.com/aerospike-community/adk-aerospike/settings/environments:
- New environment named
pypi(must match PyPI’s environment name). - Recommended protection rules:
- Required reviewers — one or two release approvers.
- Deployment branches — only
main(tags are evaluated against the commit they point at; restricting branches still limits who can trigger protected workflows from non-standard refs).
- Under Environment secrets — none needed for trusted publishing (OIDC replaces API tokens).
- Register at https://test.pypi.org/
- Add another trusted publisher with the same owner/repo/workflow, or use a separate
testpypiworkflow and environment. - Publish manually once, then smoke-test:
pip install -i https://test.pypi.org/simple/ adk-aerospike
-
Bump version in both
pyproject.tomlandsrc/adk_aerospike/__init__.py. -
Update
CHANGELOG.md. -
Merge to
main. -
Tag the current
mainHEAD (after your release PR is merged) and push:git checkout main && git pull git tag v0.0.2 git push origin v0.0.2If a tag already exists on an older commit, delete it locally and on GitHub before re-tagging:
git tag -d v0.0.2 git push origin :refs/tags/v0.0.2 git tag v0.0.2 && git push origin v0.0.2 -
In GitHub Actions, open the Release workflow run; approve the pypi environment deployment if reviewers are configured.
-
Confirm https://pypi.org/project/adk-aerospike/ shows the new version.
-
Smoke test from a clean venv:
pip install "adk-aerospike==0.0.1" python -c "import adk_aerospike; print(adk_aerospike.__version__)"
-
Optional: create a GitHub Release with notes from
CHANGELOG.md:gh release create v0.0.1 --notes-file CHANGELOG.md
python -m pip install build
python -m build
python scripts/validate_pypi_metadata.py
pip install dist/adk_aerospike-*.whlBenchmark harness deps are not in the PyPI package — install with pip install -r benchmarks/requirements.txt.
| Symptom | Likely cause |
|---|---|
| Publish job fails immediately on OIDC | Trusted publisher owner/repo/workflow/environment mismatch |
| “File already exists” on upload | Version not bumped; PyPI versions are immutable |
| Tag/job fails at version check | Tag v0.0.2 but pyproject.toml still 0.0.1 |
400 Can't have direct dependency on upload |
Tag points at a commit before the fix, or [benchmark] / git URL still in pyproject.toml; run python scripts/validate_pypi_metadata.py after python -m build |
| Validate step fails on release | Wheel still embeds VCS deps — remove optional extras with git URLs from pyproject.toml |
| Environment never appears | Workflow must reference environment: name: pypi on the publish job |