-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·89 lines (70 loc) · 2.27 KB
/
release.sh
File metadata and controls
executable file
·89 lines (70 loc) · 2.27 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
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (C) 2025 Akshat Kotpalliwar (alias IntegerAlex) <inquiry.akshatkotpalliwar@gmail.com>
# SPDX-License-Identifier: GPL-3.0-only
# Release script for creating and publishing rig binary releases
set -e
# Get version from pyproject.toml
VERSION=$(grep -E '^version = ' pyproject.toml | sed -E "s/version = ['\"](.*)['\"]/\1/")
if [ -z "$VERSION" ]; then
echo "❌ Could not determine version from pyproject.toml"
exit 1
fi
TAG="v${VERSION}"
BINARY="dist/rig"
echo "🔨 Building binary for release ${TAG}..."
# Build the binary
if ! uv run pyinstaller rig.spec --clean; then
echo "❌ Build failed!"
exit 1
fi
# Check if binary exists
if [ ! -f "$BINARY" ]; then
echo "❌ Binary not found at $BINARY"
exit 1
fi
echo "✅ Binary built successfully!"
echo "📊 Binary size: $(du -h $BINARY | cut -f1)"
# Check if tag already exists
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "⚠️ Tag $TAG already exists. Do you want to delete and recreate it? (y/N)"
read -r response
if [[ "$response" =~ ^[Yy]$ ]]; then
git tag -d "$TAG"
git push origin ":refs/tags/$TAG" 2>/dev/null || true
else
echo "❌ Aborted. Tag $TAG already exists."
exit 1
fi
fi
# Create and push tag
echo "🏷️ Creating tag $TAG..."
git tag -a "$TAG" -m "Release $TAG"
git push origin "$TAG"
# Check if release already exists
if gh release view "$TAG" >/dev/null 2>&1; then
echo "⚠️ Release $TAG already exists. Do you want to delete and recreate it? (y/N)"
read -r response
if [[ "$response" =~ ^[Yy]$ ]]; then
gh release delete "$TAG" --yes
else
echo "❌ Aborted. Release $TAG already exists."
exit 1
fi
fi
# Create release with binary
echo "🚀 Creating GitHub release $TAG..."
gh release create "$TAG" "$BINARY" \
--title "$TAG" \
--notes "Release $TAG - Binary distribution of rig system setup tool
## Installation
Download the binary and make it executable:
\`\`\`bash
chmod +x rig
./rig
\`\`\`
## What's included
- Standalone binary (no Python installation required)
- All dependencies bundled
- Linux x86_64 compatible"
echo "✅ Release created successfully!"
echo "🔗 Release URL: https://github.com/IntegerAlex/rig/releases/tag/$TAG"