@@ -16,123 +16,96 @@ jobs:
1616 with :
1717 name : README
1818 path : README.md
19- test :
19+ build_wheel :
20+ needs : readme
2021 strategy :
2122 matrix :
22- runs-on : [ubuntu-latest, macos-13, macos-14, windows-latest]
23+ runs-on : [macos-13, macos-14, windows-latest, ubuntu -latest]
2324 fail-fast : false
2425 runs-on : ${{ matrix.runs-on }}
2526 steps :
2627 - uses : actions/checkout@v4
27- - name : Install Hatch
28- uses : pypa/hatch@install
29- - name : Run Test
30- run : |
31- hatch run test:install
32- hatch run test-38:install
33- hatch run test:run-cov
34- hatch run test-38:run-cov
35- hatch run cov:combine
36- echo '## Test Coverage on ${{ matrix.runs-on }}' >> $GITHUB_STEP_SUMMARY
37- echo '```' >> $GITHUB_STEP_SUMMARY
38- hatch -q run cov:report >> $GITHUB_STEP_SUMMARY
39- echo '```' >> $GITHUB_STEP_SUMMARY
28+ - uses : actions/download-artifact@v4
29+ with :
30+ name : README
31+ path : README
32+ - run : mv README/README.md README.md
33+ - uses : astral-sh/setup-uv@v4
34+ with :
35+ enable-cache : true
36+ cache-dependency-glob : |
37+ **/pyproject.toml
38+ **/setup.py
39+ - run : uvx -p 3.12 cibuildwheel
4040 shell : bash
41- build_winmac :
41+ - uses : actions/upload-artifact@v4
42+ with :
43+ name : dist-${{ matrix.runs-on }}-${{ strategy.job-index }}
44+ path : ./wheelhouse/*.whl
45+ build_aarch64 :
4246 needs : readme
4347 strategy :
4448 matrix :
45- runs-on : [macos-13, macos-14, windows-latest ]
49+ py : ['39', '310', '311', '312', '313' ]
4650 fail-fast : false
47- runs-on : ${{ matrix.runs-on }}
51+ runs-on : ubuntu-latest
4852 steps :
4953 - uses : actions/checkout@v4
50- - uses : actions/setup-python@v5
51- with :
52- python-version : |
53- 3.8
54- 3.9
55- 3.10
56- 3.11
57- 3.12
58- cache : ' pip'
5954 - uses : actions/download-artifact@v4
6055 with :
6156 name : README
6257 path : README
6358 - run : mv README/README.md README.md
64- - run : pip3.8 wheel . -w dist --no-deps
65- - run : pip3.9 wheel . -w dist --no-deps
66- - run : pip3.10 wheel . -w dist --no-deps
67- - run : pip3.11 wheel . -w dist --no-deps
68- - run : pip3.12 wheel . -w dist --no-deps
59+ - uses : astral-sh/setup-uv@v4
60+ with :
61+ enable-cache : true
62+ cache-dependency-glob : |
63+ **/pyproject.toml
64+ **/setup.py
65+ - uses : docker/setup-qemu-action@v3
66+ with :
67+ platforms : all
68+ - run : uvx -p 3.12 cibuildwheel
69+ shell : bash
70+ env :
71+ CIBW_BUILD : ${{'cp'}}${{ matrix.py }}${{'-????linux_*64'}}
72+ CIBW_ARCHS_LINUX : aarch64
6973 - uses : actions/upload-artifact@v4
7074 with :
71- name : dist-${{ matrix.runs-on }}
72- path : dist
73- - name : Upload to PyPI
74- run : |
75- pip install twine
76- python -m twine upload -u __token__ -p ${{ secrets.pypi_password }} --skip-existing dist/cpprb-*
77- if : github.event_name == 'push' && startsWith(github.event.ref,'refs/tags/v')
75+ name : dist-aarch64-${{ matrix.py }}-${{ strategy.job-index }}
76+ path : ./wheelhouse/*.whl
7877 build_targz :
7978 needs : readme
8079 runs-on : ubuntu-latest
8180 steps :
8281 - uses : actions/checkout@v4
83- - uses : actions/setup-python@v5
84- with :
85- python-version : ' 3.8'
86- cache : ' pip'
8782 - uses : actions/download-artifact@v4
8883 with :
8984 name : README
9085 path : README
9186 - run : mv README/README.md README.md
92- - run : python setup.py build_ext sdist
87+ - uses : astral-sh/setup-uv@v4
88+ with :
89+ enable-cache : true
90+ cache-dependency-glob : |
91+ **/pyproject.toml
92+ **/setup.py
93+ - run : uv run --no-project --with build python -m build --sdist
9394 - uses : actions/upload-artifact@v4
9495 with :
9596 name : dist-sdist
96- path : dist
97- - run : pip --disable-pip-version-check install twine
98- - name : Upload to PyPI
99- run : python -m twine upload -u __token__ -p ${{ secrets.pypi_password }} --skip-existing dist/cpprb-*tar.gz
100- if : github.event_name == 'push' && startsWith(github.event.ref,'refs/tags/v')
101- build_manylinux :
97+ path : dist/*.tar.gz
98+ upload :
99+ needs : [build_wheel, build_aarch64, build_targz]
100+ environment : pypi
102101 runs-on : ubuntu-latest
103- strategy :
104- matrix :
105- arch : ["x86_64", "aarch64"]
102+ permissions :
103+ id-token : write
104+ if : github.event_name == 'push' && startsWith(github.event.ref,'refs/tags/v')
106105 steps :
107- - uses : actions/checkout@v4
108- - uses : actions/setup-python@v5
109- with :
110- python-version : ' 3'
111- cache : ' pip'
112- - uses : docker/setup-qemu-action@v3
113- if : ${{ matrix.arch }} == "aarch64"
114- with :
115- platforms : arm64
116- - uses : docker/setup-buildx-action@v3
117- - uses : docker/build-push-action@v5
118- with :
119- push : false
120- build-args : |
121- ON_CI=1
122- arch=${{ matrix.arch }}
123- file : Dockerfile
124- cache-to : type=gha,mode=max,scope=${{github.ref_name}}
125- cache-from : type=gha,scope=${{github.ref_name}}
126- load : true
127- tags : cpprb/wheel:latest
128- - run : |
129- docker create --name wheel cpprb/wheel:latest
130- docker cp wheel:/dist/. dist/
131- - uses : actions/upload-artifact@v4
106+ - uses : actions/download-artifact@v4
132107 with :
133- name : dist-manylinux-${{ matrix.arch }}
108+ pattern : ' dist-* '
134109 path : dist
135- - run : pip --disable-pip-version-check install twine
136- - name : Upload to PyPI
137- run : python -m twine upload -u __token__ -p ${{ secrets.pypi_password }} --skip-existing dist/cpprb-*
138- if : github.event_name == 'push' && startsWith(github.event.ref,'refs/tags/v')
110+ merge-multiple : true
111+ - uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments