update docker image #240
Workflow file for this run
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
name: Manylinux | |
on: | |
push: | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
manylinux: | |
strategy: | |
matrix: | |
python_path: [ cp37-cp37m, cp38-cp38, cp39-cp39, cp310-cp310 ] | |
manylinux_image: [ keyvidev/manylinux-builder-x86_64, keyvidev/manylinux-builder-aarch64 ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- uses: actions/checkout@v2 | |
- name: Build manylinux package | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: ${{ matrix.manylinux_image }} | |
options: -v ${{ github.workspace }}:/repo -e PYTHON_PATH=${{ matrix.python_path }} | |
run: | | |
cd /repo/python | |
PYBIN=/opt/python/${PYTHON_PATH}/bin | |
${PYBIN}/pip install -r requirements.txt | |
# Build | |
${PYBIN}/python setup.py bdist_wheel -d dist | |
# Bundle external shared libraries into the wheels | |
for wheel in dist/*.whl; do | |
auditwheel repair ${wheel} -w wheelhouse/ | |
done | |
# Install and test | |
${PYBIN}/pip install keyvi --no-index -f wheelhouse/ | |
cd ~ | |
${PYBIN}/py.test /repo/python/tests/ | |
${PYBIN}/py.test /repo/python/integration-tests/ | |
- name: Publish package | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: ${{ matrix.manylinux_image }} | |
options: -v ${{ github.workspace }}:/repo -e PYTHON_PATH=${{ matrix.python_path }} -e PYPI_PASSWORD=${{ secrets.pypi_password }} | |
run: | | |
PYBIN=/opt/python/${PYTHON_PATH}/bin | |
${PYBIN}/pip install twine | |
${PYBIN}/python -m twine upload -u __token__ -p "${PYPI_PASSWORD}" /repo/python/wheelhouse/* |