-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (31 loc) · 1.02 KB
/
on-release-main.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
name: release-main
on:
release:
types: [published]
branches: [main]
jobs:
publish:
runs-on: ubuntu-latest
environment: release
permissions:
# IMPORTANT: required for trusted publishing to PyPI
id-token: write
steps:
- name: Check out
uses: actions/checkout@v4
with:
fetch-depth: 0 # Let setuptools-scm work
- name: Install uv
uses: astral-sh/setup-uv@v2
- name: Build package
run: |
# At least print if there's anything extra in the source
# setuptools_scm creates bogus version numbers
git status
# Run the pyproject-build cli tool from the Python build
# package, and use the uv installer because it's blazing fast
uvx --from build pyproject-build --installer uv
uvx twine check --strict
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# This defaults to OIDC identification between GitHub and PyPI