6
6
- v*
7
7
8
8
jobs :
9
- # First job is to build the wheels on different OS
10
- build_wheels :
11
- name : Build wheels on ${{ matrix.os }}
12
- runs-on : ${{ matrix.os }}
13
- strategy :
14
- matrix :
15
- os : [ubuntu-latest, windows-latest, macos-latest]
16
- steps :
17
- - uses : actions/checkout@v3
18
-
19
- - name : Set up Python
20
- uses : actions/setup-python@v4
21
- with :
22
- python-version : " 3.12"
23
-
24
- - name : Upgrade pip and install cibuildwheel
25
- run : |
26
- python -m pip install --upgrade pip
27
- pip install cibuildwheel
28
-
29
- - name : Build wheels
30
- run : python -m cibuildwheel --output-dir wheelhouse
31
- env :
32
- CIBW_BUILD : " cp310-* cp311-* cp312-*"
33
- CIBW_SKIP : " pp* *musllinux*"
34
- CIBW_TEST_SKIP : " *"
35
- CIBW_ARCHS_MACOS : " universal2"
36
- CIBW_ARCHS_LINUX : " x86_64 aarch64"
37
-
38
- - name : Upload built wheels
39
- uses : actions/upload-artifact@v4
40
- with :
41
- name : wheels-${{ matrix.os }}
42
- path : wheelhouse/*.whl
43
-
44
- # Then just build the source distribution as normal
45
- build_sdist :
46
- name : Build source distribution
9
+ build-release :
10
+ name : Build and publish PyPI
47
11
runs-on : ubuntu-latest
48
12
steps :
49
13
- uses : actions/checkout@v3
50
-
14
+ with :
15
+ fetch-depth : 0
51
16
- name : Set up Python
52
- uses : actions/setup-python@v4
17
+ uses : actions/setup-python@v3
53
18
with :
54
- python-version : " 3.12 "
19
+ python-version : ' 3.10 '
55
20
56
- - name : Upgrade pip and install build
21
+ - name : Install build tools
57
22
run : |
58
- python -m pip install --upgrade pip
59
- pip install build
60
-
61
- - name : Build sdist
62
- run : python -m build --sdist --outdir dist
63
-
64
- - name : Upload sdist
65
- uses : actions/upload-artifact@v4
66
- with :
67
- name : sdist
68
- path : dist/*.tar.gz
69
-
70
- # Finally publish all files to PyPI
71
- publish :
72
- name : Publish to PyPI
73
- needs : [build_wheels, build_sdist]
74
- runs-on : ubuntu-latest
75
- steps :
76
- - uses : actions/checkout@v3
77
-
78
- - name : Download all artifacts
79
- uses : actions/download-artifact@v4
80
- with :
81
- path : dist
23
+ pip install --upgrade pip setuptools wheel build setuptools_scm
82
24
83
- - name : Merge all distributions
25
+ - name : Build Package
84
26
run : |
85
- mkdir -p final_dist
86
- find dist -name '*.whl' -exec cp {} final_dist/ \;
87
- find dist -name '*.tar.gz' -exec cp {} final_dist/ \;
27
+ python -m build --no-isolation
88
28
89
- - name : Publish to PyPI
29
+ - name : Publish package to PyPI
90
30
uses : pypa/gh-action-pypi-publish@release/v1
91
31
with :
92
- password : ${{ secrets.PYPI_API_TOKEN }}
93
- packages_dir : final_dist
32
+ password : ${{ secrets.PYPI_API_TOKEN }}
0 commit comments