Skip to content

PYTHON-4421 Streamline wheel building #18

PYTHON-4421 Streamline wheel building

PYTHON-4421 Streamline wheel building #18

Workflow file for this run

name: Python Wheels
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+.post[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+[a-b][0-9]+"
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
workflow_dispatch:
pull_request:
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true
jobs:
build_wheels:
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
buildplat: ["win_amd64", "win32"]
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: "cp3*-${{ matrix.buildplat }}"
CIBW_PRERELEASE_PYTHONS: "True"
CIBW_TEST_COMMAND: "python -c \"import winkerberos;print(winkerberos.__version__)\""
- name: Assert all versions in wheelhouse
if: ${{ ! startsWith(matrix.buildplat[1], 'macos') }}
run: |
ls wheelhouse/*cp37*.whl
ls wheelhouse/*cp38*.whl
ls wheelhouse/*cp39*.whl
ls wheelhouse/*cp310*.whl
ls wheelhouse/*cp311*.whl
ls wheelhouse/*cp312*.whl
- uses: actions/upload-artifact@v3
with:
name: wheel-${{ matrix.buildplat }}
path: ./wheelhouse/*.whl
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
# Build sdist on lowest supported Python
python-version: '3.7'
- name: Build SDist
run: |
pip install check-manifest build
check-manifest -v
python -m build --sdist .
- uses: actions/upload-artifact@v3
with:
name: "sdist"
path: dist/*.tar.gz
collect_dist:
runs-on: ubuntu-latest
needs: [build_wheels, make_sdist]
name: Download Wheels
steps:
- name: Download all workflow run artifacts
uses: actions/download-artifact@v3
- name: Flatten directory
working-directory: .
run: |
find . -mindepth 2 -type f -exec mv {} . \;
find . -type d -empty -delete
- uses: actions/upload-artifact@v3
with:
name: all-dist-${{ github.run_id }}
path: "./*"
publish:
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/#publishing-the-distribution-to-pypi
needs: [collect_dist]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: all-dist-${{ github.run_id }}
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1