| 1 |
name: build |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
tags: |
| 6 |
- v* |
| 7 |
|
| 8 |
concurrency: |
| 9 |
group: build-${{ github.head_ref }} |
| 10 |
|
| 11 |
jobs: |
| 12 |
build: |
| 13 |
name: Build wheels and source distribution |
| 14 |
runs-on: ubuntu-latest |
| 15 |
|
| 16 |
steps: |
| 17 |
- uses: actions/checkout@v3 |
| 18 |
|
| 19 |
- name: Install build dependencies |
| 20 |
run: python -m pip install --upgrade build |
| 21 |
|
| 22 |
- name: Build |
| 23 |
run: python -m build |
| 24 |
|
| 25 |
- uses: actions/upload-artifact@v3 |
| 26 |
with: |
| 27 |
name: artifacts |
| 28 |
path: dist/* |
| 29 |
if-no-files-found: error |
| 30 |
|
| 31 |
publish: |
| 32 |
name: Publish release |
| 33 |
needs: |
| 34 |
- build |
| 35 |
runs-on: ubuntu-latest |
| 36 |
|
| 37 |
steps: |
| 38 |
- uses: actions/download-artifact@v3 |
| 39 |
with: |
| 40 |
name: artifacts |
| 41 |
path: dist |
| 42 |
|
| 43 |
- name: Push build artifacts to PyPI |
| 44 |
uses: pypa/[email protected] |
| 45 |
with: |
| 46 |
skip_existing: true |
| 47 |
user: __token__ |
| 48 |
password: ${{ secrets.PYPI_API_TOKEN }} |