| 1 |
name: Publish Python 🐍 distribution 📦 to PyPI |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
tags: |
| 6 |
- "*" |
| 7 |
|
| 8 |
jobs: |
| 9 |
build: |
| 10 |
name: Build distribution 📦 |
| 11 |
runs-on: ubuntu-latest |
| 12 |
steps: |
| 13 |
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v6.0.2 |
| 14 |
- name: Set up Python 🐍 |
| 15 |
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
| 16 |
with: |
| 17 |
python-version: '3.14' |
| 18 |
- name: Build a binary wheel and a source tarball |
| 19 |
run: | |
| 20 |
python -m pip install pip==26.0.1 |
| 21 |
python -m pip install build==1.4.2 |
| 22 |
python -m build . |
| 23 |
- name: Store the distribution packages |
| 24 |
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 |
| 25 |
with: |
| 26 |
name: python-package-distributions |
| 27 |
path: dist/ |
| 28 |
pypi-publish: |
| 29 |
name: >- |
| 30 |
Publish Python 🐍 distribution 📦 to PyPI |
| 31 |
needs: |
| 32 |
- build |
| 33 |
runs-on: ubuntu-latest |
| 34 |
environment: |
| 35 |
name: pypi |
| 36 |
url: https://pypi.org/project/pytest-httpx/${{ github.ref_name }} |
| 37 |
permissions: |
| 38 |
id-token: write |
| 39 |
steps: |
| 40 |
- name: Download all the dists |
| 41 |
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 |
| 42 |
with: |
| 43 |
name: python-package-distributions |
| 44 |
path: dist/ |
| 45 |
- name: Publish distribution 📦 to PyPI |
| 46 |
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 |