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
37 changes: 33 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
enable-cache: true
- run: uv sync --extra dev
Expand All @@ -32,10 +32,39 @@ jobs:
python-version: ["3.10", "3.13"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- run: uv sync --extra dev
- run: uv run pytest

package:
# The release workflow hands its wheel and sdist from one job to the next as an
# artifact, and nothing exercises that path until a tag is pushed. This job
# does the same round trip on every change, so a broken build or an artifact
# action that unpacks somewhere else (dist/dist/) fails here, not mid-release.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
enable-cache: false
- run: uv build
- uses: actions/upload-artifact@v7
with:
name: dist-check
path: dist/
retention-days: 1

package-roundtrip:
needs: package
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v8
with:
name: dist-check
path: dist/
- name: The wheel and the sdist land directly in dist/
run: ls dist/*.whl dist/*.tar.gz
19 changes: 12 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,22 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- uses: actions/checkout@v7
# No cache here: what this job builds goes to PyPI, so it starts from nothing
# rather than from a cache another run could have written (cache poisoning).
# setup-uv v10's `auto` default already skips the cache on a tag push; this
# says so explicitly, so a later default change cannot turn it back on.
# setup-uv publishes no major tag since v8, hence the pinned commit.
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
enable-cache: true
enable-cache: false
# A tag whose version has no CHANGELOG section stops here, before PyPI: a
# release is not re-publishable, its notes must exist first.
- name: The CHANGELOG has this version's section
if: startsWith(github.ref, 'refs/tags/v')
run: python3 scripts/release_notes.py "${GITHUB_REF_NAME#v}" > /dev/null
- run: uv build
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: dist
path: dist/
Expand All @@ -34,7 +39,7 @@ jobs:
permissions:
id-token: write # required for Trusted Publishing
steps:
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v8
with:
name: dist
path: dist/
Expand All @@ -47,8 +52,8 @@ jobs:
permissions:
contents: write # to create the release
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- uses: actions/checkout@v7
- uses: actions/download-artifact@v8
with:
name: dist
path: dist/
Expand Down
Loading