From ca966336524e2aff06c561a02f0566342641c64d Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Tue, 9 Nov 2021 13:36:14 -0500 Subject: [PATCH] ci --- .github/workflows/build.yml | 124 +++++++++++++++--------------------- .travis.yml | 18 ------ scripts/build.sh | 1 + scripts/make-wheels.sh | 9 ++- 4 files changed, 58 insertions(+), 94 deletions(-) delete mode 100644 .travis.yml create mode 100755 scripts/build.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 317b8e7..ec777d7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,69 +2,13 @@ # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions name: build -# on: -# push: -# branches: -# - 'release/**' on: push: branches: - master -# release: -# types: -# - created jobs: -# wheel: -# runs-on: ${{ matrix.os }} -# strategy: -# fail-fast: false -# matrix: -# include: -# # MacOS -# - python: '3.6' -# os: macos-latest -# - python: '3.7' -# os: macos-latest -# - python: '3.8' -# os: macos-latest -# - python: '3.9' -# os: macos-latest -# steps: -# - uses: actions/checkout@v2 -# with: -# submodules: recursive -# - name: Cache .a files -# uses: actions/cache@v2 -# with: -# key: ${{ runner.os }} -# path: | -# src/rocksdb/libsnappy.a -# src/rocksdb/liblz4.a -# src/rocksdb/libbz2.a -# src/rocksdb/libzstd.a -# src/rocksdb/libz.a -# src/rocksdb/librocksdb.a -# - name: Setup python${{ matrix.python }} -# uses: actions/setup-python@v2 -# with: -# python-version: "${{ matrix.python }}" -# - name: Make static library files -# run: make -# - name: Install requires -# run: python -m pip install cython twine wheel -# - name: Build wheel for python "${{ matrix.python }}" -# run: python setup.py bdist_wheel -# - name: Publishing to pypi -# run: twine upload --skip-existing --disable-progress-bar dist/*.whl -# env: -# TWINE_USERNAME: __token__ -# TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} - linux: + manylinux: runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - python-version: [3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 with: @@ -80,24 +24,56 @@ jobs: src/rocksdb/libzstd.a src/rocksdb/libz.a src/rocksdb/librocksdb.a - - name: Make static library files - uses: docker://quay.io/pypa/manylinux2014_x86_64 + - name: Install requirements + run: sudo apt-get install build-essential binutils cmake + - name: Build wheels + run: /bin/bash scripts/build.sh + - uses: actions/upload-artifact@v2 with: - args: /usr/bin/make - - name: Install requires - run: python -m pip install cython twine wheel - - name: Building manylinux2014 wheels - uses: docker://quay.io/pypa/manylinux2014_x86_64 + name: wheels + path: dist/ + - name: Install twine + run: python -m pip install twine + macos: + strategy: + fail-fast: true + matrix: + python: + - 3.7 + - 3.8 + - 3.9 + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 with: - args: /bin/bash scripts/make-wheels.sh - - name: Setup python${{ matrix.python-version }} + submodules: recursive + - name: Cache .a files + uses: actions/cache@v2 + with: + key: ${{ runner.os }} + path: | + src/rocksdb/libsnappy.a + src/rocksdb/liblz4.a + src/rocksdb/libbz2.a + src/rocksdb/libzstd.a + src/rocksdb/libz.a + src/rocksdb/librocksdb.a + - name: Setup python${{ matrix.python }} uses: actions/setup-python@v2 with: - python-version: 3.9 -# - name: Install requires -# run: python -m pip install twine -# - name: Publishing to pypi -# run: twine upload --skip-existing --disable-progress-bar dist/*.whl -# env: -# TWINE_USERNAME: __token__ -# TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + python-version: "${{ matrix.python }}" + - name: Make static library files + run: make clean && make + - name: Install requires + run: python -m pip install cython twine wheel + - name: Build wheel + run: python setup.py bdist_wheel + - uses: actions/upload-artifact@v2 + with: + name: wheels + path: dist/ +# - name: Publishing to pypi +# run: twine upload --skip-existing --disable-progress-bar dist/*.whl +# env: +# TWINE_USERNAME: __token__ +# TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7c0446d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -sudo: required -dist: trusty -language: generic -services: - - docker - -cache: - directories: - - ~/.cache/pip - -install: - docker build . -t ci-image; -script: - docker run -v ~/.cache/pip:/home/tester/.cache/pip -v $(pwd):/home/tester/src ci-image:latest tox -e ${TOXENV} ; -env: - - TOXENV=py27 - - TOXENV=py36 - - TOXENV=docs diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 0000000..39bd77b --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1 @@ +docker run --rm -v $(pwd):/lbry-rocksdb quay.io/pypa/manylinux_2_24_x86_64 /bin/bash lbry-rocksdb/scripts/make-wheels.sh diff --git a/scripts/make-wheels.sh b/scripts/make-wheels.sh index b1e400c..c32c575 100644 --- a/scripts/make-wheels.sh +++ b/scripts/make-wheels.sh @@ -1,10 +1,14 @@ set -ex +apt install -y binutils cmake + +cd lbry-rocksdb mkdir -p dist -make +make clean && make + function build_wheel() { - /opt/python/$1/bin/pip install cython + /opt/python/$1/bin/pip install cython wheel /opt/python/$1/bin/pip wheel . -f . -w dist } @@ -17,4 +21,5 @@ cd dist for f in ./*linux_*; do if [ -f $f ]; then auditwheel repair $f -w . ; rm $f; fi; done +rm setuptools-*.whl cd -