-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (46 loc) · 1.27 KB
/
pypi.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Trigger this workflow manually while choosing a tag in order to publish the package.
#
# This is going to:
# - Build and publish the Python package
#
name: PyPI
on:
workflow_dispatch:
inputs:
dry-run:
type: boolean
default: false
required: false
description: Dry run
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: .python-version
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Cache UV
uses: actions/cache@v3
with:
path: /tmp/.uv-cache
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}
- name: Install UV tools
run: make install-tools
- name: Build Python package
run: uvx --from build pyproject-build --installer uv -s
- name: Publish Python package
if: ${{ github.event.inputs.dry-run != 'true' }}
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: uvx twine upload dist/*