|
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.6, 3.7, 3.8, 3.9] |
16 |
| - node-version: [14.x] |
17 |
| - include: |
18 |
| - - { os: ubuntu-latest, python-version: 3.6, python-abis: "cp36-cp36m" } |
19 |
| - - { os: ubuntu-latest, python-version: 3.7, python-abis: "cp37-cp37m" } |
20 |
| - - { os: ubuntu-latest, python-version: 3.8, python-abis: "cp38-cp38" } |
21 |
| - - { os: ubuntu-latest, python-version: 3.9, python-abis: "cp39-cp39" } |
22 |
| - - { os: windows-latest, python-version: 3.9, build-static: 1 } |
| 15 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 16 | + arch: [auto] |
23 | 17 |
|
24 | 18 | steps:
|
25 | 19 | - name: Check out code
|
26 | 20 | uses: actions/checkout@v2
|
27 | 21 |
|
28 |
| - - name: Use Node.js ${{ matrix.node-version }} |
29 |
| - uses: actions/setup-node@v2 |
30 |
| - with: |
31 |
| - node-version: ${{ matrix.node-version }} |
32 |
| - |
33 |
| - - name: Set up conda ${{ matrix.python-version }} |
| 22 | + - name: Build wheels |
| 23 | + uses: pypa/cibuildwheel@v2.3.1 |
34 | 24 | 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; |
| 25 | + CIBW_BEFORE_BUILD: git reset --hard && pip install -r ci/requirements-wheel.txt |
| 26 | + CIBW_ARCHS: ${{ matrix.arch }} |
| 27 | + CIBW_SKIP: pp* *-musllinux* cp310-* *i686 |
| 28 | + CIBW_MANYLINUX_X86_64_IMAGE: manylinux1 |
40 | 29 |
|
41 |
| - - name: Install dependencies |
42 |
| - env: |
43 |
| - WITH_HADOOP: ${{ matrix.with-hadoop }} |
44 |
| - WITH_KUBERNETES: ${{ matrix.with-kubernetes }} |
45 |
| - NO_COMMON_TESTS: ${{ matrix.no-common-tests }} |
46 |
| - shell: bash |
| 30 | + - name: Build source |
| 31 | + if: ${{ matrix.os == 'ubuntu-latest' && matrix.arch == 'auto'}} |
47 | 32 | run: |
|
48 |
| - source ./ci/reload-env.sh |
49 |
| - export DEFAULT_VENV=$VIRTUAL_ENV |
| 33 | + git reset --hard |
| 34 | + pip install -r ci/requirements-wheel.txt |
| 35 | + python setup.py sdist --formats=gztar --dist-dir=./wheelhouse |
50 | 36 |
|
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 |
58 |
| -
|
59 |
| - - name: Deploy packages |
60 |
| - if: startsWith(github.ref, 'refs/tags/') && matrix.no-deploy != '1' |
| 37 | + - name: Release to pypi |
61 | 38 | shell: bash
|
62 | 39 | env:
|
63 |
| - DOCKER_IMAGE: "quay.io/pypa/manylinux1_x86_64" |
64 |
| - PYABI: ${{ matrix.python-abis }} |
65 |
| - BUILD_STATIC: ${{ matrix.build-static }} |
66 | 40 | PYPI_PWD: ${{ secrets.PYPI_PASSWORD }}
|
67 | 41 | run: |
|
68 |
| - source ./ci/reload-env.sh |
69 |
| - source ./.github/workflows/upload-packages.sh |
| 42 | + if [[ "$GITHUB_REPOSITORY" == "mars-project/mars" ]]; then |
| 43 | + PYPI_REPO="https://upload.pypi.org/legacy/" |
| 44 | + else |
| 45 | + PYPI_REPO="https://test.pypi.org/legacy/" |
| 46 | + fi |
| 47 | + echo "[distutils]" > ~/.pypirc |
| 48 | + echo "index-servers =" >> ~/.pypirc |
| 49 | + echo " pypi" >> ~/.pypirc |
| 50 | + echo "[pypi]" >> ~/.pypirc |
| 51 | + echo "repository=$PYPI_REPO" >> ~/.pypirc |
| 52 | + echo "username=pyodps" >> ~/.pypirc |
| 53 | + echo "password=$PYPI_PWD" >> ~/.pypirc |
| 54 | + python -m pip install twine |
| 55 | + python -m twine upload -r pypi --skip-existing wheelhouse/* |
| 56 | +
|
| 57 | + - name: Upload artifacts to github |
| 58 | + uses: actions/upload-artifact@v1 |
| 59 | + with: |
| 60 | + name: wheels |
| 61 | + path: ./wheelhouse |
0 commit comments