Skip to content

Commit fef1150

Browse files
authored
create_releases (#25)
1 parent 4eefe73 commit fef1150

3 files changed

Lines changed: 87 additions & 0 deletions

File tree

.github/workflows/cd-langchain.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,44 @@ jobs:
8080
8181
- name: Publish package
8282
run: uv publish
83+
84+
release:
85+
name: Create GitHub release
86+
needs: build
87+
runs-on: ubuntu-latest
88+
permissions:
89+
contents: write
90+
91+
steps:
92+
- uses: actions/checkout@v6
93+
94+
- name: Get version
95+
id: version
96+
run: |
97+
VERSION=$(grep '^__version__' packages/uipath_langchain_client/src/uipath_langchain_client/__version__.py | sed -n 's/.*"\([^"]*\)".*/\1/p')
98+
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
99+
100+
- name: Extract changelog section
101+
run: |
102+
python3 -c "
103+
import re
104+
version = '''${{ steps.version.outputs.version }}'''
105+
with open('packages/uipath_langchain_client/CHANGELOG.md') as f:
106+
content = f.read()
107+
pattern = r'(## \[' + re.escape(version) + r'\][^\n]*\n)(.*?)(?=\n## \[|\Z)'
108+
match = re.search(pattern, content, re.DOTALL)
109+
notes = match.group(0).strip() if match else ('Release ' + version)
110+
with open('release_notes.md', 'w') as f:
111+
f.write(notes)
112+
"
113+
114+
- name: Create GitHub release
115+
uses: softprops/action-gh-release@v2
116+
with:
117+
tag_name: langchain-v${{ steps.version.outputs.version }}
118+
name: langchain-v${{ steps.version.outputs.version }}
119+
body_path: release_notes.md
120+
skip_if_tag_exists: true
121+
env:
122+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83123

.github/workflows/cd.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,44 @@ jobs:
4949
5050
- name: Publish package
5151
run: uv publish
52+
53+
release:
54+
name: Create GitHub release
55+
needs: build
56+
runs-on: ubuntu-latest
57+
permissions:
58+
contents: write
59+
60+
steps:
61+
- uses: actions/checkout@v6
62+
63+
- name: Get version
64+
id: version
65+
run: |
66+
VERSION=$(grep '^__version__' src/uipath_llm_client/__version__.py | sed -n 's/.*"\([^"]*\)".*/\1/p')
67+
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
68+
69+
- name: Extract changelog section
70+
run: |
71+
python3 -c "
72+
import re
73+
version = '''${{ steps.version.outputs.version }}'''
74+
with open('CHANGELOG.md') as f:
75+
content = f.read()
76+
pattern = r'(## \[' + re.escape(version) + r'\][^\n]*\n)(.*?)(?=\n## \[|\Z)'
77+
match = re.search(pattern, content, re.DOTALL)
78+
notes = match.group(0).strip() if match else ('Release ' + version)
79+
with open('release_notes.md', 'w') as f:
80+
f.write(notes)
81+
"
82+
83+
- name: Create GitHub release
84+
uses: softprops/action-gh-release@v2
85+
with:
86+
tag_name: v${{ steps.version.outputs.version }}
87+
name: v${{ steps.version.outputs.version }}
88+
body_path: release_notes.md
89+
skip_if_tag_exists: true
90+
env:
91+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5292

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ on:
44
pull_request:
55
branches:
66
- main
7+
paths:
8+
- "src/**"
9+
- "packages/**"
10+
- "tests/**"
11+
- "pyproject.toml"
12+
- "uv.lock"
13+
- ".python-version"
714

815
jobs:
916
type_check:

0 commit comments

Comments
 (0)