Skip to content

Commit 1ec2ba1

Browse files
Create main.yml
Create a workflow to deploy dev releases
1 parent 3b94993 commit 1ec2ba1

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/main.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish Dev Release to PyPI
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
publish-dev-release:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v2
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: 3.8 # Adjust the Python version as needed
18+
19+
- name: Install dependencies
20+
run: pip install toml twine
21+
22+
- name: Read version from pyproject.toml
23+
id: read-version
24+
run: |
25+
version=$(python -c 'import toml; print(toml.load("pyproject.toml")["tool"]["commitizen"]["version"])')
26+
printf "LITELLM_VERSION=%s" "$version" >> $GITHUB_ENV
27+
28+
- name: Check if version exists on PyPI
29+
id: check-version
30+
run: |
31+
set -e
32+
if twine check --repository-url https://pypi.org/simple/ "litellm==$LITELLM_VERSION" >/dev/null 2>&1; then
33+
echo "Version $LITELLM_VERSION already exists on PyPI. Skipping publish."
34+

0 commit comments

Comments
 (0)