Skip to content

Update build-publish-pypi.yml #66

Update build-publish-pypi.yml

Update build-publish-pypi.yml #66

name: Build Test and Publish
on: [push, pull_request,release,workflow_dispatch]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
steps:
- uses: actions/checkout@v4
# Used to host cibuildwheel
- uses: actions/setup-python@v3
with:
python-version: "3.x" #Ensures compatibility with the latest Python version
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.16.2
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
# to supply options, put them in 'env', like:
env:
# CIBW_SOME_OPTION: value
# remove python 3.12 and pp
CIBW_SKIP: "cp27-* cp35-* cp36-* pp* *-win32 *win_arm64 *i686 *musllinux*"
CIBW_BEFORE_ALL_WINDOWS: >
vcpkg update &&
vcpkg install getopt:x64-windows-static &&
vcpkg integrate install
CIBW_TEST_COMMAND: "python {project}/docs/tutorial/example.py"
- uses: actions/upload-artifact@v4
with:
name: my-artifact-${{ matrix.os }}
path: ./wheelhouse/*.whl
upload_all:
needs: [build_wheels]
runs-on: ubuntu-latest
permissions:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
with:
path: dist
pattern: my-artifact-*
merge-multiple: true
- name: List directory contents
run: |
ls -l ./dist
- uses: pypa/gh-action-pypi-publish@release/v1