-
Notifications
You must be signed in to change notification settings - Fork 1
123 lines (104 loc) · 3.52 KB
/
Copy pathcd-langchain.yml
File metadata and controls
123 lines (104 loc) · 3.52 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
name: cd-langchain
on:
push:
branches:
- main
paths:
- 'packages/uipath_langchain_client/src/uipath_langchain_client/__version__.py'
workflow_run:
workflows: ["cd"]
types:
- completed
workflow_dispatch:
jobs:
build:
if: >
github.event_name == 'workflow_dispatch' ||
(
github.event_name == 'push' &&
!contains(
join(github.event.commits.*.modified, ' '),
'src/uipath_llm_client/__version__.py'
)
) ||
(
github.event_name == 'workflow_run' &&
github.event.workflow_run.conclusion == 'success' &&
contains(
join(github.event.workflow_run.head_commit.modified, ' '),
'packages/uipath_langchain_client/src/uipath_langchain_client/__version__.py'
) &&
contains(
join(github.event.workflow_run.head_commit.modified, ' '),
'src/uipath_llm_client/__version__.py'
)
)
name: Build package
runs-on: ubuntu-latest
environment: pypi
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
- name: Wait for package indexing
if: github.event_name == 'workflow_run'
run: sleep 120
- name: Setup uv
uses: astral-sh/setup-uv@v7
with:
version: "0.9.27"
enable-cache: true
- name: "Set up Python"
uses: actions/setup-python@v6
with:
python-version-file: ".python-version"
- name: "Install dependencies"
run: uv sync --dev --all-extras --locked
- name: Build package
run: uv build --package uipath-langchain-client
- name: Smoke test (wheel with all extras)
run: |
WHEEL=$(ls dist/*.whl)
uv run --isolated --no-project --with "${WHEEL}[all]" tests/langchain/langchain_smoke_test.py
- name: Smoke test (source distribution with all extras)
run: |
SDIST=$(ls dist/*.tar.gz)
uv run --isolated --no-project --with "${SDIST}[all]" tests/langchain/langchain_smoke_test.py
- name: Publish package
run: uv publish
release:
name: Create GitHub release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: Get version
id: version
run: |
VERSION=$(grep '^__version__' packages/uipath_langchain_client/src/uipath_langchain_client/__version__.py | sed -n 's/.*"\([^"]*\)".*/\1/p')
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Extract changelog section
run: |
python3 -c "
import re
version = '''${{ steps.version.outputs.version }}'''
with open('packages/uipath_langchain_client/CHANGELOG.md') as f:
content = f.read()
pattern = r'(## \[' + re.escape(version) + r'\][^\n]*\n)(.*?)(?=\n## \[|\Z)'
match = re.search(pattern, content, re.DOTALL)
notes = match.group(0).strip() if match else ('Release ' + version)
with open('release_notes.md', 'w') as f:
f.write(notes)
"
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: langchain-v${{ steps.version.outputs.version }}
name: UiPath LangChain Client [langchain-v${{ steps.version.outputs.version }}]
body_path: release_notes.md
skip_if_tag_exists: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}