Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ on:
- '[0-9]+.[0-9]+.[0-9]+' # stable: 2.7.2
- '[0-9]+.[0-9]+.[0-9]+[a-z]+[0-9]+' # pre-release: 2.0.0rc1, 4.0.0a2

# Needed for softprops/action-gh-release to create the GitHub Release.
# contents: write -> create the GitHub Release; id-token: write -> OIDC for PyPI Trusted Publishing.
permissions:
contents: write
id-token: write

jobs:
release:
runs-on: ubuntu-latest
environment: pypi # scopes the PyPI Trusted Publisher; hook for approval rules
steps:
- uses: actions/checkout@v6
- uses: extractions/setup-just@v4
Expand All @@ -26,9 +28,9 @@ jobs:
# PyPI is irreversible, so it runs FIRST: if it fails the job stops and no
# GitHub Release is created advertising a version that never reached PyPI.
# `just publish` derives the version from $GITHUB_REF_NAME (the tag name).
# Auth via PyPI Trusted Publishing (OIDC); no PYPI_TOKEN. Needs a Trusted
# Publisher on the db-retry PyPI project (env: pypi, workflow: release.yml).
- run: just publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

# Description source: planning/releases/<tag>.md if present (verbatim, no
# auto-changelog appended); otherwise GitHub's generated notes. A tag with
Expand Down
3 changes: 2 additions & 1 deletion Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ index:
check-planning:
uv run python planning/index.py --check

# Auth via PyPI Trusted Publishing (OIDC); uv publish auto-detects the CI id-token.
publish:
rm -rf dist
uv version $GITHUB_REF_NAME
uv build
uv publish --token $PYPI_TOKEN
uv publish
11 changes: 11 additions & 0 deletions planning/releases/0.5.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# db-retry 0.5.1 — release pipeline on PyPI Trusted Publishing

No library changes. The package is identical to 0.5.0; this release exercises the new publish path end-to-end.

## CI

- Releases now authenticate to PyPI via **Trusted Publishing (OIDC)** instead of a long-lived `PYPI_TOKEN` secret. `uv publish` auto-detects the GitHub Actions id-token; the release job runs under a `pypi` environment that scopes the trusted publisher (#29).

## Downstream

No action required. Nothing about the installed package changes.