Skip to content

[pre-commit.ci] pre-commit autoupdate #49

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #49

Workflow file for this run

on:
push:
branches:
- master
tags:
- "v*"
pull_request:
name: Build and release to pypi
jobs:
release-build:
name: Build and upload distributions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: |
**/requirements*.txt
**/pyproject.toml
- name: Build dist
run: uv tool run --with build[uv] --from build python -m build --installer uv
- name: Upload release distributions
uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/
pypi-publish:
name: Release to pypi
runs-on: ubuntu-latest
environment:
name: pypi_publish
url: https://pypi.org/p/python-template
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs:
- release-build
permissions:
id-token: write
steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/
- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1