-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy-beta.sh
More file actions
executable file
Β·143 lines (120 loc) Β· 3.93 KB
/
deploy-beta.sh
File metadata and controls
executable file
Β·143 lines (120 loc) Β· 3.93 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/bin/bash
# Beta Deployment script for xcode-mcp-server
# This script builds and publishes BETA packages to PyPI
set -e # Exit on error
echo "π Starting xcode-mcp-server BETA deployment..."
echo ""
# Pre-flight: ensure no unstaged changes
UNSTAGED=$(git diff --name-only)
if [ -n "$UNSTAGED" ]; then
echo "β You have unstaged changes:"
git diff --stat
echo ""
echo "Please stage ('git add') or commit your changes before deploying."
exit 1
fi
echo "β
No unstaged changes"
echo ""
/bin/echo -n "Hit enter to continue:"
read foo
# Set up venv and install deploy dependencies
source "$(dirname "${BASH_SOURCE[0]}")/_venv-setup.sh"
pip install -q hatch build twine
echo ""
# Create dist-archive directory if it doesn't exist
mkdir -p dist-archive
# Archive any existing dist files
if [ -d "dist" ] && [ "$(ls -A dist 2>/dev/null)" ]; then
echo "π¦ Archiving previous dist files..."
mv dist/* dist-archive/
echo ""
fi
# Clean dist directory
echo "π§Ή Cleaning dist directory..."
rm -rf dist
mkdir -p dist
echo ""
# Get current version and increment beta version
echo "π Incrementing beta version..."
CURRENT_VERSION=$(hatch version)
echo "Current version: $CURRENT_VERSION"
# Check if current version is already a beta (e.g., 1.2.3b4)
if [[ $CURRENT_VERSION =~ ^([0-9]+\.[0-9]+\.[0-9]+)b([0-9]+)$ ]]; then
# Already a beta - increment beta number
BASE_VERSION="${BASH_REMATCH[1]}"
BETA_NUM="${BASH_REMATCH[2]}"
NEW_BETA_NUM=$((BETA_NUM + 1))
NEW_VERSION="${BASE_VERSION}b${NEW_BETA_NUM}"
echo "Incrementing beta: $CURRENT_VERSION -> $NEW_VERSION"
elif [[ $CURRENT_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
# Release version - increment patch and add b1
if [[ $CURRENT_VERSION =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
MAJOR="${BASH_REMATCH[1]}"
MINOR="${BASH_REMATCH[2]}"
PATCH="${BASH_REMATCH[3]}"
NEW_PATCH=$((PATCH + 1))
NEW_VERSION="${MAJOR}.${MINOR}.${NEW_PATCH}b1"
echo "Creating first beta of next patch: $CURRENT_VERSION -> $NEW_VERSION"
else
echo "β Could not parse version: $CURRENT_VERSION"
exit 1
fi
else
echo "β Unexpected version format: $CURRENT_VERSION"
echo "Expected formats: X.Y.Z or X.Y.ZbN"
exit 1
fi
hatch version "$NEW_VERSION"
echo ""
# Build the package
echo "π¨ Building package..."
python -m build
echo ""
# Copy new build to archive
echo "πΎ Copying new build to archive..."
cp dist/* dist-archive/
echo ""
# Upload to PyPI
echo "π€ Uploading to PyPI..."
twine upload dist/*
echo ""
# Verify on PyPI
echo "π Verifying version $NEW_VERSION on PyPI..."
sleep 2
if curl -sf "https://pypi.org/pypi/xcode-mcp-server/$NEW_VERSION/json" > /dev/null 2>&1; then
echo "β
Version $NEW_VERSION confirmed on PyPI"
else
echo "β οΈ Could not verify version $NEW_VERSION on PyPI."
echo "Skipping auto-commit. Please verify manually and commit the version change."
exit 1
fi
echo ""
# Commit and push the version bump
echo "π Committing version bump..."
git add xcode_mcp_server/__init__.py
git add dist
git add dist-archive
git commit -m "v$NEW_VERSION"
git push
echo ""
echo "β
Beta deployment complete! v$NEW_VERSION is live."
echo ""
echo "Test the deployed beta version with:"
echo ""
echo " uvx xcode-mcp-server==$NEW_VERSION"
echo ""
# Optional: Update Claude Code MCP server
read -p "Update Claude Code to use this beta version? (y/n): " -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo ""
echo "π Updating Claude Code MCP configuration..."
# Remove existing xcode-mcp-server
echo "Removing existing xcode-mcp-server..."
claude mcp remove xcode-mcp-server || true
# Add new beta version
echo "Adding xcode-mcp-server $NEW_VERSION..."
claude mcp add --scope user --transport stdio -- xcode-mcp-server `which uvx` "xcode-mcp-server==$NEW_VERSION"
echo ""
echo "β
Claude Code updated! Restart Claude Code for changes to take effect."
fi
exit 0