Skip to content

Bump pypa/cibuildwheel from 2.20.0 to 2.21.1 #195

Bump pypa/cibuildwheel from 2.20.0 to 2.21.1

Bump pypa/cibuildwheel from 2.20.0 to 2.21.1 #195

Workflow file for this run

name: Build Package
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
os: ['ubuntu-latest', 'macos-12']
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install python 2.7 on MacOS
if: runner.os == 'macOS'
run: |
brew install pyenv
echo "$(pyenv root)/shims" >> $GITHUB_PATH
echo "$(pyenv root)/bin" >> $GITHUB_PATH
pyenv install 2.7.18
pyenv global system 2.7.18
- name: Build wheels
uses: pypa/cibuildwheel@v2.21.1
env:
CIBW_BEFORE_BUILD_LINUX: yum install -y wget && ./build-drafter.sh linux
CIBW_BEFORE_BUILD_MACOS: ./build-drafter.sh mac
CIBW_BUILD: "cp38-manylinux_x86_64 cp38-macosx_x86_64"
CIBW_BUILD_VERBOSITY: 3
with:
package-dir: .
output-dir: dist
config-file: "pyproject.toml"
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
- run: pip install --upgrade pip
# Poetry automatically assumes the most specific tag
# but we don't actually need specific builds
# for each python version (3.8, 3.9, etc).
# We build one wheel then re-tag it as py3-none.
- name: Fix wheel tags (linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
pip install wheel>=0.40.0
wheel tags --python-tag py3 --abi-tag none dist/*linux*.whl --remove
- name: Fix wheel tags (mac)
if: startsWith(matrix.os, 'macos')
run: |
pip install wheel>=0.40.0
wheel tags --python-tag py3 --abi-tag none dist/*-macosx*.whl --remove
# build sdist, only on linux
- name: Install dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
pip install poetry
make install
- name: Build sdist
if: startsWith(matrix.os, 'ubuntu')
run: poetry build --format sdist
- run: ls dist
- uses: actions/upload-artifact@v4
with:
path: ./dist/*
name: artifact-${{ matrix.os }}
publish:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
permissions:
contents: none
id-token: write # required for trusted publishing
environment: publish
steps:
- uses: actions/download-artifact@v4
with:
path: artifact
pattern: artifact-*
merge-multiple: true
- run: ls artifact
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: artifact/
print-hash: true