variadic template for TOCBlob parsing #144
This file contains 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
name: Build Python | |
on: | |
push: | |
branches: [ master ] | |
tags: [ v* ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
outputs: | |
SDIST_NAME: ${{ steps.sdist.outputs.SDIST_NAME }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set Dev Version | |
if: ${{ ! (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) }} | |
run: 'sed -i "s/^version = .*/version = \"0.dev${{ github.run_number }}\"/" pyproject.toml' | |
- name: Build sdist | |
id: sdist | |
run: | | |
pipx run build --sdist | |
echo "SDIST_NAME=$(ls -1 dist)" | |
echo "SDIST_NAME=$(ls -1 dist)" >> "$GITHUB_OUTPUT" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: python-sdist | |
path: dist/*.tar.gz | |
build_wheels: | |
needs: [ build_sdist ] | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-22.04, windows-2022 ] | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: python-sdist | |
path: dist | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2.21.3 | |
with: | |
package-dir: dist/${{ needs.build_sdist.outputs.SDIST_NAME }} | |
env: | |
CIBW_ARCHS: auto64 | |
CIBW_SKIP: 'pp* *-musllinux_*' | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: python-wheels-${{ matrix.os }} | |
path: ./wheelhouse/*.whl | |
upload_pypi: | |
needs: [ build_sdist, build_wheels ] | |
name: Upload PyPI | |
runs-on: ubuntu-latest | |
environment: pypi | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: python-* | |
path: dist | |
merge-multiple: true | |
- name: PyPI Release | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: ${{ (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) && 'https://upload.pypi.org/legacy/' || 'https://test.pypi.org/legacy/' }} |