|
1
|
name: Publish to PyPI |
|
2
|
|
|
3
|
on: |
|
4
|
release: |
|
5
|
types: [published] |
|
6
|
|
|
7
|
permissions: |
|
8
|
id-token: write |
|
9
|
|
|
10
|
jobs: |
|
11
|
build: |
|
12
|
runs-on: ubuntu-latest |
|
13
|
steps: |
|
14
|
- uses: actions/checkout@v6 |
|
15
|
|
|
16
|
- uses: actions/setup-python@v6 |
|
17
|
with: |
|
18
|
python-version: "3.12" |
|
19
|
|
|
20
|
- name: Install build tools |
|
21
|
run: pip install build |
|
22
|
|
|
23
|
- name: Build package |
|
24
|
run: python -m build |
|
25
|
|
|
26
|
- name: Upload artifacts |
|
27
|
uses: actions/upload-artifact@v7 |
|
28
|
with: |
|
29
|
name: dist |
|
30
|
path: dist/ |
|
31
|
|
|
32
|
publish-pypi: |
|
33
|
needs: build |
|
34
|
runs-on: ubuntu-latest |
|
35
|
environment: pypi |
|
36
|
steps: |
|
37
|
- name: Download artifacts |
|
38
|
uses: actions/download-artifact@v8 |
|
39
|
with: |
|
40
|
name: dist |
|
41
|
path: dist/ |
|
42
|
|
|
43
|
- name: Publish to PyPI |
|
44
|
uses: pypa/gh-action-pypi-publish@release/v1 |
|
45
|
|