Skip to content

Build and Upload Wheels #1

Build and Upload Wheels

Build and Upload Wheels #1

name: Build and Upload Wheels
on:
push:
branches: [ main ] # Change as needed
workflow_dispatch:
jobs:
build_wheels:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install cibuildwheel
run: |
python -m pip install --upgrade pip
pip install cibuildwheel==2.12.0
- name: Build wheels with cibuildwheel
env:
CIBW_BUILD: cp${{ matrix.python-version | replace('.', '') }}-*

Check failure on line 34 in .github/workflows/build_and_upload.yml

View workflow run for this annotation

GitHub Actions / Build and Upload Wheels

Invalid workflow file

The workflow is not valid. .github/workflows/build_and_upload.yml (Line: 34, Col: 23): Unexpected symbol: '|'. Located at position 23 within expression: matrix.python-version | replace('.', '')
CIBW_SKIP: pp*,jy*,cp27*,cp36*,cp37*,cp38*
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: python -m pytest {project}/test
run: |
cibuildwheel --output-dir wheelhouse
- name: Upload to TestPyPI
if: startsWith(github.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
packages_dir: wheelhouse