|
1 | 1 | name: Build |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - pull_request: |
6 | | - release: |
7 | | - types: |
8 | | - - published |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + release: |
| 7 | + types: |
| 8 | + - published |
9 | 9 |
|
10 | 10 | env: |
11 | | - CIBW_ARCHS_MACOS: x86_64 arm64 |
12 | | - CIBW_BEFORE_BUILD_LINUX: "if command -v apk &> /dev/null; then apk add bsd-compat-headers; fi" |
| 11 | + CIBW_SKIP: cp36-* cp37-* cp38-* pp* *i686 *win32 |
| 12 | + |
| 13 | + # cibuildhweel macOS configuration |
| 14 | + CIBW_ARCHS_MACOS: native |
| 15 | + |
| 16 | + # cibuildhweel linux configuration |
| 17 | + CIBW_ARCHS_LINUX: x86_64 |
| 18 | + CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 |
| 19 | + CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_2 |
| 20 | + # On Linux, wheels are built inside a container on the GitHub runner (unlike macOS and Windows which use the GitHub runner directly) |
| 21 | + # Any build dependencies must thus be installed on the container (using CIBW_BEFORE_ALL_LINUX), *not* on the runner with the regular workflow |
| 22 | + # This command must be compatible with manylinux_2_28 (AlmaLinux 8) and musllinux_1_2 (Alpine Linux 3.20) |
| 23 | + CIBW_BEFORE_ALL_LINUX: if command -v apk &> /dev/null; then apk add bsd-compat-headers; fi |
| 24 | + CIBW_ENVIRONMENT_LINUX: 'PATH="$HOME/.cargo/bin:$PATH"' |
13 | 25 |
|
14 | 26 | jobs: |
15 | | - build_wheels: |
16 | | - name: Build wheels on ${{ matrix.os }} |
17 | | - runs-on: ${{ matrix.os }} |
18 | | - strategy: |
19 | | - matrix: |
20 | | - os: [ubuntu-22.04, macos-12] |
21 | | - steps: |
22 | | - - uses: actions/checkout@v4 |
23 | | - with: |
24 | | - submodules: true |
25 | | - - name: Build wheels |
26 | | - |
27 | | - - uses: actions/upload-artifact@v3 |
28 | | - with: |
29 | | - path: ./wheelhouse/*.whl |
30 | | - build_sdist: |
31 | | - name: Build source distribution |
32 | | - runs-on: ubuntu-22.04 |
33 | | - steps: |
34 | | - - uses: actions/checkout@v4 |
35 | | - with: |
36 | | - submodules: true |
37 | | - - name: Build sdist |
38 | | - run: pipx run build --sdist |
39 | | - - uses: actions/upload-artifact@v3 |
40 | | - with: |
41 | | - path: dist/*.tar.gz |
42 | | - upload_pypi: |
43 | | - needs: [build_wheels, build_sdist] |
44 | | - runs-on: ubuntu-22.04 |
45 | | - if: github.event_name == 'release' && github.event.action == 'published' |
46 | | - steps: |
47 | | - - uses: actions/download-artifact@v3 |
48 | | - with: |
49 | | - name: artifact |
50 | | - path: dist |
51 | | - |
52 | | - with: |
53 | | - password: ${{ secrets.PYPI_API_TOKEN }} |
| 27 | + build_wheels: |
| 28 | + name: Build wheels on ${{ matrix.os }} |
| 29 | + runs-on: ${{ matrix.os }} |
| 30 | + strategy: |
| 31 | + matrix: |
| 32 | + # macos-13 is an Intel runner, macos-latest is an ARM runner |
| 33 | + os: [macos-13, macos-latest, ubuntu-latest] |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v4 |
| 36 | + with: |
| 37 | + submodules: true |
| 38 | + - run: cd astrometry.net && git apply ../astrometry.net.patch |
| 39 | + - run: python -m pip install cibuildwheel==2.21.3 |
| 40 | + - run: python -m cibuildwheel |
| 41 | + - uses: actions/upload-artifact@v4 |
| 42 | + with: |
| 43 | + name: ${{ matrix.os }} |
| 44 | + path: wheelhouse |
| 45 | + test_library: |
| 46 | + name: Test library on ${{ matrix.os }} with Python ${{ matrix.python }} |
| 47 | + runs-on: ${{ matrix.os }} |
| 48 | + needs: [build_wheels] |
| 49 | + strategy: |
| 50 | + matrix: |
| 51 | + python: ["3.9", "3.10", "3.11", "3.12", "3.13"] |
| 52 | + # macos-13 is an Intel runner, macos-latest is an ARM runner |
| 53 | + os: [macos-13, macos-latest, ubuntu-latest] |
| 54 | + steps: |
| 55 | + - uses: actions/setup-python@v5 |
| 56 | + with: |
| 57 | + python-version: ${{ matrix.python }} |
| 58 | + - uses: actions/checkout@v4 |
| 59 | + - uses: actions/download-artifact@v4 |
| 60 | + with: |
| 61 | + name: ${{ matrix.os }} |
| 62 | + path: wheelhouse |
| 63 | + - run: python --version |
| 64 | + - run: python -m pip install toml |
| 65 | + - run: python .github/workflows/install_dependencies.py |
| 66 | + - run: ls wheelhouse |
| 67 | + - run: python -m pip install --no-index --find-links wheelhouse astrometry |
| 68 | + - run: python -c 'import astrometry' |
| 69 | + build_sdist: |
| 70 | + name: Build source distribution |
| 71 | + runs-on: ubuntu-latest |
| 72 | + steps: |
| 73 | + - uses: actions/checkout@v4 |
| 74 | + with: |
| 75 | + submodules: true |
| 76 | + - run: cd astrometry.net && git apply ../astrometry.net.patch |
| 77 | + - run: pipx run build --sdist |
| 78 | + - uses: actions/upload-artifact@v4 |
| 79 | + with: |
| 80 | + name: dist |
| 81 | + path: dist/*.tar.gz |
| 82 | + upload_pypi: |
| 83 | + name: Upload wheels and sidst to PyPI |
| 84 | + runs-on: ubuntu-latest |
| 85 | + needs: [build_wheels, test_library, build_sdist] |
| 86 | + if: github.event_name == 'release' && github.event.action == 'published' |
| 87 | + steps: |
| 88 | + - uses: actions/download-artifact@v4 |
| 89 | + with: |
| 90 | + path: wheelhouse |
| 91 | + pattern: "*" |
| 92 | + merge-multiple: true |
| 93 | + - uses: actions/download-artifact@v4 |
| 94 | + with: |
| 95 | + name: dist |
| 96 | + path: dist |
| 97 | + - run: mv wheelhouse/* dist/ |
| 98 | + |
| 99 | + with: |
| 100 | + password: ${{ secrets.PYPI_API_TOKEN }} |
0 commit comments