Releasing
Releases follow Semantic Versioning. Record changes in
docs/releases.md and use the checklist below to publish them. Publishing uses
PyPI Trusted Publishing, which needs a one-time publisher on the PyPI project:
owner netbox-community, repository netbox-scripts, workflow release.yml,
environment pypi.
Checklist
Run commands from the repository root. Replace X.Y.Z with the version being
released throughout the checklist.
-
Check readiness. Confirm CI passes on the default branch and the release's code and documentation changes are complete.
-
Update the change log. Add a
## vX.Y.Z (YYYY-MM-DD)section above the previous release indocs/releases.md, separated by---. Group entries under### Enhancementsand### Bug Fixes, using* [#<issue>](<url>) - <summary>. The first release lists only* Initial release, without subsections. An alpha release adds a warning that states its upgrade limits and links the open bug reports. -
Set the version. Update
version = "X.Y.Z"inpyproject.tomland__version__ = "X.Y.Z"innetbox_scripts/__init__.py. Both must match the version in the release tag. The workflow refuses to publish if they differ. Commit the release changes aschore(release): Release vX.Y.Z. -
Check the package contents. Run:
pre-commit run --hook-stage manual check-manifestThis compares tracked files with the source distribution and reports missing or unexpected files.
-
Tag the release commit. Create an annotated tag and push it with the release commit:
git tag -a vX.Y.Z -m "Release vX.Y.Z" git push origin main vX.Y.Z -
Publish the GitHub release. Draft it from the new tag, compare the generated notes with
docs/releases.md, make any corrections and publish. -
Check the publishing workflow. Publishing the release triggers
.github/workflows/release.yml. It builds the wheel and source distribution, runstwine checkand publishes to PyPI using this repository's Trusted Publisher. Check that the run succeeds, including package validation and the OIDC token exchange. -
Verify the published package. Check the version on https://pypi.org/project/netbox-scripts/ and confirm that a fresh
pip install netbox-scriptsselects the new version.
Hotfix process
For an urgent fix to a published version, branch from its release tag and follow
the same preparation, packaging and publishing checks. Push the hotfix branch
and tag instead of using the checklist's main push command.
This example releases 1.2.4 from v1.2.3. Replace both versions with the actual
release numbers.
git switch -c hotfix/1.2.4 v1.2.3
Apply the fix, update the change log and both version declarations, and commit the changes. After the checks pass, tag and push the hotfix:
git tag -a v1.2.4 -m "Release 1.2.4"
git push origin hotfix/1.2.4 v1.2.4
Continue with the GitHub release and package-verification steps. Merge the hotfix branch into the default branch after publication.
See also
- Contributing for the development workflow and review requirements.