|
5 | 5 | push: |
6 | 6 | branches: |
7 | 7 | - release-* |
8 | | - - "*wheel*" # must quote since "*" is a YAML reserved character; we want a string |
| 8 | + - '*wheel*' # must quote since "*" is a YAML reserved character; we want a string |
9 | 9 | tags: |
10 | | - - "*" |
| 10 | + - '*' |
11 | 11 | pull_request: |
12 | 12 | branches: |
13 | | - - "*wheel*" # must quote since "*" is a YAML reserved character; we want a string |
| 13 | + - '*wheel*' # must quote since "*" is a YAML reserved character; we want a string |
14 | 14 |
|
15 | 15 | jobs: |
16 | 16 | generate_backwards_compatibility_data: |
|
19 | 19 | steps: |
20 | 20 | - name: Checkout code |
21 | 21 | uses: actions/checkout@v3 |
22 | | - |
| 22 | + |
23 | 23 | # Based on https://github.com/TileDB-Inc/conda-forge-nightly-controller/blob/51519a0f8340b32cf737fcb59b76c6a91c42dc47/.github/workflows/activity.yml#L19C10-L19C10 |
24 | 24 | - name: Setup git |
25 | 25 | run: | |
@@ -62,48 +62,93 @@ jobs: |
62 | 62 | GH_TOKEN: ${{ github.token }} |
63 | 63 |
|
64 | 64 | build_wheels: |
65 | | - name: Build wheels on ${{ matrix.os }} |
| 65 | + name: Wheel ${{ matrix.buildplat[0] }}-${{ matrix.buildplat[1] }}-${{ matrix.python }} |
66 | 66 | # TODO(paris): Add this back once generate_backwards_compatibility_data is confirmed to work. |
67 | 67 | # needs: generate_backwards_compatibility_data |
68 | | - runs-on: ${{ matrix.os }} |
| 68 | + runs-on: ${{ matrix.buildplat[0] }} |
69 | 69 | strategy: |
70 | 70 | matrix: |
71 | | - os: [ubuntu-22.04, macos-12, windows-2022] |
72 | | - # `windows-2022, ` blocked by https://github.com/pybind/pybind11/issues/3445#issuecomment-1525500927 |
| 71 | + buildplat: |
| 72 | + - [ ubuntu-22.04, manylinux_x86_64 ] |
| 73 | + - [ macos-13, macosx_x86_64 ] |
| 74 | + - [ macos-13, macosx_arm64 ] |
| 75 | + # Windows build is currently disabled since the C++ build fails on multiple errors e.g. file manipulation |
| 76 | + # and std::filesystem::path implicit to string conversion. |
| 77 | + # Follow up task https://app.shortcut.com/tiledb-inc/story/41119/enable-windows-build-for-vector-search-repository |
| 78 | + python: [ "cp39", "cp310", "cp311", "cp312", "pp39" ] |
| 79 | + exclude: |
| 80 | + - buildplat: [ macos-13, macosx_arm64 ] |
| 81 | + python: "pp39" |
73 | 82 |
|
74 | 83 | steps: |
75 | 84 | - uses: actions/checkout@v3 |
76 | 85 |
|
77 | | - - name: "Brew setup on macOS" # x-ref c8e49ba8f8b9ce |
| 86 | + - name: 'Brew setup on macOS' # x-ref c8e49ba8f8b9ce |
78 | 87 | if: ${{ startsWith(matrix.os, 'macos-') == true }} |
79 | 88 | run: | |
80 | 89 | set -e pipefail |
81 | | - brew install automake pkg-config ninja |
| 90 | + brew update |
| 91 | + brew install automake pkg-config ninja llvm |
82 | 92 |
|
83 | 93 | - name: Build wheels |
84 | | - |
| 94 | + |
85 | 95 | env: |
86 | | - CIBW_MANYLINUX_X86_64_IMAGE: "manylinux_2_28" |
87 | | - CIBW_SKIP: "*-win32 cp27-* cp35-* cp36-* cp37-* pp* *_i686 *musllinux*" |
88 | | - CIBW_ARCHS_MACOS: "x86_64 arm64" |
89 | 96 | CIBW_BUILD_VERBOSITY: 3 |
| 97 | + CIBW_ENVIRONMENT_MACOS: > |
| 98 | + CC=clang |
| 99 | + CXX=clang++ |
90 | 100 | MACOSX_DEPLOYMENT_TARGET: "12.0" |
| 101 | + CIBW_ARCHS: all |
| 102 | + CIBW_PRERELEASE_PYTHONS: True |
| 103 | + CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} |
91 | 104 | with: |
92 | 105 | output-dir: wheelhouse |
93 | 106 |
|
94 | | - - uses: actions/upload-artifact@v3 |
| 107 | + - uses: actions/upload-artifact@v4 |
| 108 | + with: |
| 109 | + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} |
| 110 | + path: './wheelhouse/*.whl' |
| 111 | + |
| 112 | + build_sdist: |
| 113 | + name: Build source distribution |
| 114 | + runs-on: ubuntu-latest |
| 115 | + steps: |
| 116 | + - uses: actions/checkout@v3 |
| 117 | + |
| 118 | + - name: Build sdist |
| 119 | + run: pipx run build --sdist |
| 120 | + |
| 121 | + - uses: actions/upload-artifact@v4 |
| 122 | + with: |
| 123 | + path: dist/*.tar.gz |
| 124 | + |
| 125 | + |
| 126 | + upload_pypi: |
| 127 | + needs: [build_wheels, build_sdist] |
| 128 | + runs-on: ubuntu-latest |
| 129 | + environment: pypi |
| 130 | + permissions: |
| 131 | + id-token: write |
| 132 | + outputs: |
| 133 | + package_version: ${{ steps.get_package_version.outputs.package_version }} |
| 134 | + steps: |
| 135 | + - uses: actions/download-artifact@v4 |
95 | 136 | with: |
96 | | - path: ./wheelhouse/*.whl |
97 | | -# TODO: Needs support for pulling in the root directory |
98 | | -# build_sdist: |
99 | | -# name: Build source distribution |
100 | | -# runs-on: ubuntu-latest |
101 | | -# steps: |
102 | | -# - uses: actions/checkout@v3 |
103 | | -# |
104 | | -# - name: Build sdist |
105 | | -# run: pipx run build --sdist |
106 | | -# |
107 | | -# - uses: actions/upload-artifact@v3 |
108 | | -# with: |
109 | | -# path: dist/*.tar.gz |
| 137 | + # unpacks all CIBW artifacts into dist/ |
| 138 | + pattern: 'cibw-*' |
| 139 | + path: dist |
| 140 | + merge-multiple: true |
| 141 | + |
| 142 | + - id: get_package_version |
| 143 | + run: | |
| 144 | + echo "package_version=$(ls dist/ | head -n 1 | cut -d - -f 2)" >> "$GITHUB_OUTPUT" |
| 145 | +
|
| 146 | + - name: Upload to test-pypi |
| 147 | + if: ${{ github.event_name == 'workflow_dispatch' }} |
| 148 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 149 | + with: |
| 150 | + repository-url: https://test.pypi.org/legacy/ |
| 151 | + |
| 152 | + - name: Upload to pypi |
| 153 | + if: ${{ github.event_name != 'workflow_dispatch' }} |
| 154 | + uses: pypa/gh-action-pypi-publish@release/v1 |
0 commit comments