Python Packaging #40
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: Python Packaging | |
on: | |
workflow_run: | |
workflows: ["Validate"] | |
types: | |
- completed | |
jobs: | |
install: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# see https://github.com/actions/runner-images#available-images | |
os: [macos-latest, ubuntu-latest] | |
python-version: ['3.12'] | |
steps: | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: git checkout | |
uses: actions/checkout@v4 | |
with: | |
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
submodules: true | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel==2.20.0 | |
- name: Build wheels | |
run: python -m cibuildwheel --output-dir wheelhouse | |
env: | |
CIBW_BUILD: pp* cp38-* cp39-* cp310-* cp311-* cp312-* cp313-* | |
CIBW_ARCHS: "auto64" | |
- name: Build sdist | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: ./build-sdist.sh | |
- name: List wheels | |
run: ls -l ./wheelhouse | |
- name: Upload | |
if: ${{ github.ref_name == 'master' }} | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
run: | | |
pip install twine | |
twine upload --verbose --skip-existing wheelhouse/* |