Skip to content

Commit f975b79

Browse files
committed
Use uv to release package
1 parent 2c3ac6d commit f975b79

File tree

1 file changed

+30
-22
lines changed

1 file changed

+30
-22
lines changed

.github/workflows/release_llama_index_server.yml

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,41 +22,46 @@ jobs:
2222
working-directory: ./llama-index-server
2323
if: |
2424
github.event_name == 'push' &&
25-
!startsWith(github.ref, 'refs/heads/release/llama-index-server-v')
25+
!startsWith(github.ref, 'refs/heads/release/llama-index-server-v') &&
26+
!contains(github.event.head_commit.message, 'Release: llama-index-server v')
2627
2728
steps:
2829
- name: Checkout Repository
2930
uses: actions/checkout@v4
3031
with:
3132
fetch-depth: 0
3233

34+
- name: Install uv
35+
uses: astral-sh/setup-uv@v5
36+
with:
37+
enable-cache: true
38+
3339
- name: Set up Python
3440
uses: actions/setup-python@v5
3541
with:
3642
python-version: "3.11"
3743

38-
- name: Install Poetry
39-
run: |
40-
curl -sSL https://install.python-poetry.org | python3 -
41-
4244
- name: Install dependencies
43-
run: poetry install
45+
shell: bash
46+
run: uv sync --all-extras --dev
4447

4548
- name: Setup Git
4649
run: |
4750
git config --global user.email "github-actions[bot]@users.noreply.github.com"
4851
git config --global user.name "github-actions[bot]"
4952
5053
- name: Bump patch version
54+
shell: bash
5155
run: |
52-
poetry version patch
56+
uvx --from=toml-cli toml set --toml-path=pyproject.toml project.version $(uvx --from=toml-cli toml get --toml-path=pyproject.toml project.version | awk -F. '{$NF = $NF + 1;}1' OFS=.)
5357
git add pyproject.toml
54-
git commit -m "chore(release): bump version to $(poetry version -s)"
58+
git commit -m "chore(release): bump llama-index-server version to $(uvx --from=toml-cli toml get --toml-path=pyproject.toml project.version)"
5559
5660
- name: Get current version
5761
id: get_version
62+
shell: bash
5863
run: |
59-
version=$(poetry version -s)
64+
version=$(uvx --from=toml-cli toml get --toml-path=pyproject.toml project.version)
6065
echo "current_version=${version}" >> "$GITHUB_OUTPUT"
6166
6267
- name: Create Release PR
@@ -91,31 +96,34 @@ jobs:
9196
- name: Checkout Repository
9297
uses: actions/checkout@v4
9398

99+
- name: Install uv
100+
uses: astral-sh/setup-uv@v5
101+
with:
102+
enable-cache: true
103+
94104
- name: Set up Python
95105
uses: actions/setup-python@v5
96106
with:
97107
python-version: "3.11"
98108

99-
- name: Install Poetry
100-
run: |
101-
curl -sSL https://install.python-poetry.org | python3 -
102-
103109
- name: Install dependencies
104-
run: poetry install
110+
shell: bash
111+
run: uv sync --all-extras
105112

106113
- name: Get current version
107114
id: get_version
115+
shell: bash
108116
run: |
109-
version=$(poetry version -s)
117+
version=$(uvx --from=toml-cli toml get --toml-path=pyproject.toml project.version)
110118
echo "current_version=${version}" >> "$GITHUB_OUTPUT"
111119
112-
- name: Build and publish to PyPI
113-
uses: JRubics/[email protected]
114-
with:
115-
python_version: "3.11"
116-
pypi_token: ${{ secrets.PYPI_TOKEN }}
117-
package_directory: "llama-index-server"
118-
poetry_install_options: "--without dev"
120+
- name: Build package
121+
shell: bash
122+
run: uv build --no-sources
123+
124+
- name: Publish to PyPI
125+
shell: bash
126+
run: uv publish --token ${{ secrets.PYPI_TOKEN }}
119127

120128
- name: Create GitHub Release
121129
uses: softprops/action-gh-release@v2

0 commit comments

Comments
 (0)