Debian Codegraph @

.github/workflows/build-release.yml

raw symbols SCIP
1 name: build
2 on:
3 push:
4 branches: ["main"]
5 tags: ["*"]
6 pull_request:
7
8 jobs:
9 tests:
10 name: ${{ matrix.name }}
11 runs-on: ubuntu-latest
12 strategy:
13 fail-fast: false
14 matrix:
15 include:
16 - { name: "3.10", python: "3.10", tox: py310 }
17 - { name: "3.14", python: "3.14", tox: py314 }
18 - { name: "lowest", python: "3.10", tox: py310-lowest }
19 steps:
20 - uses: actions/checkout@v6
21 - uses: astral-sh/setup-uv@v7
22 with:
23 python-version: ${{ matrix.python }}
24 enable-cache: true
25 - run: uv run tox -e ${{ matrix.tox }}
26 build:
27 name: Build package
28 runs-on: ubuntu-latest
29 steps:
30 - uses: actions/checkout@v6
31 - uses: astral-sh/setup-uv@v7
32 with:
33 python-version: "3.14"
34 enable-cache: true
35 - run: uv build
36 - run: uvx twine check --strict dist/*
37 - name: Store the distribution packages
38 uses: actions/upload-artifact@v7
39 with:
40 name: python-package-distributions
41 path: dist/
42 # this duplicates pre-commit.ci, so only run it on tags
43 # it guarantees that linting is passing prior to a release
44 lint-pre-release:
45 if: startsWith(github.ref, 'refs/tags')
46 runs-on: ubuntu-latest
47 steps:
48 - uses: actions/checkout@v6
49 - uses: astral-sh/setup-uv@v7
50 with:
51 python-version: "3.14"
52 enable-cache: true
53 - run: uv run tox -e lint
54 publish-to-pypi:
55 name: PyPI release
56 if: startsWith(github.ref, 'refs/tags/')
57 needs: [build, tests, lint-pre-release]
58 runs-on: ubuntu-latest
59 environment:
60 name: pypi
61 url: https://pypi.org/p/sphinx-issues
62 permissions:
63 id-token: write
64 steps:
65 - name: Download all the dists
66 uses: actions/download-artifact@v8
67 with:
68 name: python-package-distributions
69 path: dist/
70 - name: Publish distribution to PyPI
71 uses: pypa/gh-action-pypi-publish@release/v1