@@ -181,8 +181,8 @@ jobs:
181181 max-parallel : 8
182182 matrix :
183183 WINDOWS :
184- - { ARCH: 'x86', WINDOWS: 'win32' }
185- - { ARCH: 'x64', WINDOWS: 'win64' }
184+ - {ARCH: 'x86', WINDOWS: 'win32'}
185+ - {ARCH: 'x64', WINDOWS: 'win64'}
186186 python-version : ["3.8", "3.9", "3.10", "3.11", "3.12"]
187187 name : " Cython based python ${{ matrix.python-version }} on ${{ matrix.WINDOWS.WINDOWS }}"
188188
@@ -256,78 +256,66 @@ jobs:
256256 run : |
257257 twine check dist/*
258258
259- # DeployWindows:
260- # needs: [TestLinux, TestWindows]
261- # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
262- # runs-on: windows-latest
263- # strategy:
264- # max-parallel: 6
265- # matrix:
266- # WINDOWS:
267- # - { ARCH: 'x86', WINDOWS: 'win32' }
268- # - { ARCH: 'x64', WINDOWS: 'win64' }
269- # python-version: [3.7, 3.8, 3.9]
270- # name: "Release for python ${{ matrix.python-version }} on ${{ matrix.WINDOWS.WINDOWS }}"
271- #
272- # steps:
273- # - uses: actions/checkout@v2
274- # - name: Set up Python ${{ matrix.python-version }}
275- # uses: actions/setup-python@v2
276- # with:
277- # python-version: ${{ matrix.python-version }}
278- # architecture: ${{ matrix.WINDOWS.ARCH }}
279- # - name: Install dependencies
280- # run: |
281- # python -m pip install --upgrade pip wheel
282- # pip install --upgrade -r build_requirements.txt
283- # pip install --upgrade twine
284- # - name: Build package
285- # run: |
286- # python setup.py sdist bdist_wheel clean
287- # - name: Deploy
288- # env:
289- # TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
290- # TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
291- # run: |
292- # twine upload --skip-existing dist/*
259+ build_wheels :
260+ name : Build wheels on ${{ matrix.os }}
261+ needs : [ TestScript, TestLinux, TestWindows ]
262+ # build only on push: heavy job
263+ if : github.event_name == 'push'
264+ runs-on : ${{ matrix.os }}
265+ strategy :
266+ fail-fast : false
267+ matrix :
268+ os : [ "ubuntu-latest", "macos-latest" ]
269+
270+ steps :
271+ - uses : actions/checkout@v4
272+ with :
273+ fetch-depth : 0 # need for setuptools_scm
274+
275+ # Used to host cibuildwheel
276+ 277+ with :
278+ python-version : " 3.11"
279+
280+ - name : Set up QEMU
281+ if : runner.os == 'Linux'
282+ uses : docker/setup-qemu-action@v3
283+ with :
284+ platforms : all
285+
286+ - name : Build wheels
287+ 288+ env :
289+ # configure cibuildwheel to build native archs ('auto'), and some
290+ # emulated ones
291+ CIBW_ARCHS_LINUX : auto aarch64
292+ CIBW_ARCHS_MACOS : x86_64 universal2 arm64
293+
294+ - uses : actions/upload-artifact@v3
295+ with :
296+ path : ./wheelhouse/*.whl
297+ name : wheels
298+ retention-days : 3
299+
300+ upload_pypi :
301+ needs : [ Build, build_wheels, Metadata ]
302+ # upload to PyPI on every tag
303+ if : github.event_name == 'push' && github.ref_type == 'tag'
304+ # alternatively, to publish when a GitHub Release is created, use the following rule:
305+ # if: github.event_name == 'release' && github.event.action == 'published'
306+ runs-on : ubuntu-latest
307+ environment :
308+ name : pypi
309+ url : https://pypi.org/p/threaded
310+ permissions :
311+ id-token : write # IMPORTANT: this permission is mandatory for trusted publishing
312+ steps :
313+ - uses : actions/download-artifact@v3
314+ with :
315+ # unpacks default artifact into dist/
316+ # if `name: wheels` is omitted, the action will create extra parent dir
317+ name : wheels
318+ path : dist
293319
294- # DeployManyLinux:
295- # needs: [ TestLinux, TestWindows ]
296- # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
297- # runs-on: ubuntu-latest
298- # container:
299- # image: ${{ matrix.MANYLINUX.CONTAINER }}
300- # env:
301- # PYTHONDONTWRITEBYTECODE: 1
302- # strategy:
303- # matrix:
304- # PYTHON: [ "cp37-cp37m", "cp38-cp38", "cp39-cp39" ]
305- # MANYLINUX:
306- # - NAME: manylinux2010_x86_64
307- # CONTAINER: "quay.io/pypa/manylinux2010_x86_64"
308- # - NAME: manylinux2014_x86_64
309- # CONTAINER: "quay.io/pypa/manylinux2014_x86_64"
310- # name: "${{ matrix.PYTHON }} for ${{ matrix.MANYLINUX.NAME }}"
311- # steps:
312- # - uses: actions/checkout@v2
313- # - name: Install main dependencies
314- # run: |
315- # /opt/python/${{ matrix.PYTHON }}/bin/python -m pip install -U pip wheel setuptools
316- # /opt/python/${{ matrix.PYTHON }}/bin/pip install --upgrade -r build_requirements.txt
317- # /opt/python/${{ matrix.PYTHON }}/bin/pip install --upgrade twine
318- # - name: Build package
319- # run: /opt/python/${{ matrix.PYTHON }}/bin/python setup.py bdist_wheel clean
320- # - name: Bundle external shared libraries into the wheels
321- # run: |
322- # for whl in dist/*.whl; do
323- # echo "Repairing $whl..."
324- # auditwheel repair "$whl" -w dist/
325- # done
326- # - name: Cleanup OS specific wheels
327- # run: rm -fv dist/*-linux_*.whl
328- # - name: Deploy
329- # env:
330- # TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
331- # TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
332- # run: |
333- # twine upload --skip-existing dist/*
320+ - name : Publish package distributions to PyPI
321+ uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments