Skip to content

Commit

Permalink
Use CIBW to build wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
hekaisheng committed Mar 14, 2022
2 parents 20b391c + 4bb47dc commit 4cfabad
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 231 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/build-wheels.sh

This file was deleted.

58 changes: 0 additions & 58 deletions .github/workflows/ci.yml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/workflows/install-conda.sh

This file was deleted.

80 changes: 80 additions & 0 deletions .github/workflows/pypi-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: PyODPS CD for PyPI

on:
push:
tags:
- '*'

jobs:
build:
name: Build wheels on ${{ matrix.os }} for ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
arch: [auto]
include:
- os: ubuntu-latest
arch: aarch64
- os: macos-latest
arch: universal2

steps:
- name: Check out code
uses: actions/checkout@v2

- name: Set up QEMU
if: ${{ matrix.arch == 'aarch64' }}
uses: docker/setup-qemu-action@v1

- name: Build wheels
uses: pypa/cibuildwheel@v1.11.1
env:
CIBW_BEFORE_BUILD: pip install -r requirements-wheel.txt
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_SKIP: pp* *-musllinux* *i686 cp35-manylinux_aarch64 cp36-manylinux_aarch64
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014

- name: Build wheels (Python 3.10)
uses: pypa/cibuildwheel@v2.3.1
env:
CIBW_BEFORE_BUILD: pip install -r requirements-wheel.txt
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_SKIP: pp* *-musllinux* *i686 cp36-* cp37-* cp38-* cp39-*
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014

- name: Build source
if: ${{ matrix.os == 'ubuntu-latest' && matrix.arch == 'auto'}}
run: |
pip install -r requirements-wheel.txt
python setup.py sdist --formats=gztar --dist-dir=./wheelhouse
- name: Release to pypi
shell: bash
env:
PYPI_PWD: ${{ secrets.PYPI_PASSWORD }}
run: |
if [[ "$GITHUB_REPOSITORY" == "aliyun/aliyun-odps-python-sdk" ]]; then
PYPI_REPO="https://upload.pypi.org/legacy/"
else
PYPI_REPO="https://test.pypi.org/legacy/"
fi
echo "[distutils]" > ~/.pypirc
echo "index-servers =" >> ~/.pypirc
echo " pypi" >> ~/.pypirc
echo "[pypi]" >> ~/.pypirc
echo "repository=$PYPI_REPO" >> ~/.pypirc
echo "username=pyodps" >> ~/.pypirc
echo "password=$PYPI_PWD" >> ~/.pypirc
python -m pip install twine
python -m twine upload -r pypi --skip-existing wheelhouse/*
- name: Upload artifacts to github
uses: actions/upload-artifact@v1
if: ${{ always() }}
with:
name: wheels
path: ./wheelhouse
32 changes: 0 additions & 32 deletions .github/workflows/reload-env.sh

This file was deleted.

73 changes: 0 additions & 73 deletions .github/workflows/upload-packages.sh

This file was deleted.

5 changes: 3 additions & 2 deletions requirements-wheel.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
numpy==1.14.5
cython==0.29.3
numpy==1.14.5; python_version<='3.7' and platform_machine!='aarch64'
oldest-supported-numpy; python_version>'3.7' and platform_machine=='aarch64'
cython==0.29.26
requests>=2.4.0

0 comments on commit 4cfabad

Please sign in to comment.