Skip to content

Commit

Permalink
CI: Make a wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmcl committed Feb 6, 2025
1 parent 9f5ab82 commit d0e0599
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
push:
branches: ["main"]
branches: ["**"] # For now, let's build all branches. Roll this back if it gets too slow or we exhaust our quota.
pull_request:
branches: ["**"] # * does not match '/'
workflow_dispatch: # For manually triggering a build: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#workflow_dispatch
Expand Down Expand Up @@ -41,3 +41,12 @@ jobs:
working-directory: ./interop
run: |
pytest
- name: Make a wheel
# https://github.com/pypa/cibuildwheel
run: |
pip install cibuildwheel
bin/make-wheel
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
10 changes: 9 additions & 1 deletion bin/make-wheel
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ cp $ROOT/interop/pyproject.toml $WHEEL_DIR
cp $ROOT/interop/MANIFEST.in $WHEEL_DIR

cd $WHEEL_DIR
python -m build

if [ -z "${GITHUB_RUN_ID+x}" ]; then
echo "Building wheel locally"
python -m build -w
else
# https://github.com/pypa/cibuildwheel
echo "Building wheel via GitHub Actions"
python -m cibuildwheel --output-dir $WHEEL_DIR/wheelhouse
fi

# To upload the wheel, with the proper token in ~/.pypirc, run
#
Expand Down
2 changes: 1 addition & 1 deletion interop/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include klr/bin/*
include bin/*
10 changes: 10 additions & 0 deletions interop/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,15 @@ testpaths = [
"test",
]

[tool.setuptools]
# Trick setuptools into knowing this is a binary wheel.
# NB: This took about 1000 hours to figure out so never delete this.
ext-modules = [
{name = "klr", sources = []}
]

[tool.setuptools.package-data]
klr = ["bin/klr"]

[project.urls]
Repository = "https://github.com/leanprover/KLR"

0 comments on commit d0e0599

Please sign in to comment.