-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (29 loc) · 954 Bytes
/
publish.yml
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
# This workflow will upload a Python Package to PyPI when a version tag is pushed
name: "Publish Python Package to PyPI"
on:
release:
types: ["published"]
push:
tags:
- 'v[0-9]+.[0-9]+*' # Push events to matching v1.0, v20.15.10 tags
jobs:
run:
name: "Build and publish release"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Print the installed version
run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}"
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
- name: Build
run: uv build
- name: Publish
run: uv publish --check-url https://pypi.org/simple/ --token ${{ secrets.PYPI_TOKEN }}