-
Notifications
You must be signed in to change notification settings - Fork 63
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@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
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@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
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@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1