-
Notifications
You must be signed in to change notification settings - Fork 10
42 lines (40 loc) · 965 Bytes
/
python-publish.yml
File metadata and controls
42 lines (40 loc) · 965 Bytes
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
39
40
41
42
name: Publish Python Package
on:
release:
types: [created]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Run tests
env:
GITHUB_TOKEN: ${{ secrets.TESTS_GITHUB_TOKEN }}
run: |
uv run pytest
deploy:
runs-on: ubuntu-latest
needs: [test]
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: astral-sh/setup-uv@v6
with:
python-version: '3.13'
enable-cache: true
- name: Build
run: |
uv build
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1