# 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 pip wheels on: workflow_call: workflow_dispatch: jobs: build-wheels: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} timeout-minutes: 120 strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-14, macos-15-intel, windows-2022, 2-core-ubuntu-arm] steps: - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 fetch-tags: true - name: Build wheels uses: pypa/cibuildwheel@ee02a1537ce3071a004a6b08c41e72f0fdc42d9a # v3.4.0 env: CIBW_BUILD_VERBOSITY: 1 - name: Upload wheels uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: wheels-${{ matrix.os }} path: wheelhouse/*.whl publish: name: Publish to PyPI needs: [build-wheels] runs-on: ubuntu-latest if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') environment: name: pypi url: https://pypi.org/p/faiss-cpu permissions: id-token: write contents: read steps: - name: Download all artifacts uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: path: dist merge-multiple: true - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # release/v1 publish-testpypi: name: Publish to TestPyPI needs: [build-wheels] runs-on: ubuntu-latest if: github.event_name == 'workflow_dispatch' environment: name: testpypi url: https://test.pypi.org/p/faiss-cpu permissions: id-token: write contents: read steps: - name: Download all artifacts uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: path: dist merge-multiple: true - name: Publish to TestPyPI uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # release/v1 with: repository-url: https://test.pypi.org/legacy/ skip-existing: true