-
Notifications
You must be signed in to change notification settings - Fork 139
141 lines (138 loc) · 4.25 KB
/
build-tag.yaml
File metadata and controls
141 lines (138 loc) · 4.25 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: dapr-python-release
on:
push:
tags:
- v*
- workflow-v*
- grpc-v*
- flask-v*
- fastapi-v*
- langgraph-v*
- strands-v*
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.10
uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: uv sync --frozen --all-packages --group dev
- name: Run Autoformatter
run: |
uv run ruff check --fix && uv run ruff format
statusResult=$(git status -u --porcelain)
if [ -z "$statusResult" ]
then
exit 0
else
echo "Source files are not formatted correctly. Run 'uv run ruff check --fix && uv run ruff format'."
exit 1
fi
build:
needs: lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python_ver: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python_ver }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python_ver }}
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: uv sync --frozen --all-packages --group dev
- name: Check Typing
run: uv run mypy
- name: Run unit-tests
run: |
uv run coverage run -m unittest discover -v ./tests
uv run coverage run -a -m unittest discover -v ./ext/dapr-ext-workflow/tests
uv run coverage run -a -m unittest discover -v ./ext/dapr-ext-grpc/tests
uv run coverage run -a -m unittest discover -v ./ext/dapr-ext-fastapi/tests
uv run coverage run -a -m unittest discover -v ./ext/dapr-ext-langgraph/tests
uv run coverage run -a -m unittest discover -v ./ext/dapr-ext-strands/tests
uv run coverage run -a -m unittest discover -v ./ext/flask_dapr/tests
uv run coverage xml
- name: Upload test coverage
uses: codecov/codecov-action@v5
publish:
needs: build
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
env:
TWINE_USERNAME: "__token__"
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.10
uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build and publish Dapr Python SDK
if: startsWith(github.ref_name, 'v')
env:
TWINE_PASSWORD: ${{ secrets.PYPI_UPLOAD_PASS }}
run: |
python -m build
twine upload dist/*
- name: Build and publish dapr-ext-workflow
if: startsWith(github.ref_name, 'workflow-v')
env:
TWINE_PASSWORD: ${{ secrets.PYPI_UPLOAD_PASS }}
run: |
cd ext/dapr-ext-workflow
python -m build
twine upload dist/*
- name: Build and publish Dapr Flask Extension
if: startsWith(github.ref_name, 'flask-v')
env:
TWINE_PASSWORD: ${{ secrets.PYPI_UPLOAD_PASS }}
run: |
cd ext/flask_dapr
python -m build
twine upload dist/*
- name: Build and publish dapr-ext-grpc
if: startsWith(github.ref_name, 'grpc-v')
env:
TWINE_PASSWORD: ${{ secrets.PYPI_UPLOAD_PASS }}
run: |
cd ext/dapr-ext-grpc
python -m build
twine upload dist/*
- name: Build and publish dapr-ext-fastapi
if: startsWith(github.ref_name, 'fastapi-v')
env:
TWINE_PASSWORD: ${{ secrets.PYPI_UPLOAD_PASS }}
run: |
cd ext/dapr-ext-fastapi
python -m build
twine upload dist/*
- name: Build and publish dapr-ext-langgraph
if: startsWith(github.ref_name, 'langgraph-v')
env:
TWINE_PASSWORD: ${{ secrets.PYPI_UPLOAD_PASS }}
run: |
cd ext/dapr-ext-langgraph
python -m build
twine upload dist/*
- name: Build and publish dapr-ext-strands
if: startsWith(github.ref_name, 'strands-v')
env:
TWINE_PASSWORD: ${{ secrets.PYPI_UPLOAD_PASS }}
run: |
cd ext/dapr-ext-strands
python -m build
twine upload dist/*