diff options
| author | Árni Dagur <agudmundsson@fc-md.umd.edu> | 2020-03-30 02:21:32 -0400 |
|---|---|---|
| committer | Árni Dagur <agudmundsson@fc-md.umd.edu> | 2020-03-30 02:21:32 -0400 |
| commit | d697bf7ee74e0e3dc476c176a392269530ff6c74 (patch) | |
| tree | fbd30da436ac1a2231d0d0e6a95e2e19252ecd45 /.github/workflows | |
| parent | c6f799aad0f16a9ddb91143c421cbfe642ab9740 (diff) | |
Yoink Hyperjson's deployment code
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/ci.yml | 71 |
1 files changed, 70 insertions, 1 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24f06e1..8d01138 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml | |||
| @@ -69,4 +69,73 @@ jobs: | |||
| 69 | override: true | 69 | override: true |
| 70 | 70 | ||
| 71 | - name: Build Python package | 71 | - name: Build Python package |
| 72 | run: poetry run maturin develop --release \ No newline at end of file | 72 | run: poetry run maturin develop --release |
| 73 | |||
| 74 | python-publish: | ||
| 75 | needs: build | ||
| 76 | runs-on: ${{ matrix.os }} | ||
| 77 | strategy: | ||
| 78 | fail-fast: false | ||
| 79 | matrix: | ||
| 80 | python-version: [3.5, 3.6, 3.7, 3.8] | ||
| 81 | os: [ubuntu-latest, macos-latest, windows-latest] | ||
| 82 | exclude: | ||
| 83 | # There is a known issue where Python C extensions | ||
| 84 | # can not be built on Python 3.5 on Windows. | ||
| 85 | # https://github.com/actions/virtual-environments/issues/34 | ||
| 86 | # Therefore, ujson can't be compiled and the build would fail. | ||
| 87 | - os: windows-latest | ||
| 88 | python-version: 3.5 | ||
| 89 | steps: | ||
| 90 | - uses: actions/checkout@v1 | ||
| 91 | |||
| 92 | - uses: actions/setup-python@v1 | ||
| 93 | with: | ||
| 94 | python-version: ${{ matrix.python-version }} | ||
| 95 | |||
| 96 | - name: Install latest nightly | ||
| 97 | uses: actions-rs/toolchain@v1 | ||
| 98 | with: | ||
| 99 | toolchain: nightly | ||
| 100 | override: true | ||
| 101 | |||
| 102 | - name: Install dependencies | ||
| 103 | run: | | ||
| 104 | python -m pip install --upgrade pip | ||
| 105 | pip install poetry | ||
| 106 | poetry install | ||
| 107 | - name: Build Python package | ||
| 108 | run: poetry run maturin build --release --no-sdist --strip --interpreter python${{matrix.python_version}} | ||
| 109 | |||
| 110 | - name: List wheels | ||
| 111 | if: matrix.os == 'windows-latest' | ||
| 112 | run: dir target\wheels\ | ||
| 113 | |||
| 114 | - name: List wheels | ||
| 115 | if: matrix.os != 'windows-latest' | ||
| 116 | run: find ./target/wheels/ | ||
| 117 | |||
| 118 | # Note: Windows doesn't support glob | ||
| 119 | # https://stackoverflow.com/a/52481267/270334 | ||
| 120 | - name: Install wheels | ||
| 121 | if: matrix.os == 'windows-latest' | ||
| 122 | run: pip install --find-links=target\wheels adblock | ||
| 123 | |||
| 124 | - name: Install wheels | ||
| 125 | if: matrix.os != 'windows-latest' | ||
| 126 | run: pip install target/wheels/adblock*.whl | ||
| 127 | |||
| 128 | - name: Release | ||
| 129 | uses: softprops/action-gh-release@v1 | ||
| 130 | if: startsWith(github.ref, 'refs/tags/') | ||
| 131 | with: | ||
| 132 | files: target/wheels/adblock*.whl | ||
| 133 | env: | ||
| 134 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| 135 | |||
| 136 | - name: PyPi publish | ||
| 137 | if: github.event_name == 'release' && github.event.action == 'created' | ||
| 138 | env: | ||
| 139 | MATURIN_PASSWORD: ${{ secrets.PYPI }} | ||
| 140 | run: poetry run maturin publish --username __token__ | ||
| 141 | |||
