Review supported Python versions and platforms #108
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
| name: Build | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: ["*"] | |
| workflow_dispatch: # allows you to trigger manually | |
| jobs: | |
| build_wheels: | |
| name: Build wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: | |
| - ubuntu-latest # x64 | |
| - ubuntu-24.04-arm # ARM | |
| - macos-15-intel # x64 | |
| - macos-latest # ARM | |
| - windows-latest # x64 | |
| steps: | |
| # See https://cibuildwheel.pypa.io/en/1.x/cpp_standards/ | |
| - uses: ilammy/msvc-dev-cmd@v1 | |
| - uses: actions/checkout@v6 | |
| # Install LLVM 18 on Windows | |
| - name: Install LLVM 18 on Windows | |
| if: runner.os == 'Windows' | |
| run: | | |
| choco install llvm --version=18.1.8 -y --force | |
| echo "C:\Program Files\LLVM\bin" >> $env:GITHUB_PATH | |
| - name: Debug env | |
| run: env | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v3.3.0 | |
| env: | |
| CIBW_ARCHS_LINUX: auto | |
| DISTUTILS_USE_SDK: 1 | |
| MSSdk: 1 | |
| AR: llvm-ar | |
| AS: llvm-as | |
| CC: clang | |
| RANLIB: echo | |
| CIBW_BUILD_VERBOSITY: 5 | |
| with: | |
| package-dir: . | |
| output-dir: wheelhouse | |
| config-file: "{package}/pyproject.toml" | |
| - uses: actions/upload-artifact@v5 | |
| with: | |
| name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | |
| path: ./wheelhouse/*.whl | |
| build_sdist: | |
| name: Build source distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Build sdist | |
| run: pipx run build --sdist | |
| - uses: actions/upload-artifact@v5 | |
| with: | |
| name: cibw-sdist | |
| path: dist/*.tar.gz | |
| create_release: | |
| needs: [build_wheels, build_sdist] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| checks: write | |
| actions: read | |
| issues: read | |
| packages: write | |
| pull-requests: read | |
| repository-projects: read | |
| statuses: read | |
| steps: | |
| - name: Get the tag name and determine if it's a prerelease | |
| id: get_tag_info | |
| run: | | |
| FULL_TAG=${GITHUB_REF#refs/tags/} | |
| if [[ $FULL_TAG == release-* ]]; then | |
| TAG_NAME=${FULL_TAG#release-} | |
| IS_PRERELEASE=false | |
| elif [[ $FULL_TAG == prerelease-* ]]; then | |
| TAG_NAME=${FULL_TAG#prerelease-} | |
| IS_PRERELEASE=true | |
| else | |
| TAG_NAME=$FULL_TAG | |
| IS_PRERELEASE=false | |
| fi | |
| echo "FULL_TAG=$TAG_NAME" >> $GITHUB_ENV | |
| echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV | |
| echo "IS_PRERELEASE=$IS_PRERELEASE" >> $GITHUB_ENV | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| # unpacks all CIBW artifacts into dist/ | |
| pattern: cibw-* | |
| path: dist | |
| merge-multiple: true | |
| - name: Create Draft Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v2 | |
| if: startsWith(github.ref, 'refs/tags/release-') || startsWith(github.ref, 'refs/tags/prerelease-') | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| name: ${{ env.TAG_NAME }} | |
| draft: true | |
| prerelease: ${{ env.IS_PRERELEASE }} | |
| files: "./dist/*" |