🔧 Resistance model binding python #12
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: Publish Python 🐍 distributions 📦 to PyPI | |
on: | |
release: | |
types: [published] | |
pull_request: | |
merge_group: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
build_wheels: | |
name: ${{ matrix.os }} wheels | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest ] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Build wheels | |
uses: pypa/[email protected] | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build Python 🐍 source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Build SDist | |
run: pipx run build --sdist | |
- name: Install sdist | |
run: python -m pip install --verbose dist/*.tar.gz | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: dist/*.tar.gz | |
Upload-PyPi: | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifact | |
path: dist | |
- name: Publish wheels and source distribution to PyPi | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
skip-existing: true | |
verbose: true |