|
7 | 7 |
|
8 | 8 | jobs: |
9 | 9 | build: |
| 10 | + name: Build wheels on ${{ matrix.os }} for ${{ matrix.arch }} |
10 | 11 | runs-on: ${{ matrix.os }} |
11 | 12 | strategy: |
12 | 13 | fail-fast: false |
13 | 14 | matrix: |
14 | | - os: [ubuntu-latest, macOS-latest, windows-latest] |
15 | | - python-version: ["3.7", "3.8", "3.9", "3.10"] |
16 | | - node-version: ["14.x"] |
| 15 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 16 | + arch: [auto] |
17 | 17 | include: |
18 | | - - { os: ubuntu-latest, python-version: "3.7", python-abis: "cp37-cp37m" } |
19 | | - - { os: ubuntu-latest, python-version: "3.8", python-abis: "cp38-cp38" } |
20 | | - - { os: ubuntu-latest, python-version: "3.9", python-abis: "cp39-cp39" } |
21 | | - - { os: ubuntu-latest, python-version: "3.10", python-abis: "cp310-cp310" } |
22 | | - - { os: windows-latest, python-version: "3.10", build-static: 1 } |
| 18 | + - os: ubuntu-latest |
| 19 | + arch: aarch64 |
| 20 | + - os: macos-latest |
| 21 | + arch: universal2 |
23 | 22 |
|
24 | 23 | steps: |
25 | 24 | - name: Check out code |
26 | 25 | uses: actions/checkout@v2 |
27 | 26 |
|
28 | | - - name: Use Node.js ${{ matrix.node-version }} |
29 | | - uses: actions/setup-node@v2 |
30 | | - with: |
31 | | - node-version: ${{ matrix.node-version }} |
| 27 | + - name: Set up QEMU |
| 28 | + if: ${{ matrix.arch == 'aarch64' }} |
| 29 | + uses: docker/setup-qemu-action@v1 |
32 | 30 |
|
33 | | - - name: Set up conda ${{ matrix.python-version }} |
| 31 | + - name: Build wheels |
| 32 | + |
34 | 33 | env: |
35 | | - PYTHON: ${{ matrix.python-version }} |
36 | | - shell: bash |
37 | | - run: | |
38 | | - source ./ci/install-conda.sh |
39 | | - python -m pip install --upgrade pip setuptools wheel coverage; |
| 34 | + CIBW_BEFORE_BUILD: pip install -r ci/requirements-wheel.txt |
| 35 | + CIBW_ARCHS: ${{ matrix.arch }} |
| 36 | + CIBW_SKIP: pp* *-musllinux* cp36-* cp310-win32 *i686 cp310-manylinux_x86_64 |
| 37 | + CIBW_MANYLINUX_X86_64_IMAGE: manylinux1 |
| 38 | + CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014 |
40 | 39 |
|
41 | | - - name: Install dependencies |
| 40 | + - name: Build wheels (Python 3.10 x86_64) |
| 41 | + if: ${{ matrix.os == 'ubuntu-latest' && matrix.arch == 'auto'}} |
| 42 | + |
42 | 43 | env: |
43 | | - WITH_HADOOP: ${{ matrix.with-hadoop }} |
44 | | - WITH_KUBERNETES: ${{ matrix.with-kubernetes }} |
45 | | - NO_COMMON_TESTS: ${{ matrix.no-common-tests }} |
46 | | - shell: bash |
47 | | - run: | |
48 | | - source ./ci/reload-env.sh |
49 | | - export DEFAULT_VENV=$VIRTUAL_ENV |
| 44 | + CIBW_BEFORE_BUILD: pip install -r ci/requirements-wheel.txt |
| 45 | + CIBW_BUILD: cp310-manylinux_x86_64 |
| 46 | + CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 |
50 | 47 |
|
51 | | - if [[ "$PYTHON" =~ "3.9" ]]; then |
52 | | - conda install -n test --quiet --yes -c conda-forge python=$PYTHON pyarrow |
53 | | - fi |
54 | | -
|
55 | | - pip install numpy scipy cython |
56 | | - pip install -e ".[dev,extra]" |
57 | | - conda list -n test |
| 48 | + - name: Build source |
| 49 | + if: ${{ matrix.os == 'ubuntu-latest' && matrix.arch == 'auto'}} |
| 50 | + run: | |
| 51 | + pip install -r ci/requirements-wheel.txt |
| 52 | + python setup.py sdist --formats=gztar --dist-dir=./wheelhouse |
58 | 53 |
|
59 | | - - name: Deploy packages |
60 | | - if: startsWith(github.ref, 'refs/tags/') && matrix.no-deploy != '1' |
| 54 | + - name: Release to pypi |
61 | 55 | shell: bash |
62 | 56 | env: |
63 | | - PYABI: ${{ matrix.python-abis }} |
64 | | - BUILD_STATIC: ${{ matrix.build-static }} |
65 | 57 | PYPI_PWD: ${{ secrets.PYPI_PASSWORD }} |
66 | 58 | run: | |
67 | | - source ./ci/reload-env.sh |
68 | | - if [[ "$PYTHON" =~ "3.10" ]]; then |
69 | | - export DOCKER_IMAGE="quay.io/pypa/manylinux2014_x86_64" |
| 59 | + if [[ "$GITHUB_REPOSITORY" == "mars-project/mars" ]]; then |
| 60 | + PYPI_REPO="https://upload.pypi.org/legacy/" |
70 | 61 | else |
71 | | - export DOCKER_IMAGE="quay.io/pypa/manylinux1_x86_64" |
| 62 | + PYPI_REPO="https://test.pypi.org/legacy/" |
72 | 63 | fi |
73 | | - source ./.github/workflows/upload-packages.sh |
| 64 | + echo "[distutils]" > ~/.pypirc |
| 65 | + echo "index-servers =" >> ~/.pypirc |
| 66 | + echo " pypi" >> ~/.pypirc |
| 67 | + echo "[pypi]" >> ~/.pypirc |
| 68 | + echo "repository=$PYPI_REPO" >> ~/.pypirc |
| 69 | + echo "username=pyodps" >> ~/.pypirc |
| 70 | + echo "password=$PYPI_PWD" >> ~/.pypirc |
| 71 | + python -m pip install twine |
| 72 | + python -m twine upload -r pypi --skip-existing wheelhouse/* |
| 73 | +
|
| 74 | + - name: Upload artifacts to github |
| 75 | + uses: actions/upload-artifact@v1 |
| 76 | + with: |
| 77 | + name: wheels |
| 78 | + path: ./wheelhouse |
0 commit comments