| 1 |
name: Publish distributions to PyPI |
| 2 |
|
| 3 |
on: |
| 4 |
release: |
| 5 |
types: |
| 6 |
- published |
| 7 |
|
| 8 |
jobs: |
| 9 |
pypi-build: |
| 10 |
name: Build Python wheel |
| 11 |
runs-on: ubuntu-latest |
| 12 |
steps: |
| 13 |
- uses: actions/checkout@v4 |
| 14 |
with: |
| 15 |
fetch-depth: 0 |
| 16 |
- name: Set up Python |
| 17 |
uses: actions/setup-python@v5 |
| 18 |
with: |
| 19 |
python-version: "3.13" |
| 20 |
- name: Install build tools |
| 21 |
run: pip install wheel build |
| 22 |
- name: Build wheel & sdist |
| 23 |
run: python -m build |
| 24 |
- name: Upload distribution artifacts |
| 25 |
uses: actions/upload-artifact@v4 |
| 26 |
with: |
| 27 |
name: dist |
| 28 |
path: dist |
| 29 |
|
| 30 |
pypi-publish: |
| 31 |
name: Publish distributions to PyPI |
| 32 |
runs-on: ubuntu-latest |
| 33 |
needs: pypi-build |
| 34 |
environment: |
| 35 |
name: pypi |
| 36 |
url: https://pypi.org/p/ha-silabs-firmware-client |
| 37 |
permissions: |
| 38 |
# IMPORTANT: this permission is mandatory for Trusted Publishing |
| 39 |
id-token: write |
| 40 |
steps: |
| 41 |
- name: Download distribution artifacts |
| 42 |
uses: actions/download-artifact@v4 |
| 43 |
with: |
| 44 |
name: dist |
| 45 |
path: dist |
| 46 |
- name: Publish distribution to PyPI |
| 47 |
uses: pypa/gh-action-pypi-publish@release/v1 |