-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.sh
executable file
·34 lines (26 loc) · 1.01 KB
/
publish.sh
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
#!/bin/bash
# Ensure we're in the project root directory
cd "$(dirname "$0")"
# Update version number
echo "Current version:"
grep "version" setup.py
read -p "Enter new version number: " VERSION
sed -i "" "s/version=\".*\"/version=\"$VERSION\"/" setup.py
sed -i "" "s/__version__ = \".*\"/__version__ = \"$VERSION\"/" src/analyze_folder_for_llm/__init__.py
# Clean up previous builds
rm -rf build dist *.egg-info
# Build the package
python setup.py sdist bdist_wheel
# Upload to Test PyPI
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
echo "Package uploaded to Test PyPI. Verify it works by installing:"
echo "pip install --index-url https://test.pypi.org/simple/ analyze-folder-for-llm==$VERSION"
read -p "Do you want to upload to PyPI? (y/n) " UPLOAD_TO_PYPI
if [ "$UPLOAD_TO_PYPI" = "y" ]; then
# Upload to PyPI
twine upload dist/*
echo "Package uploaded to PyPI. You can now install it with:"
echo "pip install analyze-folder-for-llm==$VERSION"
else
echo "Skipped uploading to PyPI."
fi