@@ -2,51 +2,64 @@ name: Publish to PyPI
22
33on :
44 push :
5- tags : " *"
5+ tags :
6+ - " *"
67
78jobs :
8- build :
9- runs-on : ubuntu-latest
10- permissions :
11- id-token : write
12- repository-projects : write
13- contents : write
14- pages : write
9+ build_wheels :
10+ name : Build wheels on ${{ matrix.os }}
11+ runs-on : ${{ matrix.os }}
12+ strategy :
13+ matrix :
14+ # macos-13 is an intel runner, higher macos's are apple silicon
15+ # At some point, maybe get this to work on windows-latest
16+ os : [ubuntu-latest, macos-13, macos-latest]
1517
1618 steps :
17- - uses : actions/checkout@v4
19+ - name : Check out repository
20+ uses : actions/checkout@v4
21+
22+ - name : Build wheels
23+ 24+ env :
25+ CIBW_ARCHS_LINUX : x86_64
26+ CIBW_PROJECT_REQUIRES_PYTHON : " >=3.9"
27+ CIBW_SKIP : pp*
1828
19- - name : Set up Python 3.12
20- uses : actions/setup-python@v5
29+ - uses : actions/upload-artifact@v4
2130 with :
22- python-version : 3.12
31+ name : cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
32+ path : ./wheelhouse/*.whl
2333
24- - name : Install dependencies
25- run : |
26- python -m pip install --upgrade pip
27- pip install tox
34+ build_sdist :
35+ name : Build source distribution
36+ runs-on : ubuntu-latest
37+ steps :
38+ - uses : actions/checkout@v4
39+ with :
40+ submodules : true
2841
29- - name : Test with tox
30- run : |
31- tox
42+ - name : Build sdist
43+ run : pipx run build --sdist
3244
33- - name : Build Project and Publish
34- run : |
35- python -m tox -e clean,build
45+ - uses : actions/upload-artifact@v4
46+ with :
47+ name : cibw-sdist
48+ path : dist/*.tar.gz
49+
50+ upload_pypi :
51+ needs : [build_wheels, build_sdist]
52+ runs-on : ubuntu-latest
53+ permissions :
54+ id-token : write
55+
56+ steps :
57+ - uses : actions/download-artifact@v4
58+ with :
59+ pattern : cibw-*
60+ path : dist
61+ merge-multiple : true
3662
3763 # This uses the trusted publisher workflow so no token is required.
3864 - name : Publish to PyPI
3965 uses : pypa/gh-action-pypi-publish@release/v1
40-
41- - name : Build docs
42- run : |
43- tox -e docs
44-
45- - run : touch ./docs/_build/html/.nojekyll
46-
47- - name : GH Pages Deployment
48- uses : JamesIves/github-pages-deploy-action@v4
49- with :
50- branch : gh-pages # The branch the action should deploy to.
51- folder : ./docs/_build/html
52- clean : true # Automatically remove deleted files from the deploy branch
0 commit comments