Release Process¶
Versioning¶
easylora follows Semantic Versioning:
- Patch (0.1.x): bug fixes, documentation
- Minor (0.x.0): new features, backwards-compatible
- Major (x.0.0): breaking changes
The version is defined once in pyproject.toml and read at runtime via
importlib.metadata.
Release Checklist¶
1. Prepare the release¶
- [ ] All CI checks are green on
main. - [ ] Update
CHANGELOG.md: move items from "Unreleased" to the new version section with today's date. - [ ] Bump
versioninpyproject.toml(e.g.0.1.0->0.1.1). - [ ] Commit:
2. Tag and push¶
3. Automated workflow¶
The release.yml workflow triggers on the tag push and automatically:
- Builds the sdist and wheel.
- Validates with
twine check. - Publishes to PyPI via OIDC trusted publishing (no API tokens).
- Creates a GitHub Release with auto-generated notes and attached dist artifacts.
4. Verify¶
- Check the Actions tab for a successful run.
- Verify the package on PyPI.
- Test installation:
pip install easylora==0.1.1
TestPyPI (Pre-release Testing)¶
You can publish to TestPyPI first to verify the package before a real release.
Publish to TestPyPI¶
- Go to Actions > Release > Run workflow.
- Select
testpypias the target. - Click "Run workflow".
Install from TestPyPI¶
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ easylora
The --extra-index-url flag is needed because easylora's dependencies
(torch, transformers, etc.) are only on the real PyPI.
PyPI Trusted Publishing Setup (One-Time)¶
Trusted publishing uses OpenID Connect (OIDC) so the GitHub Actions workflow can publish to PyPI without any API tokens or secrets stored in the repo.
First-time setup for PyPI¶
- Go to https://pypi.org/manage/account/publishing/.
- Under "Add a new pending publisher" (if the project doesn't exist yet)
or in the project's Publishing settings (if it does):
- PyPI project name:
easylora - Owner:
alexsuw - Repository:
easylora - Workflow name:
release.yml - Environment name:
pypi
- PyPI project name:
- Click "Add".
First-time setup for TestPyPI¶
- Go to https://test.pypi.org/manage/account/publishing/.
- Add a pending publisher with:
- PyPI project name:
easylora - Owner:
alexsuw - Repository:
easylora - Workflow name:
release.yml - Environment name:
testpypi
- PyPI project name:
- Click "Add".
GitHub Environments¶
Create two environments in GitHub repository settings (Settings > Environments):
pypi— optionally add required reviewers for production releases.testpypi— no reviewers needed (for testing).
No secrets need to be added to either environment. OIDC handles authentication automatically.
How it works¶
┌──────────────┐ OIDC token ┌────────────┐
│ GitHub Action │ ──────────────> │ PyPI │
│ release.yml │ (no secrets) │ │
└──────────────┘ └────────────┘
The pypa/gh-action-pypi-publish action requests a short-lived OIDC token
from GitHub, which PyPI validates against the trusted publisher configuration.
No long-lived API tokens are involved.
Manual Steps After First Setup¶
These only need to be done once via the web UI:
- [ ] Create
pypienvironment in GitHub repo settings - [ ] Create
testpypienvironment in GitHub repo settings - [ ] Add pending publisher on PyPI
- [ ] Add pending publisher on TestPyPI
- [ ] Enable GitHub Pages (Settings > Pages > Source: GitHub Actions) — already done
- [ ] Enable GitHub Discussions (Settings > General > Features) — already done