|
6 | 6 |
|
7 | 7 | jobs: |
8 | 8 | build_wheels: |
9 | | - name: Build wheels on ${{ matrix.os }} |
| 9 | + name: Build wheels for cp${{ matrix.python }}-${{ matrix.platform_id }} |
10 | 10 | runs-on: ${{ matrix.os }} |
11 | 11 | strategy: |
| 12 | + fail-fast: false |
12 | 13 | matrix: |
13 | | - os: [ubuntu-18.04] #, windows-latest, macos-latest] |
14 | | - |
| 14 | + include: |
| 15 | + # linux-64 |
| 16 | + - os: ubuntu-latest |
| 17 | + python: 310 |
| 18 | + platform_id: manylinux_x86_64 |
| 19 | + dp_variant: cuda |
| 20 | + # macos-x86-64 |
| 21 | + - os: macos-latest |
| 22 | + python: 310 |
| 23 | + platform_id: macosx_x86_64 |
| 24 | + dp_variant: cpu |
| 25 | + # win-64 |
| 26 | + - os: windows-2019 |
| 27 | + python: 310 |
| 28 | + platform_id: win_amd64 |
| 29 | + dp_variant: cpu |
| 30 | + # linux-aarch64 |
| 31 | + - os: ubuntu-latest |
| 32 | + python: 310 |
| 33 | + platform_id: manylinux_aarch64 |
| 34 | + dp_variant: cpu |
15 | 35 | steps: |
16 | | - - name: work around permission issue |
17 | | - run: git config --global --add safe.directory /__w/deepmd-kit/deepmd-kit |
18 | 36 | - uses: actions/checkout@v2 |
| 37 | + with: |
| 38 | + submodules: true |
| 39 | + - uses: docker/setup-qemu-action@v2 |
| 40 | + name: Setup QEMU |
| 41 | + if: matrix.platform_id == 'manylinux_aarch64' |
19 | 42 | - uses: actions/setup-python@v2 |
20 | 43 | name: Install Python |
21 | 44 | with: |
22 | 45 | python-version: '3.8' |
23 | 46 |
|
24 | | - - name: Install cibuildwheel |
25 | | - run: | |
26 | | - python -m pip install cibuildwheel |
27 | | -
|
| 47 | + - run: python -m pip install cibuildwheel==2.11.3 |
28 | 48 | - name: Build wheels |
| 49 | + run: python -m cibuildwheel --output-dir wheelhouse |
29 | 50 | env: |
30 | | - CIBW_BUILD: "cp36-* cp37-* cp38-* cp39-* cp310-*" |
31 | | - CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/deepmodeling/manylinux_2_28_x86_64_tensorflow |
32 | | - CIBW_BEFORE_BUILD: pip install tensorflow |
33 | | - CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux*" |
34 | | - run: | |
35 | | - python -m cibuildwheel --output-dir wheelhouse |
| 51 | + CIBW_BUILD_VERBOSITY: 1 |
| 52 | + CIBW_ARCHS: all |
| 53 | + CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }} |
| 54 | + DP_VARIANT: ${{ matrix.dp_variant }} |
36 | 55 | - uses: actions/upload-artifact@v2 |
37 | 56 | with: |
38 | 57 | path: ./wheelhouse/*.whl |
39 | | - |
40 | 58 | build_sdist: |
41 | 59 | name: Build source distribution |
42 | 60 | runs-on: ubuntu-latest |
43 | 61 | steps: |
44 | | - - uses: actions/checkout@v2 |
45 | | - - uses: actions/setup-python@v2 |
| 62 | + - uses: actions/checkout@v3 |
| 63 | + with: |
| 64 | + submodules: true |
| 65 | + - uses: actions/setup-python@v4 |
46 | 66 | name: Install Python |
47 | 67 | with: |
48 | | - python-version: '3.8' |
49 | | - - run: pip install -U scikit-build tensorflow setuptools_scm |
| 68 | + python-version: '3.10' |
| 69 | + - run: python -m pip install build |
50 | 70 | - name: Build sdist |
51 | | - run: python setup.py sdist |
| 71 | + run: python -m build --sdist |
52 | 72 |
|
53 | | - - uses: actions/upload-artifact@v2 |
| 73 | + - uses: actions/upload-artifact@v3 |
54 | 74 | with: |
55 | 75 | path: dist/*.tar.gz |
56 | 76 |
|
57 | 77 | upload_pypi: |
58 | 78 | needs: [build_wheels, build_sdist] |
59 | 79 | runs-on: ubuntu-latest |
60 | | - if: startsWith(github.event.ref, 'refs/tags/v') |
| 80 | + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') |
61 | 81 | steps: |
62 | | - - uses: actions/download-artifact@v2 |
| 82 | + - uses: actions/download-artifact@v3 |
63 | 83 | with: |
64 | 84 | name: artifact |
65 | 85 | path: dist |
66 | | - |
67 | 86 | - uses: pypa/gh-action-pypi-publish@master |
68 | 87 | with: |
69 | 88 | user: __token__ |
|
0 commit comments