-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.sh
More file actions
68 lines (56 loc) · 1.63 KB
/
release.sh
File metadata and controls
68 lines (56 loc) · 1.63 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
#!/bin/bash
# Release script for publishing to PyPI
set -e # Exit on error
echo "🚀 Releasing sourcegraph-mcp to PyPI"
echo ""
# Check if we're in the right directory
if [ ! -f "pyproject.toml" ]; then
echo "❌ Error: pyproject.toml not found. Run this script from the project root."
exit 1
fi
# Get version from pyproject.toml
VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
echo "📦 Version: $VERSION"
echo ""
# Check if git is clean
if [ -n "$(git status --porcelain)" ]; then
echo "⚠️ Warning: You have uncommitted changes."
read -p "Continue anyway? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
fi
# Clean old builds
echo "🧹 Cleaning old builds..."
rm -rf dist/ build/ *.egg-info
echo ""
# Build the package
echo "🔨 Building package..."
python3 -m build
echo ""
# Check the package
echo "🔍 Checking package..."
python3 -m twine check dist/*
echo ""
# Show what will be uploaded
echo "📋 Files to be uploaded:"
ls -lh dist/
echo ""
# Ask for confirmation
read -p "Upload to PyPI? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "❌ Upload cancelled"
exit 1
fi
# Upload to PyPI
echo "⬆️ Uploading to PyPI..."
python3 -m twine upload dist/*
echo ""
echo "✅ Successfully released version $VERSION to PyPI!"
echo ""
echo "🏷️ Don't forget to:"
echo " 1. Commit and push changes: git add . && git commit -m 'Release v$VERSION' && git push"
echo " 2. Create a git tag: git tag v$VERSION && git push origin v$VERSION"
echo " 3. Create a GitHub release at: https://github.com/dalebrubaker/sourcegraph-mcp/releases/new"