Skip to content

Update pypa/gh-action-pypi-publish digest to dc37677 (#80) #141

Update pypa/gh-action-pypi-publish digest to dc37677 (#80)

Update pypa/gh-action-pypi-publish digest to dc37677 (#80) #141

Workflow file for this run

name: Test Distribution
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
paths:
- "pyproject.toml"
- "uv.lock"
- ".github/workflows/dist-test.yml"
workflow_dispatch:
inputs:
allow_deploy:
description: 'Deploy with twine'
required: true
type: boolean
allow_sphinx_deploy:
description: 'Deploy Sphinx extension with twine'
required: true
type: boolean
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: 3.14
- name: Build pydispatch dists
run: uv build
- name: Build pydispatch_sphinx dists
run: uv build --out-dir $DISTDIR
working-directory: ${{ github.workspace }}/sphinx-plugin
env:
DISTDIR: ${{ github.workspace }}/dist-sphinx
- name: Export pydispatch lockfile
run: uv export --frozen --no-emit-project --only-group test -o requirements.txt
- name: Export pydispatch_sphinx lockfile
run: uv export --frozen --no-emit-project --only-group test -o requirements.txt
working-directory: ${{ github.workspace }}/sphinx-plugin
- name: Upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: 'dists'
path: 'dist/*'
- name: Upload sphinx artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: 'dists-sphinx'
path: 'dist-sphinx/*'
- name: Upload lockfiles
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: 'lockfiles'
path: |
requirements.txt
sphinx-plugin/requirements.txt
test:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12", "3.13", "3.14"]
dist-type: [sdist, wheel]
fail-fast: false
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Download lockfiles
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: 'lockfiles'
path: .
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install -r sphinx-plugin/requirements.txt
- name: Download artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: 'dists'
path: dist
- name: Download sphinx artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: 'dists-sphinx'
path: dist
- name: Delete source directories
run: |
rm -Rf pydispatch
rm -Rf sphinx-plugin/pydispatch_sphinx
- name: Install wheel
if: ${{ matrix.dist-type == 'wheel' }}
run: pip install dist/*.whl
- name: Install sdist
if: ${{ matrix.dist-type == 'sdist' }}
run: pip install dist/*.tar.gz
- name: Test pydispatch distribution
run: py.test tests/
- name: Test pydispatch_sphinx distribution
# TODO: Remove 3.14 exclusion when 3.14 support is added to sphinx-plugin
if: ${{ matrix.python-version != '3.14' }}
run: py.test sphinx-plugin/tests/
deploy:
needs: test
if: ${{ success() && (github.event.inputs.allow_deploy == 'true' || github.event.inputs.allow_sphinx_deploy == 'true') }}
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
pattern: 'dists*'
path: dist
merge-multiple: true
- name: Publish distributions
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1
with:
skip-existing: true