-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (49 loc) · 1.34 KB
/
python-packages.yml
File metadata and controls
66 lines (49 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: "Build and Publish Python Packages"
on:
push:
tags:
- "v[0-9]+\\.[0-9]+\\.[0-9]+"
- "v[0-9]+\\.[0-9]+\\.[0-9]+-[0-9]+"
jobs:
build_sdist_wheel:
name: "Source and wheel distribution"
runs-on: ubuntu-latest
steps:
- name: "Checkout the repository"
uses: actions/checkout@v6
- name: "Set up Python"
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: "Install Python build dependencies"
run: |
pip install build
- name: "Build source distribution"
run: |
python -m build --sdist
- name: "Build wheel"
run: |
python -m build --wheel
- name: "Upload artifacts"
uses: actions/upload-artifact@v7
with:
name: dist
path: dist/
retention-days: 1
publish_pypi:
name: "Publish packages on PyPI"
runs-on: ubuntu-latest
needs:
- build_sdist_wheel
steps:
- name: "Download artifacts"
uses: actions/download-artifact@v8
with:
path: dist/
- name: "List packages"
run: |
find . -name "*.whl" -o -name "*.tar.gz"
- name: "Publish packages on PyPI"
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}