Improve the CI (#485) #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release to PyPI | |
on: | |
push: | |
tags: ["*"] | |
env: | |
dists-artifact-name: python-package-distributions | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install the latest version of uv | |
uses: astral-sh/setup-uv@v3 | |
with: | |
enable-cache: true | |
cache-dependency-glob: "pyproject.toml" | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build package | |
run: uv build --python 3.13 --python-preference only-managed --sdist --wheel . --out-dir dist | |
- name: Store the distribution packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.dists-artifact-name }} | |
path: dist/* | |
release: | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
environment: | |
name: release | |
url: https://pypi.org/project/sphinx-autodoc-typehints/${{ github.ref_name }} | |
permissions: | |
id-token: write | |
steps: | |
- name: Download all the dists | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.dists-artifact-name }} | |
path: dist/ | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@v1.10.1 | |
with: | |
attestations: true |