|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: ["v*"] |
| 6 | + |
| 7 | +jobs: |
| 8 | + linux: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + steps: |
| 11 | + - uses: actions/checkout@v2 |
| 12 | + - uses: actions/setup-python@v2 |
| 13 | + with: |
| 14 | + python-version: 3.9 |
| 15 | + - name: Build Wheels |
| 16 | + uses: messense/maturin-action@v1 |
| 17 | + with: |
| 18 | + manylinux: auto |
| 19 | + command: build |
| 20 | + args: --release --out dist --no-sdist |
| 21 | + - name: Upload wheels |
| 22 | + uses: actions/upload-artifact@v2 |
| 23 | + with: |
| 24 | + name: dist |
| 25 | + path: dist |
| 26 | + |
| 27 | + macos: |
| 28 | + runs-on: macos-latest |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@v2 |
| 31 | + - uses: actions/setup-python@v2 |
| 32 | + with: |
| 33 | + python-version: 3.9 |
| 34 | + architecture: x64 |
| 35 | + - name: Install Rust toolchain |
| 36 | + uses: actions-rs/toolchain@v1 |
| 37 | + with: |
| 38 | + toolchain: stable |
| 39 | + profile: minimal |
| 40 | + default: true |
| 41 | + - name: Build wheels - x86_64 |
| 42 | + uses: messense/maturin-action@v1 |
| 43 | + with: |
| 44 | + target: x86_64 |
| 45 | + args: --release --out dist --no-sdist |
| 46 | + - name: Build wheels - universal2 |
| 47 | + uses: messense/maturin-action@v1 |
| 48 | + with: |
| 49 | + args: --release --universal2 --out dist --no-sdist |
| 50 | + - name: Upload wheels |
| 51 | + uses: actions/upload-artifact@v2 |
| 52 | + with: |
| 53 | + name: dist |
| 54 | + path: dist |
| 55 | + |
| 56 | + windows: |
| 57 | + runs-on: windows-latest |
| 58 | + strategy: |
| 59 | + matrix: |
| 60 | + target: [x64, x86] |
| 61 | + steps: |
| 62 | + - uses: actions/checkout@v2 |
| 63 | + - uses: actions/setup-python@v2 |
| 64 | + with: |
| 65 | + python-version: 3.9 |
| 66 | + architecture: ${{ matrix.target }} |
| 67 | + - name: Install Rust toolchain |
| 68 | + uses: actions-rs/toolchain@v1 |
| 69 | + with: |
| 70 | + toolchain: stable |
| 71 | + profile: minimal |
| 72 | + default: true |
| 73 | + - name: Build wheels |
| 74 | + uses: messense/maturin-action@v1 |
| 75 | + with: |
| 76 | + target: ${{ matrix.target }} |
| 77 | + args: --release --out dist --no-sdist |
| 78 | + - name: Upload wheels |
| 79 | + uses: actions/upload-artifact@v2 |
| 80 | + with: |
| 81 | + name: dist |
| 82 | + path: dist |
| 83 | + |
| 84 | + deploy-pypi: |
| 85 | + name: Publish wheels to PyPI and TestPyPI |
| 86 | + runs-on: ubuntu-latest |
| 87 | + needs: [linux, windows, macos] |
| 88 | + steps: |
| 89 | + - uses: actions/download-artifact@v2 |
| 90 | + with: |
| 91 | + name: dist |
| 92 | + path: dist |
| 93 | + - uses: actions/setup-python@v2 |
| 94 | + with: |
| 95 | + python-version: 3.9 |
| 96 | + - name: Publish to PyPi |
| 97 | + env: |
| 98 | + TWINE_USERNAME: __token__ |
| 99 | + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} |
| 100 | + run: | |
| 101 | + pip install --upgrade twine |
| 102 | + twine upload --skip-existing dist/* |
| 103 | +
|
| 104 | + build-documentation: |
| 105 | + runs-on: ubuntu-latest |
| 106 | + steps: |
| 107 | + - uses: actions/checkout@v2 |
| 108 | + - name: Setup python |
| 109 | + uses: actions/setup-python@v2 |
| 110 | + with: |
| 111 | + python-version: 3.9 |
| 112 | + - name: Install pandoc |
| 113 | + run: sudo apt-get install -y pandoc |
| 114 | + - name: Install python dependencies |
| 115 | + run: | |
| 116 | + pip install sphinx sphinx-bootstrap-theme nbsphinx ipython pygments |
| 117 | + - name: Build Wheels |
| 118 | + uses: messense/maturin-action@v1 |
| 119 | + with: |
| 120 | + manylinux: auto |
| 121 | + command: build |
| 122 | + args: --release --out dist --no-sdist |
| 123 | + - name: Install module |
| 124 | + run: | |
| 125 | + pip install feos --no-index --find-links dist --force-reinstall |
| 126 | + - name: Build documentation |
| 127 | + run: sphinx-build docs/ public/ -b html |
| 128 | + - name: Upload artifacts |
| 129 | + uses: actions/upload-artifact@v2 |
| 130 | + with: |
| 131 | + name: documentation |
| 132 | + path: public |
| 133 | + |
| 134 | + release-documentation: |
| 135 | + needs: [build-documentation] |
| 136 | + runs-on: ubuntu-latest |
| 137 | + steps: |
| 138 | + - name: Download artifacts |
| 139 | + uses: actions/download-artifact@v1 |
| 140 | + with: |
| 141 | + name: documentation |
| 142 | + path: public |
| 143 | + - name: Deploy documentation to gh-pages |
| 144 | + uses: peaceiris/actions-gh-pages@v3 |
| 145 | + with: |
| 146 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 147 | + publish_dir: ./public |
0 commit comments