|
7 | 7 |
|
8 | 8 | jobs: |
9 | 9 | build: |
10 | | - runs-on: ubuntu-latest |
| 10 | + strategy: |
| 11 | + matrix: |
| 12 | + include: |
| 13 | + - runner: ubuntu-latest |
| 14 | + arch: x86_64 |
| 15 | + - runner: ubuntu-24.04-arm |
| 16 | + arch: aarch64 |
| 17 | + runs-on: ${{ matrix.runner }} |
11 | 18 | steps: |
12 | 19 | - uses: actions/checkout@v4 |
13 | 20 |
|
@@ -35,30 +42,34 @@ jobs: |
35 | 42 | sudo apt-get update |
36 | 43 | sudo apt-get install -y musl-tools |
37 | 44 |
|
38 | | - - name: Build sdist and wheel |
| 45 | + - name: Build wheel |
39 | 46 | run: | |
40 | | - poetry build |
| 47 | + poetry build --format wheel |
41 | 48 |
|
42 | 49 | # The build script makes the wheel interpreter and platform specific |
43 | | - # (cp311-cp311-linux_x86_64), which PyPI rejects. The only native code |
| 50 | + # (cp311-cp311-linux_<arch>), which PyPI rejects. The only native code |
44 | 51 | # is the static kerf-init, so the wheel runs on any Python 3 and libc. |
45 | 52 | - name: Retag wheel for PyPI |
| 53 | + env: |
| 54 | + ARCH: ${{ matrix.arch }} |
46 | 55 | run: | |
47 | 56 | file src/kerf/data/kerf-init | grep -q "statically linked" |
48 | 57 | pip install wheel auditwheel |
49 | 58 | python -m wheel tags --remove --python-tag py3 --abi-tag none \ |
50 | | - --platform-tag manylinux_2_17_x86_64.manylinux2014_x86_64.musllinux_1_1_x86_64 \ |
| 59 | + --platform-tag "manylinux_2_17_$ARCH.manylinux2014_$ARCH.musllinux_1_1_$ARCH" \ |
51 | 60 | dist/*.whl |
52 | 61 | auditwheel show dist/*.whl |
53 | 62 |
|
54 | | - - name: Check the sdist builds a wheel |
| 63 | + - name: Build sdist |
| 64 | + if: matrix.arch == 'x86_64' |
55 | 65 | run: | |
| 66 | + poetry build --format sdist |
56 | 67 | pip wheel --no-deps -w /tmp/sdist-wheel dist/*.tar.gz |
57 | 68 |
|
58 | 69 | - name: Upload distributions |
59 | 70 | uses: actions/upload-artifact@v4 |
60 | 71 | with: |
61 | | - name: dist |
| 72 | + name: dist-${{ matrix.arch }} |
62 | 73 | path: dist/ |
63 | 74 |
|
64 | 75 | publish: |
|
73 | 84 | - name: Download distributions |
74 | 85 | uses: actions/download-artifact@v4 |
75 | 86 | with: |
76 | | - name: dist |
| 87 | + pattern: dist-* |
| 88 | + merge-multiple: true |
77 | 89 | path: dist/ |
78 | 90 |
|
79 | 91 | - name: Publish to PyPI |
|
88 | 100 | - name: Download distributions |
89 | 101 | uses: actions/download-artifact@v4 |
90 | 102 | with: |
91 | | - name: dist |
| 103 | + pattern: dist-* |
| 104 | + merge-multiple: true |
92 | 105 | path: dist/ |
93 | 106 |
|
94 | 107 | - name: Create GitHub release |
|
0 commit comments