-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·40 lines (34 loc) · 1.17 KB
/
build.sh
File metadata and controls
executable file
·40 lines (34 loc) · 1.17 KB
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
35
36
37
38
39
40
#!/usr/bin/env bash
# =========================================================
# build.sh - Build and publish xphasesync package
# Usage:
# ./build.sh local # Build and install locally
# ./build.sh test # Upload to TestPyPI
# ./build.sh pypi # Upload to PyPI
# =========================================================
set -e # exit on error
MODE=${1:-local}
echo "🚀 Starting build in mode: $MODE"
# Clean old builds
rm -rf build dist *.egg-info
# Build wheel + source distribution
python -m build
if [ "$MODE" = "local" ]; then
echo "📦 Installing package locally (editable mode)..."
pip install -e .
echo "✅ Local install complete."
elif [ "$MODE" = "test" ]; then
echo "📤 Uploading to TestPyPI..."
twine upload --repository testpypi dist/*
echo "✅ Uploaded to TestPyPI. Install with:"
echo " pip install -i https://test.pypi.org/simple xphasesync"
elif [ "$MODE" = "pypi" ]; then
echo "📤 Uploading to PyPI..."
twine upload dist/*
echo "✅ Uploaded to PyPI. Install with:"
echo " pip install xphasesync"
else
echo "❌ Unknown mode: $MODE"
echo "Usage: ./build.sh [local|test|pypi]"
exit 1
fi