Skip to content

A few improvements

A few improvements #52

Workflow file for this run

name: Build wheels
on:
pull_request:
push:
tags: ['v*']
workflow_dispatch:
jobs:
build_wheels:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Cache vcpkg binaries
uses: actions/cache@v4
with:
path: ~/.cache/vcpkg
key: vcpkg-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('vcpkg.json') }}
restore-keys: vcpkg-${{ runner.os }}-${{ runner.arch }}-
- name: Pre-download virtualenv (avoid GitHub rate limits)
run: |
VENV_VERSION=21.1.0
if [ "$RUNNER_OS" = "macOS" ]; then
CACHE_DIR="$HOME/Library/Caches/cibuildwheel"
else
CACHE_DIR="$HOME/.cache/cibuildwheel"
fi
mkdir -p "$CACHE_DIR"
curl --retry 5 --retry-delay 10 -L -o "$CACHE_DIR/virtualenv-${VENV_VERSION}.pyz" \
"https://github.com/pypa/get-virtualenv/blob/${VENV_VERSION}/public/virtualenv.pyz?raw=true"
- name: Build wheels
uses: pypa/cibuildwheel@v3.4.0
env:
CIBW_ENABLE: cpython-prerelease
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: wheelhouse/*.whl
publish:
needs: build_wheels
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
environment:
name: pypi
url: https://pypi.org/p/lensboy
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1