Skip to content

ci: fix distribution metadata check and pin uv in docs build #65

ci: fix distribution metadata check and pin uv in docs build

ci: fix distribution metadata check and pin uv in docs build #65

Workflow file for this run

name: CD
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
tags:
- "v*"
release:
types:
- published
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# Many color libraries just need this to be set to any value, but at least
# one distinguishes color depth, where "3" -> "256-bit color".
FORCE_COLOR: 3
jobs:
dist:
name: Distribution build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: hynek/build-and-inspect-python-package@2abe76da66d0a6a4a227101f9348ee855797cfa5 # v3.0.1
publish-testpypi:
needs: [dist]
name: Publish to TestPyPI
environment: testpypi
permissions:
id-token: write
attestations: write
contents: read
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') && github.event_name != 'release'
steps:
- uses: actions/download-artifact@v8
with:
name: Packages
path: dist
- name: Generate artifact attestation for sdist and wheel
uses: actions/attest-build-provenance@v4
with:
subject-path: "dist/*"
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
publish:
needs: [dist]
name: Publish to PyPI
environment: pypi
permissions:
id-token: write
attestations: write
contents: read
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v8
with:
name: Packages
path: dist
- name: Generate artifact attestation for sdist and wheel
uses: actions/attest-build-provenance@v4
with:
subject-path: "dist/*"
- uses: pypa/gh-action-pypi-publish@release/v1