Skip to content

Run tests after building wheels #58

Run tests after building wheels

Run tests after building wheels #58

Workflow file for this run

name: Build
on:
push:
branches:
- main
tags:
- "*.*.*"
pull_request:
branches:
- main
types: [opened, reopened, synchronize]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/cibuildwheel@v2.19.2
env:
CIBW_BUILD: "cp313-*"
CIBW_ARCHS_MACOS: all
CIBW_PRERELEASE_PYTHONS: true
- uses: actions/upload-artifact@v4
with:
name: artifact-cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
make-sdist:
name: Make source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: artifact-source-dist
path: "./**/dist/*.tar.gz"
upload_pypi:
if: github.event_name == 'push' && github.ref_type == 'tag'
name: Publish built wheels to Pypi
runs-on: ubuntu-latest
environment: release
needs: [make-sdist, build_wheels]
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
- name: Copy artifacts to dist/ folder
run: |
find . -name 'artifact-*' -exec unzip '{}' \;
mkdir -p dist/
find . -name '*.tar.gz' -exec mv '{}' dist/ \;
find . -name '*.whl' -exec mv '{}' dist/ \;
- uses: pypa/gh-action-pypi-publish@release/v1
name: Publish to PyPI