-
Notifications
You must be signed in to change notification settings - Fork 64
58 lines (47 loc) · 1.69 KB
/
Copy pathpython-publish.yml
File metadata and controls
58 lines (47 loc) · 1.69 KB
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
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: PyPI Package
on:
release:
types: [published]
workflow_dispatch:
push:
tags:
- "v*.*.*"
permissions:
contents: read
jobs:
pypi_upload:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/ardupilot_methodic_configurator
permissions:
id-token: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
# https://docs.astral.sh/uv/guides/integration/github/
- name: Install uv and set the python version
uses: astral-sh/setup-uv@557e51de59eb14aaaba2ed9621916900a91d50c6 # v6.6.1
with:
python-version: '3.13'
activate-environment: true
- name: Install dependencies
run: |
# Read pypi_dist from pyproject.toml and install those packages with uv
PKGS="$(python scripts/list_pypi_build_dependencies.py)"
if [ -n "$PKGS" ]; then
uv pip install $PKGS
else
echo "No pypi_dist entries found in pyproject.toml; skipping install"
fi
- name: Build package
run: python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # release/v1