Skip to content

Wheels

Wheels #859

Workflow file for this run

name: Wheels
on:
workflow_dispatch:
schedule:
- cron: "20 2 * * *"
jobs:
Build-Wheels:
runs-on: [self-hosted, CPU]
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
# The LATEST_DATE here should be kept in sync with the one in Patch setup.py
- id: check-version
name: Check latest version
run: |
export PACKAGE_DATE=$(python3 -m pip install --user --index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/Triton-Nightly/pypi/simple/ --dry-run triton-nightly== |& grep -oP '(?<=, )[0-9\.]+dev[0-9]+(?=\))' | grep -oP '(?<=dev)[0-9]+')
export LATEST_DATE=$(TZ=UTC0 git show --quiet --date='format-local:%Y%m%d%H%M%S' --format="%cd")
if cmp -s <(echo $PACKAGE_DATE) <(echo $LATEST_DATE); then
echo "new_commit=false" >> "$GITHUB_OUTPUT"
else
echo "new_commit=true" >> "$GITHUB_OUTPUT"
fi
- name: Patch setup.py
if: ${{ steps.check-version.outputs.new_commit == 'true' }}
run: |
echo "" >> python/setup.cfg
echo "[build_ext]" >> python/setup.cfg
echo "base-dir=/project" >> python/setup.cfg
- name: Build wheels
if: ${{ steps.check-version.outputs.new_commit == 'true' }}
run: |
export CIBW_MANYLINUX_X86_64_IMAGE="quay.io/pypa/manylinux2014_x86_64:latest"
#export CIBW_MANYLINUX_PYPY_X86_64_IMAGE="quay.io/pypa/manylinux2014_x86_64:latest"
export CIBW_BEFORE_BUILD="pip install cmake;"
export CIBW_SKIP="{cp,pp}{35,36}-*"
export CIBW_BUILD="{cp,pp}3*-manylinux_x86_64"
python3 -m cibuildwheel python --output-dir wheelhouse
- name: Append build number
shell: bash
run: |
set -ex
mkdir -p wheelhouse-1
find wheelhouse -type f
for i in $(find wheelhouse -type f); do
echo "Patching $i"
python3 -mwheel unpack "$i"
python3 -mwheel pack triton-2.2.0 --build-number 0 --dest-dir wheelhouse-1
rm -rf triton-2.2.0
done
- name: Upload wheels to PyPI
run: |
python3 -m twine upload wheelhouse-1/* -u __token__ -p ${{ secrets.PYPY_API_TOKEN }}