Skip to content

Export WITH_AUTOSCHEDULERS from package #794

Export WITH_AUTOSCHEDULERS from package

Export WITH_AUTOSCHEDULERS from package #794

Workflow file for this run

# Relevant GHA docs links:
# https://docs.github.com/en/actions/using-jobs/running-jobs-in-a-container
# https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-ghcrio
name: Build PyPI package
on:
push:
branches: [ main, build/pip-packaging ]
release:
types: [ created ]
concurrency:
group: '${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
packages: read # to fetch packages (docker)
jobs:
build-info:
name: Gather build information
runs-on: ubuntu-latest
outputs:
halide_major_version: ${{ steps.get_major_version.version }}
steps:
- uses: actions/checkout@v4
- id: get_major_version
run: sed -nE 's/^ *VERSION ([0-9]+)\.[0-9]+\.[0-9]+$/version=\1/p' CMakeLists.txt | tee -a "$GITHUB_OUTPUT"
build-wheels:
name: Build Halide wheels for ${{ matrix.platform_tag }}
needs: build-info
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
platform_tag: manylinux_x86_64
- os: windows-latest
platform_tag: win_amd64
- os: macos-13
platform_tag: macosx_x86_64
- os: macos-14
platform_tag: macosx_arm64
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- uses: lukka/get-cmake@v3.28.4
- name: Cache LLVM build folder
if: matrix.os != 'ubuntu-latest'
id: cache-llvm
uses: actions/cache@v4
with:
path: opt/llvm
key: llvmorg-${{ needs.build-info.outputs.halide_major_version }}-${{ runner.os }}
- uses: actions/checkout@v4
if: matrix.os != 'ubuntu-latest' && steps.cache-llvm.outputs.cache-hit != 'true'
with:
path: llvm-src
repository: llvm/llvm-project
ref: llvmorg-${{ needs.build-info.outputs.halide_major_version }}
- name: Configure LLVM
if: matrix.os != 'ubuntu-latest' && steps.cache-llvm.outputs.cache-hit != 'true'
run: >
cmake -G Ninja -S llvm-src/llvm -B llvm-build
"-DCMAKE_BUILD_TYPE=Release"
"-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/opt/llvm"
"-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64"
"-DLLVM_ENABLE_ASSERTIONS=ON"
"-DLLVM_ENABLE_BINDINGS=OFF"
"-DLLVM_ENABLE_CURL=OFF"
"-DLLVM_ENABLE_DIA_SDK=OFF"
"-DLLVM_ENABLE_EH=ON"
"-DLLVM_ENABLE_HTTPLIB=OFF"
"-DLLVM_ENABLE_IDE=OFF"
"-DLLVM_ENABLE_LIBEDIT=OFF"
"-DLLVM_ENABLE_LIBXML2=OFF"
"-DLLVM_ENABLE_OCAMLDOC=OFF"
"-DLLVM_ENABLE_PROJECTS=clang;lld"
"-DLLVM_ENABLE_RTTI=ON"
"-DLLVM_ENABLE_RUNTIMES=compiler-rt"
"-DLLVM_ENABLE_TERMINFO=OFF"
"-DLLVM_ENABLE_WARNINGS=OFF"
"-DLLVM_ENABLE_ZLIB=OFF"
"-DLLVM_ENABLE_ZSTD=OFF"
"-DLLVM_INCLUDE_BENCHMARKS=OFF"
"-DLLVM_INCLUDE_EXAMPLES=OFF"
"-DLLVM_INCLUDE_TESTS=OFF"
"-DLLVM_TARGETS_TO_BUILD=WebAssembly;X86;AArch64;ARM;Hexagon;NVPTX;PowerPC;RISCV"
- name: Build LLVM
if: matrix.os != 'ubuntu-latest' && steps.cache-llvm.outputs.cache-hit != 'true'
run: cmake --build llvm-build --target install
- name: Clean LLVM source and build intermediates
if: matrix.os != 'ubuntu-latest' && steps.cache-llvm.outputs.cache-hit != 'true'
shell: bash
run: rm -rf llvm-src llvm-build
- name: Build wheels
uses: pypa/cibuildwheel@v2.20.0
env:
CMAKE_PREFIX_PATH: ${{ github.workspace }}/opt/llvm
CIBW_BUILD: "cp3*-${{ matrix.platform_tag }}"
CIBW_SKIP: "cp3{5,6,7}*"
CIBW_CONFIG_SETTINGS: "-C wheel.build-tag=${{ github.run_id }}"
CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/halide/manylinux_2_28_x86_64-llvm:${{ needs.build-info.outputs.halide_major_version }}
- uses: actions/upload-artifact@v3
with:
name: wheels
path: ./wheelhouse/*.whl
publish:
name: Publish on PyPI
needs: build-wheels
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
path: dist
- uses: pypa/gh-action-pypi-publish@v1.5.1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- uses: pypa/gh-action-pypi-publish@v1.5.1
if: github.event_name == 'release' && github.event.action == 'published'
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}