get as far as the compiler #110
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Wheels | |
on: [push, pull_request] | |
jobs: | |
wheels: | |
name: Build wheel on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
name: Install Python | |
with: | |
python-version: '3.11' | |
- name: Install cibuildwheel | |
run: | | |
python -m pip install cibuildwheel==2.13.0 | |
- name: Build wheel | |
run: | | |
python -m cibuildwheel --output-dir dist | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist/ | |
release: | |
permissions: | |
contents: write # for actions/create-release | |
name: Create GitHub Release | |
needs: [wheels] | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Tag Version | |
id: set_tag | |
run: | | |
export V=$(python -c "print(next(iter(eval(L.split('=')[-1]) for L in open('pyproject.toml') if 'version' in L)))") | |
echo "tag=${V}" >> "$GITHUB_ENV" | |
- uses: actions/download-artifact@v3 | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
tag: ${{ env.tag }} | |
artifacts: "wheels/*.whl" | |
pypi-publish: | |
name: Release to PyPI | |
needs: [wheels] | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Download Wheels | |
uses: actions/download-artifact@v3 | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
packages-dir: wheels |