Skip to content

Fix workflow

Fix workflow #23

Workflow file for this run

name: Wheels Deploy
on: push
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build-wheels:
name: Build Python ${{matrix.python}} 🐍 distribution 📦 wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
continue-on-error: false
strategy:
fail-fast: false
matrix:
include:
#- { os: macos-latest, python: 38, platform_id: macosx_universal2 }
#- { os: macos-latest, python: 39, platform_id: macosx_universal2 }
#- { os: macos-latest, python: 310, platform_id: macosx_universal2 }
#- { os: macos-latest, python: 311, platform_id: macosx_universal2 }
#- { os: macos-latest, python: 312, platform_id: macosx_universal2 }
- { os: windows-latest, python: 38, platform_id: win_amd64 }
- { os: windows-latest, python: 39, platform_id: win_amd64 }
#- { os: windows-latest, python: 310, platform_id: win_amd64 }
#- { os: windows-latest, python: 311, platform_id: win_amd64 }
#- { os: windows-latest, python: 312, platform_id: win_amd64 }
#- { os: ubuntu-latest, python: 38, platform_id: manylinux_x86_64 }
# - { os: ubuntu-latest, python: 38, platform_id: manylinux_aarch64 }
#- { os: ubuntu-latest, python: 39, platform_id: manylinux_x86_64 }
# - { os: ubuntu-latest, python: 39, platform_id: manylinux_aarch64 }
#- { os: ubuntu-latest, python: 310, platform_id: manylinux_x86_64 }
# - { os: ubuntu-latest, python: 310, platform_id: manylinux_aarch64 }
#- { os: ubuntu-latest, python: 311, platform_id: manylinux_x86_64 }
# - { os: ubuntu-latest, python: 311, platform_id: manylinux_aarch64 }
#- { os: ubuntu-latest, python: 312, platform_id: manylinux_x86_64 }
# - { os: ubuntu-latest, python: 312, platform_id: manylinux_aarch64 }
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup and install python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.16.2
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_ARCHS: all
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_I686_IMAGE: manylinux2014
CIBW_REPAIR_WHEEL_COMMAND_LINUX: pip install auditwheel-symbols && (auditwheel repair -w {dest_dir} {wheel} || auditwheel-symbols --manylinux 2014 {wheel})
CIBW_BEFORE_BUILD_LINUX: |
yum install -y \
zlib-devel \
openssl-devel \
freetype-devel \
freeglut-devel \
alsa-lib-devel \
mesa-libGL-devel \
xorg-x11-proto-devel \
xorg-x11-proto-devel \
libcurl-devel \
libpng-devel \
libX11-devel \
libXcursor-devel \
libXrandr-devel \
libXinerama-devel \
libXrender-devel \
libXcomposite-devel \
libXinerama-devel \
libXcursor-devel
CIBW_TEST_SKIP: "*manylinux* *pp* *-macosx_universal2:arm64"
- name: Upload all the dists
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: ./wheelhouse/*.whl
upload-test-pypi:
name: Publish Python 🐍 distribution 📦 to Test PyPI
needs: [build-wheels]
runs-on: ubuntu-latest
permissions:
id-token: write
#if: startsWith(github.ref, 'refs/tags')
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
merge-multiple: true
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
upload-pypi:
name: Publish Python 🐍 distribution 📦 to PyPI
needs: [upload-test-pypi]
runs-on: ubuntu-latest
permissions:
id-token: write
if: startsWith(github.ref, 'refs/tags')
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
merge-multiple: true
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
github-release:
name: Sign the Python 🐍 distribution 📦 with Sigstore and upload them to GitHub Release
needs: [upload-pypi]
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
if: startsWith(github.ref, 'refs/tags')
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
merge-multiple: true
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: ./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: gh release create '${{ github.ref_name }}' --repo '${{ github.repository }}' --notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: gh release upload '${{ github.ref_name }}' dist/** --repo '${{ github.repository }}'