forked from anoma/ferveo
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from nucypher/client-server-api
Update client and server APIs
- Loading branch information
Showing
79 changed files
with
11,626 additions
and
2,779 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
# Adopted from: https://github.com/nucypher/rust-umbral/blob/master/.github/workflows/wheels.yml | ||
|
||
name: Wheels | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-latest, windows-latest, macos-latest, macos-11 ] | ||
|
||
env: | ||
CIBW_BUILD_VERBOSITY: 1 | ||
CIBW_BEFORE_ALL_LINUX: "curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y && yum install -y openssl-devel" | ||
CIBW_BEFORE_BUILD_LINUX: "pip3 install --upgrade keyrings.alt" | ||
CIBW_ARCHS_LINUX: "x86_64" | ||
CIBW_ENVIRONMENT: 'PATH="$PATH:$HOME/.cargo/bin"' | ||
CIBW_SKIP: "cp36-* pp* *-win32 *musllinux*" # only using manylinux to build | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
- if: runner.os == 'Windows' | ||
run: | | ||
echo 'PATH=/c/Python38:/c/Python38/Scripts:/c/Strawberry/perl/site/bin:/c/Strawberry/perl/bin:/c/Strawberry/c/bin:$PATH' >> $GITHUB_ENV | ||
echo 'RUSTFLAGS=-Ctarget-feature=+crt-static' >> $GITHUB_ENV | ||
echo 'RUSTFLAGS=-Ctarget-feature=+crt-static' >> $GITHUB_ENV | ||
echo 'CIBW_BEFORE_BUILD=python -m pip install --upgrade pip' >> $GITHUB_ENV | ||
- if: runner.os != 'Linux' | ||
name: Setup env when not using docker | ||
run: | | ||
python -m pip install --upgrade wheel setuptools setuptools-rust | ||
- if: runner.os == 'Linux' | ||
name: Set up QEMU | ||
id: qemu | ||
uses: docker/setup-qemu-action@v1 | ||
with: | ||
image: tonistiigi/binfmt:latest | ||
platforms: arm64 | ||
|
||
- uses: actions/setup-python@v2 | ||
name: Install Python | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Install cibuildwheel | ||
run: | | ||
# Install cibuildwheel from git for CIBW_ARCHS_LINUX support | ||
python -m pip install cibuildwheel==2.9.0 | ||
- if: runner.os == 'Linux' | ||
run: | | ||
cp -r ./ferveo ./ferveo-python/ferveo | ||
cp -r ./ferveo-common ./ferveo-python/ferveo-common | ||
cp -r ./tpke ./ferveo-python/tpke | ||
- if: runner.os == 'Linux' | ||
working-directory: ./ferveo-python | ||
name: Relocate dependencies in cargo.toml | ||
run: | | ||
sed -i 's/..\/ferveo/.\/ferveo/g' Cargo.toml | ||
sed -i 's/..\/tpke/.\/tpke/g' Cargo.toml | ||
- name: Build wheels | ||
working-directory: ./ferveo-python | ||
run: | | ||
pwd | ||
ls -la | ||
cd ferveo-python && python -m cibuildwheel --output-dir wheelhouse | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: ./ferveo-python/wheelhouse/*.whl | ||
|
||
build_sdist: | ||
name: Build source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-python@v2 | ||
name: Install Python | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Install setuptools and setuptools-rust | ||
working-directory: ./ferveo-python | ||
run: | | ||
python -m pip install --upgrade wheel setuptools setuptools-rust | ||
# Assuming here that the version of the Python bindings | ||
# is matched to the version of the main Rust crate (as it should be at all times), | ||
# and we are running this at a release commit. | ||
- name: Replace the relative path to `ferveo` in Cargo.toml with the specific version | ||
working-directory: ./ferveo-python | ||
run: python replace_version.py relative-to-published | ||
|
||
- name: Build sdist | ||
working-directory: ./ferveo-python | ||
run: python setup.py sdist | ||
|
||
# Roll back the changes | ||
- name: Replace the specific version of `ferveo` in Cargo.toml with the relative path | ||
if: always() | ||
working-directory: ./ferveo-python | ||
run: python replace_version.py published-to-relative | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
path: ./ferveo-python/dist/*.tar.gz | ||
|
||
upload_pypi: | ||
needs: [ build_wheels, build_sdist ] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: artifact | ||
path: dist | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: artifact | ||
path: wheelhouse | ||
|
||
- uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.pypi_password }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.