#!/bin/bash echo "🚀 Starting the PIP package build & upload process..." # Step 1: Ensure required tools are installed echo "✅ Installing required dependencies (setuptools, wheel, twine)..." pip install --upgrade setuptools wheel twine # Step 2: Remove old build directories echo "🗑️ Cleaning old builds..." rm -rf dist build *.egg-info # Step 3: Build the package echo "📦 Building the package..." python setup.py sdist bdist_wheel # Step 4: Ask user where to upload read -p "Upload to (1) PyPI or (2) TestPyPI? [1/2]: " upload_option if [ "$upload_option" == "2" ]; then echo "🚀 Uploading package to TestPyPI..." twine upload --repository testpypi dist/* echo "✅ Package uploaded to TestPyPI!" else echo "🚀 Uploading package to PyPI..." twine upload dist/* echo "✅ Package uploaded to PyPI!" fi echo "🎉 Done! Your package is now available online."