forked from AppDaemon/appdaemon
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (53 loc) · 1.74 KB
/
pypi-upload.yml
File metadata and controls
61 lines (53 loc) · 1.74 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
59
60
61
name: PyPI Upload
on:
workflow_run:
workflows: ["Python CI"]
types:
- completed
jobs:
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
# Only publish on successful CI runs for tags starting with 'v' (e.g., v1.2.3)
if: |
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'push' &&
startsWith(github.event.workflow_run.head_branch, 'v')
permissions:
contents: read
id-token: write
actions: read
env:
UV_LOCKED: true
UV_COMPILE_BYTECODE: true
UV_NO_EDITABLE: true
UV_NO_PROGRESS: true
UV_NO_SYNC: true
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install uv and set the python version
id: setup-uv
uses: astral-sh/setup-uv@v7
with:
# https://docs.astral.sh/uv/guides/integration/github/#using-uv-in-github-actions
# It is considered best practice to pin to a specific uv version
version: "0.9.26"
# https://github.com/astral-sh/setup-uv?tab=readme-ov-file#enable-caching
enable-cache: true
cache-dependency-glob: uv.lock
- name: Download Python package artifact
uses: actions/download-artifact@v7
with:
name: python-package
path: dist/
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install package from wheel
run: uv pip install dist/*.whl
- name: Run functional tests
run: uv run pytest -m functional
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}