-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·53 lines (42 loc) · 1.32 KB
/
deploy.sh
File metadata and controls
executable file
·53 lines (42 loc) · 1.32 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
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# EnSync SDK Deployment Script
# This script builds and deploys the ensync-sdk package to PyPI
set -e # Exit on error
echo "=========================================="
echo "EnSync SDK Deployment Script"
echo "=========================================="
echo ""
# Check if we're in the right directory
if [ ! -f "setup.py" ]; then
echo "Error: setup.py not found. Please run this script from the project root."
exit 1
fi
# Get the current version from setup.py
VERSION=$(grep "version=" setup.py | head -1 | sed 's/.*version="\(.*\)".*/\1/')
echo "Current version: $VERSION"
echo ""
# Confirm deployment
read -p "Deploy version $VERSION to PyPI? (y/n) " -n 1 -r
echo ""
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Deployment cancelled."
exit 0
fi
echo ""
echo "Step 1: Cleaning old builds..."
rm -rf dist/ build/ *.egg-info ensync.egg-info
echo "Step 2: Building package..."
python3 setup.py sdist bdist_wheel
echo ""
echo "Step 3: Checking package with twine..."
python3 -m twine check dist/*
echo ""
echo "Step 4: Uploading to PyPI..."
python3 -m twine upload dist/*
echo ""
echo "=========================================="
echo "✅ Deployment complete!"
echo "Version $VERSION is now available on PyPI"
echo "=========================================="
echo ""
echo "Install with: pip install ensync-sdk==$VERSION"