|
| 1 | +name: deploy-release |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: [published] |
| 6 | + |
| 7 | +env: |
| 8 | + HOMEBREW_NO_ANALYTICS: "ON" # Make Homebrew installation a little quicker |
| 9 | + HOMEBREW_NO_AUTO_UPDATE: "ON" |
| 10 | + HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: "ON" |
| 11 | + HOMEBREW_NO_GITHUB_API: "ON" |
| 12 | + HOMEBREW_NO_INSTALL_CLEANUP: "ON" |
| 13 | + CIBW_SKIP: "pp* *i686*" # skip building for PyPy |
| 14 | + CIBW_ARCHES: x86_64 |
| 15 | + |
| 16 | +jobs: |
| 17 | + build_wheels: |
| 18 | + name: Build wheels on ${{ matrix.os }} |
| 19 | + runs-on: ${{ matrix.os }} |
| 20 | + strategy: |
| 21 | + fail-fast: false |
| 22 | + matrix: |
| 23 | + os: [ubuntu-20.04, macos-10.15] |
| 24 | + gcc_v: [8] # Version of GFortran we want to use. |
| 25 | + env: |
| 26 | + FC: gfortran-${{ matrix.gcc_v }} |
| 27 | + GCC_V: ${{ matrix.gcc_v }} |
| 28 | + |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@v2 |
| 31 | + - uses: actions/setup-python@v2 |
| 32 | + |
| 33 | + - name: Install cibuildwheel |
| 34 | + run: python -m pip install cibuildwheel==1.10.0 |
| 35 | + |
| 36 | + - name: Set up common |
| 37 | + run: python -m pip install --upgrade cmake |
| 38 | + |
| 39 | + - name: Install GFortran Linux |
| 40 | + if: contains(matrix.os, 'ubuntu') |
| 41 | + run: | |
| 42 | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test |
| 43 | + sudo apt-get update |
| 44 | + sudo apt-get install -y gcc-${GCC_V} gfortran-${GCC_V} |
| 45 | + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \ |
| 46 | + --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} |
| 47 | + sudo apt-get install -y libtool automake |
| 48 | +
|
| 49 | + - name: Install GFortran macOS |
| 50 | + if: contains(matrix.os, 'macos') |
| 51 | + run: brew install gcc@${GCC_V} || brew upgrade gcc@${GCC_V} || true |
| 52 | + |
| 53 | + - name: Install automake macOS |
| 54 | + if: contains(matrix.os, 'macos') |
| 55 | + run: brew install automake || true |
| 56 | + |
| 57 | + - name: Build wheels |
| 58 | + run: python -m cibuildwheel --output-dir wheelhouse |
| 59 | + |
| 60 | + - uses: actions/upload-artifact@v2 |
| 61 | + with: |
| 62 | + path: ./wheelhouse/*.whl |
| 63 | + |
| 64 | + build_sdist: |
| 65 | + name: Build source distribution |
| 66 | + runs-on: ubuntu-latest |
| 67 | + steps: |
| 68 | + - uses: actions/checkout@v2 |
| 69 | + |
| 70 | + - uses: actions/setup-python@v2 |
| 71 | + name: Install Python |
| 72 | + with: |
| 73 | + python-version: '3.8' |
| 74 | + |
| 75 | + - name: Build sdist |
| 76 | + run: | |
| 77 | + python -m pip install cmake>=3.10 |
| 78 | + python setup.py sdist |
| 79 | +
|
| 80 | + - uses: actions/upload-artifact@v2 |
| 81 | + with: |
| 82 | + path: dist/*.tar.gz |
| 83 | + |
| 84 | + |
| 85 | + upload_pypi: |
| 86 | + needs: [build_wheels, build_sdist] |
| 87 | + runs-on: ubuntu-latest |
| 88 | + steps: |
| 89 | + - uses: actions/download-artifact@v2 |
| 90 | + with: |
| 91 | + name: artifact |
| 92 | + path: dist |
| 93 | + |
| 94 | + - uses: pypa/gh-action-pypi-publish@master |
| 95 | + with: |
| 96 | + user: __token__ |
| 97 | + password: ${{ secrets.PYPI }} |
| 98 | + #repository_url: https://test.pypi.org/legacy/ |
0 commit comments