Add faiss-gpu pip wheel packaging (#5131) #15
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright (c) Meta Platforms, Inc. and affiliates. | |
| # | |
| # This source code is licensed under the MIT license found in the | |
| # LICENSE file in the root directory of this source tree. | |
| name: Build GPU pip wheel | |
| on: | |
| workflow_call: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - 'pyproject-gpu.toml' | |
| - 'CMakeLists.txt' | |
| - 'cmake/**' | |
| - 'faiss/**.cmake' | |
| - 'faiss/python/**' | |
| - 'faiss/gpu/**' | |
| - '.github/workflows/build-pip-gpu.yml' | |
| concurrency: | |
| group: gpu-pip-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-faiss-gpu: | |
| name: Build & test faiss-gpu | |
| runs-on: 4-core-ubuntu-gpu-t4 | |
| timeout-minutes: 90 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Activate GPU pyproject.toml | |
| # cibuildwheel + scikit-build-core both require literal pyproject.toml. | |
| # Workspace is fresh per job (actions/checkout creates new tree). | |
| run: cp pyproject-gpu.toml pyproject.toml | |
| - name: Build wheel (cibuildwheel) | |
| uses: pypa/cibuildwheel@ee02a1537ce3071a004a6b08c41e72f0fdc42d9a # v3.4.0 | |
| env: | |
| CIBW_BUILD_VERBOSITY: 1 | |
| - name: Upload wheel | |
| if: always() | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: wheels-gpu | |
| path: wheelhouse/*.whl | |
| publish-gpu: | |
| name: Publish faiss-gpu to PyPI | |
| needs: [build-faiss-gpu] | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/faiss-gpu | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download wheel | |
| uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 | |
| with: | |
| name: wheels-gpu | |
| path: dist | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # release/v1 |