|
8 | 8 | runs-on: ubuntu-latest |
9 | 9 | steps: |
10 | 10 | - uses: GoogleCloudPlatform/release-please-action@v2 |
| 11 | + id: release |
11 | 12 | with: |
12 | 13 | release-type: python |
13 | 14 | package-name: LoopStructural |
| 15 | + outputs: |
| 16 | + release_created: ${{ steps.release.outputs.release_created }} |
| 17 | + # if a release is created then run the deploy scripts for github.io, conda, pypi and docker |
| 18 | + documentation-deploy: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + needs: release-please |
| 21 | + if: ${{ needs.release-please.outputs.release_created }} |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v2 |
| 24 | + - uses: conda-incubator/setup-miniconda@v2.0.0 |
| 25 | + with: |
| 26 | + auto-activate-base: true |
| 27 | + installer-url: https://github.com/conda-forge/miniforge/releases/download/4.10.1-0/Miniforge-pypy3-4.10.1-0-Linux-x86_64.sh |
| 28 | + channels: anaconda,conda-forge,loop3d,conda-forge/label/cf202003 |
| 29 | + python-version: 3.8 |
| 30 | + - name: Build documentation |
| 31 | + shell: bash -l {0} |
| 32 | + env: |
| 33 | + ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} |
| 34 | + run: | |
| 35 | + conda install -c conda-forge theano cython numpy pandas imageio scipy matplotlib sphinx=3.5.4 sphinx-gallery sphinxcontrib-bibtex sphinx_rtd_theme myst-parser scikit-learn scikit-image pyamg flake8 pytest networkx -y |
| 36 | + pip install lavavu-osmesa |
| 37 | + python setup.py install build_ext --inplace |
| 38 | + cd docs |
| 39 | + make html |
| 40 | + - name: Deploy 🚀 |
| 41 | + uses: JamesIves/github-pages-deploy-action@4.1.3 |
| 42 | + with: |
| 43 | + branch: gh-pages # The branch the action should deploy to. |
| 44 | + folder: docs/build/html # The folder the action should deploy. |
| 45 | + |
| 46 | + conda-deploy: |
| 47 | + name: Uploading to Loop3d for python ${{ matrix.os }}) |
| 48 | + needs: release-please |
| 49 | + if: ${{ needs.release-please.outputs.release_created }} |
| 50 | + runs-on: ${{ matrix.os }} |
| 51 | + strategy: |
| 52 | + fail-fast: false |
| 53 | + matrix: |
| 54 | + os: ["ubuntu-latest", "windows-latest","macos-latest"] |
| 55 | + python-version: ["3.9","3.8","3.7"] |
| 56 | + steps: |
| 57 | + - uses: conda-incubator/setup-miniconda@v2 |
| 58 | + with: |
| 59 | + auto-update-conda: true |
| 60 | + python-version: ${{ matrix.python-version }} |
| 61 | + |
| 62 | + - uses: actions/checkout@v2 |
| 63 | + - name: update submodules |
| 64 | +# shell: bash -l {0} |
| 65 | + run: | |
| 66 | + git submodule update --init --recursive |
| 67 | + - name: Add msbuild to PATH |
| 68 | + if: matrix.os == 'windows-latest' |
| 69 | + uses: microsoft/setup-msbuild@v1.0.2 |
| 70 | + - name: Conda build' |
| 71 | + env: |
| 72 | + ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} |
| 73 | + shell: bash -l {0} |
| 74 | + run: | |
| 75 | + conda install -c conda-forge conda-build scikit-build numpy=1.20 cython anaconda-client -y |
| 76 | + conda build -c anaconda -c conda-forge -c loop3d --output-folder conda conda |
| 77 | + conda install anaconda-client -y |
| 78 | + - name: upload windows |
| 79 | + env: |
| 80 | + ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} |
| 81 | + if: matrix.os == 'windows-latest' |
| 82 | + shell: bash -l {0} |
| 83 | + run: | |
| 84 | + anaconda upload --label main conda/win-64/*.tar.bz2 |
| 85 | + - name: upload linux |
| 86 | + env: |
| 87 | + ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} |
| 88 | + if: matrix.os == 'ubuntu-latest' |
| 89 | + shell: bash -l {0} |
| 90 | + run: | |
| 91 | + anaconda upload --label main conda/linux-64/*.tar.bz2 |
| 92 | + - name: upload macosx |
| 93 | + env: |
| 94 | + ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} |
| 95 | + if: matrix.os == 'macos-latest' |
| 96 | + shell: bash -l {0} |
| 97 | + run: | |
| 98 | + anaconda upload --label main conda/osx-64/*.tar.bz2 |
| 99 | + docker-deploy: |
| 100 | + needs: release-please |
| 101 | + if: ${{ needs.release-please.outputs.release_created }} |
| 102 | + runs-on: ubuntu-latest |
| 103 | + steps: |
| 104 | + - uses: actions/checkout@master |
| 105 | + - name: Publish to Registry |
| 106 | + uses: elgohr/Publish-Docker-Github-Action@master |
| 107 | + with: |
| 108 | + name: loop3d/loopstructural |
| 109 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 110 | + password: ${{ secrets.DOCKERHUB_PASSWORD }} |
| 111 | + dockerfile: Dockerfile |
| 112 | + tags: "latest,${{ env.STATE_RELEASE_VERSION }}" |
| 113 | + |
| 114 | + pypi-deploy: |
| 115 | + needs: release-please |
| 116 | + if: ${{ needs.release-please.outputs.release_created }} |
| 117 | + name: Build wheels |
| 118 | + runs-on: ${{ matrix.os }} |
| 119 | + strategy: |
| 120 | + matrix: |
| 121 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 122 | + steps: |
| 123 | + - uses: actions/checkout@v2 |
| 124 | + |
| 125 | + - name: Build wheels |
| 126 | + uses: joerick/cibuildwheel@v1.10.0 |
| 127 | + env: |
| 128 | + CIBW_ARCHS_MACOS: x86_64 universal2 |
| 129 | + CIBW_BUILD: "cp36-* cp37-* cp38-* cp39-*" |
| 130 | + CIBW_BEFORE_BUILD: "pip install numpy==1.18 cython" #make sure numpy is the same version as required by LS |
| 131 | + |
| 132 | + - name: Publish wheels to PyPI |
| 133 | + env: |
| 134 | + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} |
| 135 | + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} |
| 136 | + run : | |
| 137 | + pip install twine |
| 138 | + python -m twine upload ./wheelhouse/*.whl |
0 commit comments