Skip to content

Build and upload to PyPI #21

Build and upload to PyPI

Build and upload to PyPI #21

Workflow file for this run

name: Build and upload to PyPI
on:
workflow_dispatch:
release:
types:
- published
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install dependencies for Windows
if: runner.os == 'Windows'
run: |
New-Item -Path "C:\Program Files\" -Name "boost" -ItemType "directory"
Invoke-WebRequest -Uri https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.zip -OutFile "C:\Program Files\boost\boost_1_82_0.zip"
7z x -o"C:\Program Files\boost\" "C:\Program Files\boost\boost_1_82_0.zip"
- name: Install dependencies for Mac
if: runner.os == 'macOS'
run: |

Check failure on line 29 in .github/workflows/wheels.yml

View workflow run for this annotation

GitHub Actions / Build and upload to PyPI

Invalid workflow file

The workflow is not valid. .github/workflows/wheels.yml (Line: 29, Col: 14): Unrecognized named-value: 'GITHUB_ENV'. Located at position 1 within expression: GITHUB_ENV
brew update
brew install boost
echo "CPLUS_INCLUDE_PATH=/opt/homebrew/Cellar/boost/1.85.0" >> "$GITHUB_ENV"
echo $CPLUS_INCLUDE_PATH
echo "$CPLUS_INCLUDE_PATH"
echo ${{ GITHUB_ENV }}
- name: Build wheels
uses: pypa/[email protected]
env:
BUILD_EXTENSION: yes
CIBW_SKIP: "pp* *-win32 *-musllinux_x86_64 *_i686"
CIBW_BEFORE_ALL_LINUX: yum install -y boost-devel
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build SDist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
upload_all:
needs: [build_wheels, make_sdist]
environment: pypi
permissions:
id-token: write
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1