|
10 | 10 | branches:
|
11 | 11 | - master
|
12 | 12 |
|
13 |
| -concurrency: |
14 |
| - group: build-${{ github.head_ref }} |
15 |
| - |
16 | 13 | jobs:
|
17 |
| - build_wheels: |
18 |
| - name: Build wheels on ${{ matrix.os }} |
| 14 | + binary-wheels-standard: |
| 15 | + name: Binary wheels for ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} |
19 | 16 | runs-on: ${{ matrix.os }}
|
20 | 17 | strategy:
|
| 18 | + fail-fast: false |
21 | 19 | matrix:
|
22 | 20 | os: [ubuntu-latest, windows-latest, macos-latest]
|
23 | 21 |
|
24 | 22 | steps:
|
25 |
| - - uses: actions/checkout@v3 |
| 23 | + - uses: actions/checkout@v2 |
| 24 | + with: |
| 25 | + # Fetch all tags |
| 26 | + fetch-depth: 0 |
| 27 | + |
| 28 | + - name: Build wheels |
| 29 | + |
| 30 | + env: |
| 31 | + CIBW_ARCHS_MACOS: x86_64 |
| 32 | + HATCH_BUILD_HOOKS_ENABLE: "true" |
| 33 | + |
| 34 | + - uses: actions/upload-artifact@v2 |
| 35 | + with: |
| 36 | + name: artifacts |
| 37 | + path: wheelhouse/*.whl |
| 38 | + if-no-files-found: error |
| 39 | + |
| 40 | + pure-python-wheel-and-sdist: |
| 41 | + name: Build a pure Python wheel and source distribution |
| 42 | + runs-on: ubuntu-latest |
| 43 | + |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@v2 |
| 46 | + with: |
| 47 | + # Fetch all tags |
| 48 | + fetch-depth: 0 |
| 49 | + |
| 50 | + - name: Install build dependencies |
| 51 | + run: python -m pip install --upgrade build |
| 52 | + |
| 53 | + - name: Build |
| 54 | + run: python -m build |
| 55 | + |
| 56 | + - uses: actions/upload-artifact@v2 |
| 57 | + with: |
| 58 | + name: artifacts |
| 59 | + path: dist/* |
| 60 | + if-no-files-found: error |
| 61 | + |
| 62 | + binary-wheels-arm: |
| 63 | + name: Build Linux wheels for ARM |
| 64 | + runs-on: ubuntu-latest |
| 65 | + # Very slow, no need to run on PRs |
| 66 | + if: > |
| 67 | + github.event_name == 'push' |
| 68 | + && |
| 69 | + (github.ref == 'refs/heads/master' || startsWith(github.event.ref, 'refs/tags')) |
| 70 | + steps: |
| 71 | + - uses: actions/checkout@v2 |
| 72 | + with: |
| 73 | + # Fetch all tags |
| 74 | + fetch-depth: 0 |
| 75 | + |
| 76 | + - name: Set up QEMU |
| 77 | + uses: docker/setup-qemu-action@v1 |
| 78 | + with: |
| 79 | + platforms: arm64 |
26 | 80 |
|
27 | 81 | - name: Build wheels
|
28 |
| - |
29 |
| - # env: |
30 |
| - # CIBW_SOME_OPTION: value |
31 |
| - # ... |
32 |
| - # with: |
33 |
| - # package-dir: . |
34 |
| - # output-dir: wheelhouse |
35 |
| - # config-file: "{package}/pyproject.toml" |
| 82 | + |
| 83 | + env: |
| 84 | + CIBW_ARCHS_LINUX: aarch64 |
| 85 | + HATCH_BUILD_HOOKS_ENABLE: "true" |
36 | 86 |
|
37 |
| - - uses: actions/upload-artifact@v3 |
| 87 | + - uses: actions/upload-artifact@v2 |
38 | 88 | with:
|
39 |
| - path: ./wheelhouse/*.whl |
| 89 | + name: artifacts |
| 90 | + path: wheelhouse/*.whl |
| 91 | + if-no-files-found: error |
40 | 92 |
|
41 | 93 | publish:
|
42 | 94 | name: Publish release
|
43 | 95 | needs:
|
44 |
| - - build |
| 96 | + - binary-wheels-standard |
| 97 | + - pure-python-wheel-and-sdist |
| 98 | + - binary-wheels-arm |
45 | 99 | runs-on: ubuntu-latest
|
| 100 | + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') |
46 | 101 |
|
47 | 102 | steps:
|
48 |
| - - uses: actions/download-artifact@v3 |
| 103 | + - uses: actions/download-artifact@v2 |
49 | 104 | with:
|
50 | 105 | name: artifacts
|
51 | 106 | path: dist
|
52 | 107 |
|
53 | 108 | - name: Push build artifacts to PyPI
|
54 |
| - uses: pypa/gh-action-pypi-publish@v1.5.1 |
| 109 | + uses: pypa/gh-action-pypi-publish@v1.4.2 |
55 | 110 | with:
|
56 | 111 | skip_existing: true
|
57 | 112 | user: __token__
|
|
0 commit comments