This commit is contained in:
Jack Robison 2021-11-09 13:36:14 -05:00
parent ab449ca78b
commit ca96633652
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
4 changed files with 58 additions and 94 deletions

View file

@ -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 }}

View file

@ -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

1
scripts/build.sh Executable file
View file

@ -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

View file

@ -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 -