Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Builds platform wheels for Linux (manylinux), Windows, and macOS, then | |
| # publishes everything to PyPI via OIDC Trusted Publishing (no API token). | |
| # Triggered when a GitHub Release is published. | |
| name: Upload Python Package | |
| on: | |
| release: | |
| types: [published] | |
| permissions: | |
| contents: read | |
| jobs: | |
| # ── Build binary wheels (one runner per platform) ─────────────────────────── | |
| build-wheels: | |
| name: Build wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v2.22.0 | |
| env: | |
| # CPython 3.9 – 3.14; skip PyPy (not validated with this extension). | |
| # Python 3.8 reached EOL October 2024 and is no longer built. | |
| CIBW_BUILD: cp39-* cp310-* cp311-* cp312-* cp313-* cp314-* | |
| # Skip musllinux (Alpine / musl libc) on all architectures. | |
| # Two runtime dependencies are unavailable in the default musl images: | |
| # • zlib development headers (needed at build time) | |
| # • iconv (encoding transcoding) — musl libc does not include iconv; | |
| # a separate libiconv package would be required. | |
| # Re-enable and add a CIBW_BEFORE_BUILD step if musl support is needed. | |
| CIBW_SKIP: "*-musllinux_*" | |
| # macOS: build both Intel and Apple-Silicon wheels in a single job via | |
| # cross-compilation (no separate runner needed for arm64). | |
| CIBW_ARCHS_MACOS: x86_64 arm64 | |
| # Linux manylinux: x86_64 only. | |
| # Add aarch64 later via QEMU (CIBW_ARCHS_LINUX: x86_64 aarch64 + | |
| # CIBW_BEFORE_ALL_LINUX steps) if an ARM release is needed. | |
| CIBW_ARCHS_LINUX: x86_64 | |
| # Windows: 64-bit only. | |
| CIBW_ARCHS_WINDOWS: AMD64 | |
| # manylinux pre-build: ensure zlib development headers are present. | |
| # iconv is part of glibc in all manylinux images — no extra install. | |
| CIBW_BEFORE_BUILD_LINUX: yum install -y zlib-devel || apt-get install -y zlib1g-dev || true | |
| # macOS pre-build: zlib and iconv are in the Xcode SDK; no extra step. | |
| # Windows: zlib is vendored (vendor/zlib/zlib.h); iconv uses Win32 API. | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: cibw-wheels-${{ matrix.os }} | |
| path: ./wheelhouse/*.whl | |
| # ── Build source distribution ──────────────────────────────────────────────── | |
| build-sdist: | |
| name: Build source distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Install build frontend | |
| run: python -m pip install build | |
| - name: Build sdist | |
| run: python -m build --sdist | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: cibw-sdist | |
| path: dist/*.tar.gz | |
| # ── Publish to PyPI via OIDC Trusted Publishing ────────────────────────────── | |
| pypi-publish: | |
| name: Publish to PyPI | |
| runs-on: ubuntu-latest | |
| needs: [build-wheels, build-sdist] | |
| permissions: | |
| # Required for OIDC Trusted Publishing — no API token needed. | |
| id-token: write | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/docx-comment-parser | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: cibw-* | |
| path: dist | |
| merge-multiple: true | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |