Python Packaging #166
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: | |
os: [macos-13, 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: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
if: matrix.os == 'ubuntu-latest' | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel==2.21.3 setuptools==75.3.0 | |
- name: Build wheels | |
run: cibuildwheel --config-file pyproject.toml --output-dir wheelhouse | |
- name: Build sdist | |
run: ./build-sdist.sh | |
- name: List wheels | |
run: ls -l ./wheelhouse | |
- name: Upload | |
if: github.ref == 'refs/heads/master' | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
run: | | |
pip install twine | |
twine upload --verbose --skip-existing wheelhouse/* |