|
| 1 | +# This workflow uses actions that are not certified by GitHub. |
| 2 | +# They are provided by a third-party and are governed by |
| 3 | +# separate terms of service, privacy policy, and support |
| 4 | +# documentation. |
| 5 | + |
| 6 | +name: Build Python Wheels |
| 7 | + |
| 8 | +#on: |
| 9 | +# release: |
| 10 | +# types: [published] |
| 11 | + |
| 12 | +#on: |
| 13 | +# push: |
| 14 | +# tags: |
| 15 | +# - "*.*.*" |
| 16 | + |
| 17 | +#on: |
| 18 | +# release: |
| 19 | +# types: [created] |
| 20 | + |
| 21 | +#on: |
| 22 | +# push: |
| 23 | +# branches: [ main ] |
| 24 | + |
| 25 | +on: workflow_dispatch |
| 26 | + |
| 27 | +permissions: |
| 28 | + contents: read |
| 29 | + |
| 30 | +jobs: |
| 31 | + |
| 32 | + build_windows_macos_wheel: |
| 33 | + runs-on: ${{ matrix.os }} |
| 34 | + strategy: |
| 35 | + fail-fast: false |
| 36 | + matrix: |
| 37 | + # os: [windows-latest, macos-latest] |
| 38 | + os: [windows-latest, macos-latest] |
| 39 | + # python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ] |
| 40 | + python-version: [ "3.6", "3.7", "3.8", "3.9", ] |
| 41 | + exclude: |
| 42 | + - os: windows-latest |
| 43 | + python-version: 3.6 |
| 44 | + |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@v3 |
| 47 | + - name: Set up Python |
| 48 | + uses: actions/setup-python@v3 |
| 49 | + with: |
| 50 | + python-version: ${{ matrix.python-version }} |
| 51 | + |
| 52 | + - name: Install dependencies |
| 53 | + run: | |
| 54 | + python -m pip install --upgrade pip |
| 55 | + pip install build oldest-supported-numpy cython |
| 56 | +
|
| 57 | + - name: Build package |
| 58 | + run: | |
| 59 | + python setup.py build_ext --inplace |
| 60 | + python -m build |
| 61 | +
|
| 62 | + - uses: actions/upload-artifact@v3 |
| 63 | + with: |
| 64 | + name: wheels |
| 65 | + path: dist/*.whl |
| 66 | + |
| 67 | + |
| 68 | + build_linux_wheel: |
| 69 | + |
| 70 | + runs-on: ubuntu-latest |
| 71 | + container: |
| 72 | + image: quay.io/pypa/manylinux2014_x86_64 |
| 73 | + |
| 74 | + strategy: |
| 75 | + fail-fast: false |
| 76 | + matrix: |
| 77 | + # python-name: [ cp310-cp310, cp311-cp311, cp36-cp36m, cp37-cp37m, cp38-cp38, cp39-cp39 ] |
| 78 | + python-name: [ cp36-cp36m, cp37-cp37m, cp38-cp38, cp39-cp39 ] |
| 79 | + # python-name: [ cp38-cp38 ] |
| 80 | + |
| 81 | + steps: |
| 82 | + - uses: actions/checkout@v3 |
| 83 | + |
| 84 | + - name: Install dependencies |
| 85 | + run: | |
| 86 | + yum install -y atlas-devel |
| 87 | + /opt/python/${{ matrix.python-name }}/bin/python -m pip install --upgrade pip |
| 88 | + /opt/python/${{ matrix.python-name }}/bin/python -m pip install build oldest-supported-numpy cython |
| 89 | +
|
| 90 | + - name: Build package |
| 91 | + run: | |
| 92 | + /opt/python/${{ matrix.python-name }}/bin/python setup.py build_ext --inplace |
| 93 | + /opt/python/${{ matrix.python-name }}/bin/python -m build |
| 94 | +
|
| 95 | + - name: Repair wheel |
| 96 | + run: | |
| 97 | + mkdir dist_wheelhouse |
| 98 | + ls dist/*.whl | cat | xargs -t -n 1 auditwheel repair -w dist_wheelhouse |
| 99 | + ls -R dist |
| 100 | + ls -R dist_wheelhouse |
| 101 | +
|
| 102 | + - uses: actions/upload-artifact@v3 |
| 103 | + with: |
| 104 | + name: wheels |
| 105 | + path: dist_wheelhouse/*.whl |
| 106 | + |
| 107 | +# |
| 108 | +# release_and_publish_package: |
| 109 | +# runs-on: ubuntu-latest |
| 110 | +# |
| 111 | +# needs: [build_windows_macos_wheel, build_linux_wheel] |
| 112 | +# # needs: [build_windows_macos_wheel, build_linux_wheel] |
| 113 | +# |
| 114 | +# steps: |
| 115 | +# |
| 116 | +# - name: Download wheels |
| 117 | +# uses: actions/download-artifact@v3 |
| 118 | +# with: |
| 119 | +# name: windows_macos_wheels |
| 120 | +# path: dist |
| 121 | +# |
| 122 | +# - run: ls -R |
| 123 | +# |
| 124 | +# - name: Download linux wheels |
| 125 | +# uses: actions/download-artifact@v3 |
| 126 | +# with: |
| 127 | +# name: linux_wheels |
| 128 | +# path: dist |
| 129 | +# |
| 130 | +# - run: ls -R |
| 131 | +# |
| 132 | +# - name: Rearrange wheels |
| 133 | +# run: | |
| 134 | +# mv dist/wheelhouse/* dist |
| 135 | +# rm -rf dist/wheelhouse/ |
| 136 | +# |
| 137 | +# - run: ls -R |
| 138 | +# |
| 139 | +# - name: Publish a Python distribution to PyPI |
| 140 | +# uses: pypa/gh-action-pypi-publish@release/v1 |
| 141 | +# with: |
| 142 | +# user: __token__ |
| 143 | +# password: ${{ secrets.PYPI_API_TOKEN_OAKS }} |
| 144 | +# |
| 145 | +# - name: Publish Github release |
| 146 | +# uses: softprops/action-gh-release@v1 |
| 147 | +# with: |
| 148 | +# token: ${{ secrets.DEV_GITHUB_TOKEN }} |
| 149 | +# files: dist/* |
0 commit comments