Make cibw happy #2
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: cibuildwheel | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
inputs: | |
publish: | |
description: 'Publish wheels to PyPI: (testpypi/pypi/none)' | |
required: false | |
type: choice | |
options: | |
- testpypi | |
- pypi | |
- none | |
default: none | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# os: [ubuntu-latest, windows-latest, macos-12, macos-14] | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
# Select wheels | |
CIBW_BUILD: "cp311-manylinux_x86_64 cp311-win_amd64 cp311-macosx_x86_64 cp311-macosx_arm64" | |
CIBW_ARCHS: "native" | |
# use manylinux2014 | |
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 | |
CIBW_TEST_COMMAND: "python -m tccbox" | |
with: | |
package-dir: . | |
output-dir: wheelhouse | |
config-file: "{package}/pyproject.toml" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: cibw-wheels-${{ runner.os }}-${{ runner.arch }} | |
path: ./wheelhouse/*.whl | |
publish-to-testpypi: | |
name: Publish Python wheels to TestPyPI | |
needs: | |
- build_wheels | |
runs-on: ubuntu-latest | |
if: github.event.inputs.publish == 'testpypi' | |
environment: | |
name: testpypi | |
url: https://test.pypi.org/p/tccbox | |
permissions: | |
id-token: write # IMPORTANT: mandatory for trusted publishing | |
steps: | |
- name: Download all the dists | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: cibw-wheels-* | |
merge-multiple: true | |
path: dist/ | |
- name: List all the dists | |
run: ls -l dist/ | |
- name: Publish distribution 📦 to TestPyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ |