Skip to content

Build Wheel

Build Wheel #33

Workflow file for this run

name: Build Wheel
on:
release:
types:
- created
jobs:
build:
name: Tag ${{ matrix.os }} python ${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [openstack22]
python: ["3.10", "3.11", "3.12"]
timeout-minutes: 500
steps:
- name: add llvm
run: |
if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
sudo apt-get update
sudo apt-get install -y git gcc g++
fi
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- run: python -m pip install --user numpy twine
- uses: actions/checkout@v3
with:
submodules: recursive
- run: sudo rm -rf ~/.cache/bazel ~/.cache/bazelisk
- run: |
export TAG=`echo $GITHUB_REF | sed 's/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/'`
echo $TAG
sed -i.bak "s~version = \"[0-9.]*\"~version = \"$TAG\"~g" BUILD
cat BUILD
sed -i.bak "s~\[\"X86\", \"AArch64\", \"AMDGPU\", \"NVPTX\"\]~\[\"X86\", \"NVPTX\"\]~g" WORKSPACE
cat WORKSPACE
- uses: bazel-contrib/[email protected]
with:
# Avoid downloading Bazel every time.
bazelisk-cache: true
bazelisk-version: 1.x
# - run: sudo find ~/.cache/bazel ~/.cache/bazelisk -iname "*.whl" -exec rm {} \;
- run: |
HERMETIC_PYTHON_VERSION=${{ matrix.python }} bazel build -c opt @llvm-project//llvm:FileCheck
sudo rm bazel-bin/*.whl || echo
HERMETIC_PYTHON_VERSION=${{ matrix.python }} bazel build -c opt :wheel
- env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: python -m twine upload bazel-bin/*.whl