Skip to content

.github/workflows/pypi.yaml #213

.github/workflows/pypi.yaml

.github/workflows/pypi.yaml #213

Workflow file for this run

on:
workflow_dispatch:
release:
types:
- published
env:
DEFAULT_PYTHON: "3.12"
jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Set up uv
run: pipx install uv
- name: Install dependencies
run: |
uv pip install --system -r pyproject.toml --extra dev
- name: Run Tests
run: |
coverage run --source=pylamarzocco -m pytest tests/
coverage report -m
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Build package
run: uv build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: ✍️ Sign published artifacts
uses: sigstore/[email protected]
with:
inputs: ./dist/*.tar.gz ./dist/*.whl
release-signing-artifacts: true