These steps are required once before the first release.
Go to Settings → Environments in the GitHub repository and create the environment:
pypi
On pypi.org:
- Go to Your projects → Manage → Publishing
- Add a new pending publisher (if the project doesn't exist on PyPI yet):
- PyPI project name:
pydantic-jsonschema - Owner:
Danipulok - Repository:
pydantic-jsonschema - Workflow name:
release.yml - Environment name:
pypi
- PyPI project name:
Before the first public release:
- Run
just all— format, lint, tests, docs build must all pass. - Verify
docs/changelog.mdcontains the target release section, for example## [X.Y.Z]. - Confirm PyPI trusted publisher is configured (see above).
- Confirm GitHub environment
pypiexists.
The changelog lands on main through a regular PR; the tag is pushed as a separate ref, so
main is never pushed directly. Pass the version without the leading v in all commands.
-
Open the release PR:
just release-pr X.Y.Z
This creates branch
release/X.Y.Zfrom up-to-datemain, generatesdocs/changelog.md, commits it aschore(version): update to X.Y.Z, and opens the PR viagh. -
Review and squash-merge the release PR (keep the PR title as the commit message).
-
Tag the merged commit:
git switch main && git pull just release X.Y.ZThis verifies you are on
mainmatchingorigin/main, validatesdocs/changelog.md, creates tagvX.Y.Z, and pushes only the tag. -
The
release.ymlworkflow will automatically:- Build sdist and wheel (version derived from git tag via
hatch-vcs). - Publish to PyPI.
- Generate release notes via
git-cliff. - Create a GitHub Release with the generated notes and distribution artifacts.
- Deploy versioned documentation to GitHub Pages.
- Build sdist and wheel (version derived from git tag via
The release.yml workflow creates the GitHub Release and deploys docs automatically.
If the workflow fails after PyPI publish (e.g. a broken action SHA), do it manually:
-
Generate release notes:
uv run git-cliff vPREVIOUS..vX.Y.Z --strip all -o /tmp/release-notes.md
-
Create the GitHub Release:
gh release create vX.Y.Z --title "vX.Y.Z" --notes-file /tmp/release-notes.md dist/*
-
Deploy documentation:
just docs-deploy-version X.Y.Z just docs-alias X.Y.Z latest just docs-set-default latest
Version is determined automatically from git tags by hatch-vcs. There is no hardcoded version in
pyproject.toml.
- Tagged commit
v1.2.3→ version1.2.3. - Untagged commit after
v1.2.3→ version1.2.4.dev1+gabcdef. - No tags at all → version
0.0.0.dev1+gabcdef.
This project follows Semantic Versioning:
- MAJOR (1.0.0): Breaking changes.
- MINOR (0.1.0): New features, backwards compatible.
- PATCH (0.0.1): Bug fixes, backwards compatible.
Documentation uses mike for version management.
To redeploy documentation manually:
just docs-deploy-version X.Y.Z
just docs-set-default X.Y.Z