Skip to content

Commit 2ef6d85

Browse files
created publish.yml;
1 parent d2596c6 commit 2ef6d85

File tree

4 files changed

+105
-2
lines changed

4 files changed

+105
-2
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Deploy Sphinx docs to GitHub Pages
22

33
on:
44
push:
5-
branches: [ 2-create-package-for-pypi ]
5+
branches: [ main ]
66

77
permissions:
88
contents: read

.github/workflows/publish.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Publish Python distribution to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
name: Build distribution
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.x"
19+
20+
- name: Check version consistency
21+
run: |
22+
# Extract version from pyproject.toml
23+
PYPROJECT_VERSION=$(grep 'version = ' pyproject.toml | head -1 | cut -d'"' -f2)
24+
25+
# Extract version from __init__.py
26+
INIT_VERSION=$(grep '__version__ = ' llmsql/__init__.py | head -1 | cut -d'"' -f2)
27+
28+
echo "Version in pyproject.toml: $PYPROJECT_VERSION"
29+
echo "Version in __init__.py: $INIT_VERSION"
30+
31+
# Check if versions match
32+
if [ "$PYPROJECT_VERSION" != "$INIT_VERSION" ]; then
33+
echo "Error: Version mismatch between pyproject.toml ($PYPROJECT_VERSION) and __init__.py ($INIT_VERSION)"
34+
exit 1
35+
fi
36+
37+
echo "Version check passed: $PYPROJECT_VERSION"
38+
39+
- name: Install pypa/build
40+
run: >-
41+
python3 -m
42+
pip install
43+
build
44+
--user
45+
- name: Build a binary wheel and a source tarball
46+
run: python3 -m build
47+
- name: Store the distribution packages
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: python-package-distributions
51+
path: dist/
52+
53+
publish-to-pypi:
54+
name: >-
55+
Publish Python distribution to PyPI
56+
if: startsWith(github.ref, 'refs/tags/')
57+
needs:
58+
- build
59+
runs-on: ubuntu-latest
60+
environment:
61+
name: pypi
62+
url: https://pypi.org/p/llmsql
63+
permissions:
64+
id-token: write
65+
66+
steps:
67+
- name: Download all the dists
68+
uses: actions/download-artifact@v4
69+
with:
70+
name: python-package-distributions
71+
path: dist/
72+
- name: Publish distribution to PyPI
73+
uses: pypa/gh-action-pypi-publish@release/v1
74+
75+
publish-to-testpypi:
76+
name: Publish Python distribution to TestPyPI
77+
needs:
78+
- build
79+
runs-on: ubuntu-latest
80+
81+
environment:
82+
name: testpypi
83+
url: https://test.pypi.org/p/llmsql
84+
85+
permissions:
86+
id-token: write
87+
88+
steps:
89+
- name: Download all the dists
90+
uses: actions/download-artifact@v4
91+
with:
92+
name: python-package-distributions
93+
path: dist/
94+
- name: Publish distribution to TestPyPI
95+
uses: pypa/gh-action-pypi-publish@release/v1
96+
with:
97+
repository-url: https://test.pypi.org/legacy/

llmsql/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
import logging
2+
import os
3+
4+
__version__ = "0.1.2"
5+
6+
17
def __getattr__(name: str):
28
if name == "LLMSQLVLLMInference":
39
from .inference.inference import LLMSQLVLLMInference

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "llmsql"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
description = "LLMSQL: Benchmark for Text-to-SQL"
55
authors = [{ name = "Dzmitry Pihulski", email = "[email protected]" }]
66
readme = "README.md"

0 commit comments

Comments
 (0)