|
| 1 | +name: Upload Python Package |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: [created] |
| 6 | + |
| 7 | +jobs: |
| 8 | + deploy-linux: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + steps: |
| 11 | + - uses: actions/checkout@v1 |
| 12 | + - name: Set up Python |
| 13 | + uses: actions/setup-python@v1 |
| 14 | + with: |
| 15 | + python-version: '3.x' |
| 16 | + - name: Install dependencies |
| 17 | + run: | |
| 18 | + python -m pip install --upgrade pip |
| 19 | + python -m pip install setuptools setuptools-scm numpy cibuildwheel wheel twine |
| 20 | + - name: Build |
| 21 | + env: |
| 22 | + CIBW_BEFORE_BUILD: "pip install -U numpy" |
| 23 | + CIBW_SKIP: "cp27-* cp34-* cp35-*" |
| 24 | + run: | |
| 25 | + python setup.py sdist -d wheelhouseLinux |
| 26 | + python -m cibuildwheel --platform linux --output-dir wheelhouseLinux |
| 27 | +
|
| 28 | + - name: Archive wheels |
| 29 | + uses: actions/upload-artifact@v1 |
| 30 | + with: |
| 31 | + name: wheelhouseLinux |
| 32 | + path: wheelhouseLinux |
| 33 | + |
| 34 | + |
| 35 | + deploy-macos: |
| 36 | + runs-on: macos-latest |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v1 |
| 39 | + - name: Set up Python |
| 40 | + uses: actions/setup-python@v1 |
| 41 | + with: |
| 42 | + python-version: '3.x' |
| 43 | + - name: Install dependencies |
| 44 | + run: | |
| 45 | + brew install gcc |
| 46 | + python -m pip install --upgrade pip |
| 47 | + python -m pip install setuptools setuptools-scm numpy cibuildwheel wheel twine |
| 48 | + - name: Build |
| 49 | + env: |
| 50 | + CIBW_BEFORE_BUILD: "pip install -U numpy" |
| 51 | + CIBW_SKIP: "cp27-* cp34-* cp35-*" |
| 52 | + run: | |
| 53 | + python -m cibuildwheel --platform macos --output-dir wheelhouseMacOS |
| 54 | +
|
| 55 | + - name: Archive wheels |
| 56 | + uses: actions/upload-artifact@v1 |
| 57 | + with: |
| 58 | + name: wheelhouseMacOS |
| 59 | + path: wheelhouseMacOS |
| 60 | + deploy: |
| 61 | + needs: [deploy-linux, deploy-macos] |
| 62 | + runs-on: ubuntu-latest |
| 63 | + steps: |
| 64 | + - uses: actions/checkout@v1 |
| 65 | + - name: Set up Python |
| 66 | + uses: actions/setup-python@v1 |
| 67 | + with: |
| 68 | + python-version: '3.x' |
| 69 | + - name: Install dependencies |
| 70 | + run: | |
| 71 | + python -m pip install --upgrade pip twine |
| 72 | +
|
| 73 | + - name: Download archived MacOS wheels |
| 74 | + uses: actions/download-artifact@v1 |
| 75 | + with: |
| 76 | + name: wheelhouseMacOS |
| 77 | + |
| 78 | + - name: Download archived Linux wheels |
| 79 | + uses: actions/download-artifact@v1 |
| 80 | + with: |
| 81 | + name: wheelhouseLinux |
| 82 | + |
| 83 | + - name: Publish |
| 84 | + env: |
| 85 | + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} |
| 86 | + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} |
| 87 | + run: | |
| 88 | + ls -ltrh wheelhouseMacOS/ wheelhouseLinux/ |
| 89 | + twine upload --skip-existing wheelhouseLinux/* wheelhouseMacOS/* |
0 commit comments