-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (40 loc) · 1.14 KB
/
deploy.yaml
File metadata and controls
43 lines (40 loc) · 1.14 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
39
40
41
42
43
name: Deploy
on:
release:
types: [published]
defaults:
run:
shell: bash
jobs:
deploy-pypi:
name: Deploy to PyPI
# Having an environment for deployment is strongly recommend by PyPI
# https://docs.pypi.org/trusted-publishers/adding-a-publisher/#github-actions
# You can comment this line out if you don't want it.
environment: deploy
strategy:
matrix:
os: [ "ubuntu-latest" ]
python-version: [ "3.11" ]
runs-on: "${{ matrix.os }}"
permissions:
# this permission is mandatory for trusted publishing with PyPI
id-token: write
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup uv
id: setup-uv
uses: astral-sh/setup-uv@v4
with:
version: "0.8.8"
python-version: ${{ matrix.python-version }}
- name: Publish to PyPI
run: |
uv run python scripts/add-locked-targets-to-pyproject-toml.py
uv build
uv publish
# Just in case, undo the changes to `pyproject.toml`
git restore --staged . && git restore .