commit d697bf7ee74e0e3dc476c176a392269530ff6c74
parent c6f799aad0f16a9ddb91143c421cbfe642ab9740
Author: Árni Dagur <agudmundsson@fc-md.umd.edu>
Date: Mon, 30 Mar 2020 02:21:32 -0400
Yoink Hyperjson's deployment code
Diffstat:
1 file changed, 70 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
@@ -69,4 +69,73 @@ jobs:
override: true
- name: Build Python package
- run: poetry run maturin develop --release
-\ No newline at end of file
+ run: poetry run maturin develop --release
+
+ python-publish:
+ needs: build
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ python-version: [3.5, 3.6, 3.7, 3.8]
+ os: [ubuntu-latest, macos-latest, windows-latest]
+ exclude:
+ # There is a known issue where Python C extensions
+ # can not be built on Python 3.5 on Windows.
+ # https://github.com/actions/virtual-environments/issues/34
+ # Therefore, ujson can't be compiled and the build would fail.
+ - os: windows-latest
+ python-version: 3.5
+ steps:
+ - uses: actions/checkout@v1
+
+ - uses: actions/setup-python@v1
+ with:
+ python-version: ${{ matrix.python-version }}
+
+ - name: Install latest nightly
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: nightly
+ override: true
+
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install poetry
+ poetry install
+ - name: Build Python package
+ run: poetry run maturin build --release --no-sdist --strip --interpreter python${{matrix.python_version}}
+
+ - name: List wheels
+ if: matrix.os == 'windows-latest'
+ run: dir target\wheels\
+
+ - name: List wheels
+ if: matrix.os != 'windows-latest'
+ run: find ./target/wheels/
+
+ # Note: Windows doesn't support glob
+ # https://stackoverflow.com/a/52481267/270334
+ - name: Install wheels
+ if: matrix.os == 'windows-latest'
+ run: pip install --find-links=target\wheels adblock
+
+ - name: Install wheels
+ if: matrix.os != 'windows-latest'
+ run: pip install target/wheels/adblock*.whl
+
+ - name: Release
+ uses: softprops/action-gh-release@v1
+ if: startsWith(github.ref, 'refs/tags/')
+ with:
+ files: target/wheels/adblock*.whl
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: PyPi publish
+ if: github.event_name == 'release' && github.event.action == 'created'
+ env:
+ MATURIN_PASSWORD: ${{ secrets.PYPI }}
+ run: poetry run maturin publish --username __token__
+