Skip to content

Migrate to trusted publishing #148

Migrate to trusted publishing

Migrate to trusted publishing #148

Workflow file for this run

---
name: CI
on:
- push
- pull_request
jobs:
lint:
name: Run linters
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v5
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install dependencies
run: python -m pip install tox
- name: Run tox
run: tox -e style
test:
name: Run unit tests
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout source code
uses: actions/checkout@v5
# We need history to build the package
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: python -m pip install tox tox-gh-actions
- name: Run unit tests (via tox)
run: tox
docs:
name: Build docs
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v5
# We need history for release notes
with:
fetch-depth: 0
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install dependencies
run: python -m pip install tox
- name: Build docs (via tox)
run: tox -e docs
- name: Archive build results
uses: actions/upload-artifact@v4
with:
name: html-docs-build
path: docs/_build/html
retention-days: 7
release:
name: Upload release artifacts
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push'
environment:
name: pypi
url: https://pypi.org/p/sphinx-click
permissions:
id-token: write
steps:
- name: Checkout source code
uses: actions/checkout@v5
# We need history to build the package
with:
fetch-depth: 0
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install dependencies
run: python -m pip install build
- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/ .
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1