1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
name: Release
on:
release:
types: [published]
env:
DEFAULT_PYTHON: 3.11
jobs:
build:
name: Build PyPI package
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout the repository
uses: actions/checkout@v6.0.1
with:
ref: ${{ github.event.release.target_commitish }}
- name: Set up UV and Python
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ env.DEFAULT_PYTHON }}
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install the project
run: uv sync --all-groups
- name: Run tests
run: |
uv run pytest
- name: Build package
run: |
uv build
- name: Store the distribution packages
uses: actions/upload-artifact@v5
with:
name: python-package-distributions
path: dist/
publish:
name: Publish to PyPI 📦
needs:
- build
runs-on: ubuntu-latest
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/p/asusrouter
steps:
- name: Download all the dists
uses: actions/download-artifact@v6
with:
name: python-package-distributions
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
|