build(ci): Bump actions/download-artifact from 5.0.0 to 6.0.0 #36782
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) Facebook, Inc. and its affiliates. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| name: Build Pyvelox Wheels | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: pyvelox version | |
| required: false | |
| ref: | |
| description: git ref to build | |
| required: false | |
| publish: | |
| description: publish to PyPI | |
| required: false | |
| type: boolean | |
| default: false | |
| # schedule: | |
| # - cron: '15 0 * * *' | |
| pull_request: | |
| paths: | |
| - .github/workflows/build_pyvelox.yml | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.repository }}-${{ github.head_ref || github.sha }} | |
| cancel-in-progress: true | |
| jobs: | |
| build_wheels: | |
| name: Build wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [8-core-ubuntu, macos-13, macos-14] | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| ref: ${{ inputs.ref || github.ref }} | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | |
| with: | |
| python-version: '3.10' | |
| - name: Restore ccache | |
| uses: apache/infrastructure-actions/stash/restore@3354c1565d4b0e335b78a76aedd82153a9e144d4 | |
| id: restore-cache | |
| with: | |
| path: ccache | |
| key: ccache-wheels-${{ matrix.os }} | |
| - name: Restore macOS Dependencies | |
| if: startsWith(matrix.os, 'macos') | |
| uses: apache/infrastructure-actions/stash/restore@3354c1565d4b0e335b78a76aedd82153a9e144d4 | |
| id: restore-deps | |
| with: | |
| path: dependencies | |
| key: dependencies-pyvelox-${{ matrix.os }}-${{ hashFiles('scripts/setup-macos.sh') }} | |
| - name: Install macOS dependencies from brew | |
| if: startsWith(matrix.os, 'macos') | |
| run: | | |
| export INSTALL_PREFIX="$GITHUB_WORKSPACE/dependencies" | |
| echo "CMAKE_PREFIX_PATH=$INSTALL_PREFIX" >> $GITHUB_ENV | |
| echo "INSTALL_PREFIX=$INSTALL_PREFIX" >> $GITHUB_ENV | |
| echo "DYLD_LIBRARY_PATH=$INSTALL_PREFIX/lib:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV | |
| source scripts/setup-macos.sh | |
| install_build_prerequisites | |
| install_velox_deps_from_brew | |
| # CMake 4.0 causes issues with arrows bundled dependencies | |
| brew uninstall cmake | |
| pipx install --force cmake==3.31 | |
| - name: Install macOS dependencies | |
| if: ${{ startsWith(matrix.os, 'macos') && steps.restore-deps.outputs.stash-hit != 'true' }} | |
| env: | |
| MACOSX_DEPLOYMENT_TARGET: '13.0' | |
| run: | | |
| bash scripts/setup-macos.sh | |
| - name: Save macOS Dependencies | |
| if: ${{ startsWith(matrix.os, 'macos') && steps.restore-deps.outputs.stash-hit != 'true' }} | |
| uses: apache/infrastructure-actions/stash/save@3354c1565d4b0e335b78a76aedd82153a9e144d4 | |
| with: | |
| path: dependencies | |
| key: dependencies-pyvelox-${{ matrix.os }}-${{ hashFiles('scripts/setup-macos.sh') }} | |
| retention-days: 90 | |
| - name: Create sdist | |
| if: matrix.os == '8-core-ubuntu' | |
| env: | |
| BUILD_VERSION: ${{ inputs.version }} | |
| run: | | |
| pipx install uv | |
| uv build --sdist --out-dir wheelhouse | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@5f22145df44122af0f5a201f93cf0207171beca7 # v3.0.0 | |
| env: | |
| BUILD_VERSION: ${{ inputs.version }} | |
| CIBW_BUILD: cp310-* cp311-* cp312-* cp313-* | |
| CIBW_ENVIRONMENT_PASS_LINUX: BUILD_VERSION | |
| CIBW_ENVIRONMENT_LINUX: CCACHE_DIR=/host${{ github.workspace }}/ccache | |
| # for macos | |
| MACOSX_DEPLOYMENT_TARGET: ${{ matrix.os == 'macos-14' && '14' || '13' }} | |
| CCACHE_DIR: ${{ github.workspace }}/ccache | |
| with: | |
| output-dir: wheelhouse | |
| - name: Save ccache | |
| uses: apache/infrastructure-actions/stash/save@3354c1565d4b0e335b78a76aedd82153a9e144d4 | |
| with: | |
| path: ccache | |
| key: ccache-wheels-${{ matrix.os }} | |
| - name: Rename wheel compatibility tag | |
| if: false #startsWith(matrix.os, 'macos') | |
| run: | | |
| brew install rename | |
| cd wheelhouse | |
| rename 's/11_0/10_15/g' *.whl | |
| - uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 | |
| with: | |
| name: wheels-${{ matrix.os }} | |
| retention-days: 5 | |
| path: | | |
| ./wheelhouse/*.whl | |
| ./wheelhouse/*.tar.gz | |
| publish_wheels: | |
| name: Publish Wheels to PyPI | |
| if: ${{ github.event_name == 'schedule' || inputs.publish }} | |
| needs: build_wheels | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 | |
| with: | |
| pattern: wheels-* | |
| merge-multiple: true | |
| path: ./wheelhouse | |
| - run: ls wheelhouse | |
| - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | |
| with: | |
| python-version: '3.10' | |
| - name: Publish a Python distribution to PyPI | |
| uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 | |
| with: | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| packages_dir: wheelhouse |