Skip to content

add gh action to build wheels #2

add gh action to build wheels

add gh action to build wheels #2

Workflow file for this run

name: Wheels
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
# Publish when a (published) GitHub Release is created.
on:
push:
branches:
- master
- 'releases/**'
tags:
- v*
pull_request:
branches:
- master
- 'releases/**'
release:
types:
- published
permissions:
contents: read
jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
name: Install Python
with:
python-version: 3.x
- name: Build sdist
run: |
python -m pip install --upgrade pip setuptools
python -m pip install build
python -m build --sdist
- name: Check README rendering for PyPi
run: |
twine check dist/*
- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
path: dist/*.tar.gz
name: dist
build_wheels:

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

View workflow run for this annotation

GitHub Actions / .github/workflows/wheels.yml

Invalid workflow file

You have an error in your yaml syntax on line 53
name: Build ${{ matrix.os }} ${{ matrix.build }} wheels
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-latest]
#env:
# MACOSX_DEPLOYMENT_TARGET: "10.9"
#strategy:
# fail-fast: false
# matrix:
# include:
# - os: ubuntu-latest
# arch: x86_64
# build: 'cp*'
# - os: macos-13
# arch: x86_64
# build: 'cp*'
# - os: macos-latest
# arch: arm64
# build: 'cp*'
# - os: windows-latest
# arch: AMD64
# build: 'cp*'
# - os: ubunutu-24.04-arm
# arch: a
# # The aarch64 wheels are very slow so split into separate jobs
# - os: ubuntu-latest
# arch: aarch64
# build: 'cp311-*'
# - os: ubuntu-latest
# arch: aarch64
# build: 'cp312-*'
# - os: ubuntu-latest
# arch: aarch64
# build: 'cp313-*'
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
name: Install Python on Unix
with:
python-version: '3.12'
#if: runner.os != 'Windows'
#- name: Install Python and dependencies on Windows
# uses: mamba-org/setup-micromamba@06375d89d211a1232ef63355742e9e2e564bc7f7 # v2.0.2
# with:
# environment-name: build
# create-args: >
# python=3.12 pkgconfig
# init-shell: bash powershell
# if: runner.os == 'Windows'
#- uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
# if: runner.os == 'Linux' && matrix.arch != 'x64_64'
# name: Set up QEMU on Linux
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.22.0
- name: Build ${{ matrix.build }} wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
#env:
# CIBW_BUILD: '${{ matrix.build }}'
# CIBW_ARCHS: '${{ matrix.arch }}'
- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
path: |
./wheelhouse/*.whl
#name: cibw-wheels-${{ matrix.os }}-${{ matrix.arch }}-${{ strategy.job-index }}
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
twine_check:
needs: [ build_sdist, build_wheels ]
name: Twine check
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
submodules: true
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
pattern: '*'
merge-multiple: true
path: wheelhouse
- name: List downloaded artifacts
run: ls -alR ./wheelhouse/
- name: Install Python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: '3.x'
- name: Install twine
run: |
python -m pip install --upgrade pip twine
- name: Check sdist and wheels
run: |
python -m twine check *.whl -*.tar.gz
working-directory: wheelhouse