-
Notifications
You must be signed in to change notification settings - Fork 11
38 lines (36 loc) · 1.29 KB
/
Copy pathrelease.yml
File metadata and controls
38 lines (36 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Release
on:
push:
tags:
- test-v*
release:
types:
- "published"
jobs:
publish:
strategy:
matrix:
environment:
- pypi
- testpypi
exclude:
- environment: ${{ !startsWith(github.ref_name, 'v') && 'pypi' }}
- environment: ${{ contains(github.ref_name, 'test') && 'pypi' }}
- environment: ${{ github.event_name == 'release' && 'testpypi' }}
name: Publish to PyPI ${{ matrix.environment }} from ${{ github.ref_name }}
runs-on: ubuntu-latest
environment:
name: ${{ matrix.environment }}
permissions:
id-token: write
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- run: uv build
- name: Smoke test (wheel)
run: uv run --isolated --no-project -p 3.13 --with dist/*.whl --with pytest pytest tests/test_base.py
- name: Smoke test (source distribution)
run: uv run --isolated --no-project -p 3.13 --with dist/*.tar.gz --with pytest pytest tests/test_base.py
- run: uv publish --trusted-publishing always ${{ matrix.environment == 'testpypi' && '--index testpypi' || '' }}