Debian Codegraph @

.github/workflows/publish.yml

raw
1 name: Publish packages to PyPI
2
3 on:
4 push:
5 tags:
6 - "[0-9]+.[0-9]+.[0-9]+"
7 - "[0-9]+.[0-9]+.[0-9]+.post[0-9]+"
8 - "[0-9]+.[0-9]+.[0-9]+[a-b][0-9]+"
9 - "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
10
11 jobs:
12 build:
13 name: Build the source tarball and the wheel
14 runs-on: ubuntu-latest
15 environment: release
16 steps:
17 - uses: actions/checkout@v6
18 - name: Set up Python
19 uses: actions/setup-python@v6
20 with:
21 python-version: 3.x
22 - name: Install dependencies
23 run: pip install build
24 - name: Create packages
25 run: python -m build
26 - name: Archive packages
27 uses: actions/upload-artifact@v6
28 with:
29 name: dist
30 path: dist
31
32 publish:
33 name: Publish build artifacts to the PyPI
34 needs: build
35 runs-on: ubuntu-latest
36 environment: release
37 permissions:
38 id-token: write
39 steps:
40 - name: Retrieve packages
41 uses: actions/download-artifact@v7
42 with:
43 name: dist
44 path: dist
45 - name: Upload packages
46 uses: pypa/gh-action-pypi-publish@release/v1
47
48 release:
49 name: Create a GitHub release
50 needs: build
51 runs-on: ubuntu-latest
52 permissions:
53 contents: write
54 steps:
55 - uses: actions/checkout@v6
56 - id: changelog
57 uses: agronholm/release-notes@v1
58 with:
59 path: docs/versionhistory.rst
60 - uses: ncipollo/release-action@v1
61 with:
62 body: ${{ steps.changelog.outputs.changelog }}