Skip to content

Bump pypa/cibuildwheel from 2.16.1 to 2.16.2 (#384) #442

Bump pypa/cibuildwheel from 2.16.1 to 2.16.2 (#384)

Bump pypa/cibuildwheel from 2.16.1 to 2.16.2 (#384) #442

Workflow file for this run

# Reference:
# - https://github.com/actions/checkout
# - https://github.com/actions/download-artifact
# - https://github.com/actions/upload-artifact
# - https://github.com/pypa/cibuildwheel
# - https://github.com/pypa/build
# - https://github.com/pypa/gh-action-pypi-publish
# - https://test.pypi.org/help/#apitoken
name: ci-wheels
on:
pull_request:
push:
tags:
- "v*"
branches-ignore:
- "conda-lock-auto-update"
- "pre-commit-ci-update-config"
- "dependabot/*"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_bdist:
name: "Build ${{ matrix.os }} (${{ matrix.arch }}) wheels"
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
# TBD: extend to support windows
os: ["ubuntu", "macos"]
arch: ["x86_64", "arm64"]
exclude:
- os: ubuntu
arch: arm64
include:
- os: ubuntu
incdir: /usr/include/udunits2
libdir: /usr/lib64
xml_path: /usr/share/udunits/udunits2.xml
- os: macos
incdir: /usr/local/Cellar/udunits/2.2.28/include
libdir: /usr/local/Cellar/udunits/2.2.28/lib
xml_path: /usr/local/Cellar/udunits/2.2.28/share/udunits/udunits2-common.xml
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Building ${{ matrix.os }} (${{ matrix.arch }}) wheels"
uses: pypa/cibuildwheel@v2.16.2
env:
CIBW_SKIP: "cp36-* cp37-* cp38-* cp312-* pp* *-musllinux*"
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BUILD_FRONTEND: build
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_BEFORE_BUILD_LINUX: yum install -y udunits2-devel
CIBW_BEFORE_BUILD_MACOS: brew install udunits
# https://cibuildwheel.readthedocs.io/en/stable/faq/#apple-silicon
CIBW_TEST_SKIP: "*_arm64"
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: >
python -c 'import cf_units; print(f"cf-units v{cf_units.__version__}")' &&
python -m pytest --pyargs cf_units
UDUNITS2_INCDIR: ${{ matrix.incdir }}
UDUNITS2_LIBDIR: ${{ matrix.libdir }}
UDUNITS2_XML_PATH: ${{ matrix.xml_path }}
CIBW_ENVIRONMENT_PASS_LINUX: UDUNITS2_INCDIR UDUNITS2_LIBDIR UDUNITS2_XML_PATH
- uses: actions/upload-artifact@v3
with:
name: pypi-artifacts
path: ${{ github.workspace }}/wheelhouse/*.whl
build_sdist:
name: "Build sdist"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Building sdist"
shell: bash
run: |
pipx run build --sdist
- uses: actions/upload-artifact@v3
with:
name: pypi-artifacts
path: ${{ github.workspace }}/dist/*.tar.gz
show-artifacts:
needs: [build_bdist, build_sdist]
name: "Show artifacts"
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: pypi-artifacts
path: ${{ github.workspace }}/dist
- shell: bash
run: |
ls -l ${{ github.workspace }}/dist
publish-artifacts-test-pypi:
needs: [build_bdist, build_sdist]
name: "Publish to Test PyPI"
runs-on: ubuntu-latest
# upload to Test PyPI for every commit on main branch
if: github.event_name == 'push' && github.event.ref == 'refs/heads/main'
steps:
- uses: actions/download-artifact@v3
with:
name: pypi-artifacts
path: ${{ github.workspace }}/dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
print_hash: true
publish-artifacts-pypi:
needs: [build_bdist, build_sdist]
name: "Publish to PyPI"
runs-on: ubuntu-latest
# upload to PyPI for every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v3
with:
name: pypi-artifacts
path: ${{ github.workspace }}/dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
print_hash: true