-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease
More file actions
executable file
·75 lines (62 loc) · 1.99 KB
/
release
File metadata and controls
executable file
·75 lines (62 loc) · 1.99 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
#!/bin/bash
#
# Single command automated release script for Claude Code
# Usage: ./release 1.2.3 ["Optional commit message"]
#
set -e # Exit on any error
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Function to print colored output
print_status() {
echo -e "${BLUE}[RELEASE]${NC} $1"
}
print_success() {
echo -e "${GREEN}[SUCCESS]${NC} $1"
}
print_warning() {
echo -e "${YELLOW}[WARNING]${NC} $1"
}
print_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
# Check if version provided
if [ -z "$1" ]; then
print_error "Version required!"
echo ""
echo "Usage: ./release <version> [commit-message]"
echo "Examples:"
echo " ./release 1.2.3"
echo " ./release 1.2.4 'Add new API endpoints'"
echo ""
echo "This script automates the complete release process:"
echo " • Stages and commits any pending changes"
echo " • Updates plugin.xml and composer.json versions"
echo " • Creates git tag and pushes to trigger GitHub Actions"
echo " • Provides release tracking URLs"
exit 1
fi
VERSION="$1"
COMMIT_MSG="${2:-Prepare for release $VERSION}"
# Validate version format
if ! [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
print_error "Version must be in format X.Y.Z (e.g., 1.2.3)"
exit 1
fi
print_status "🚀 Starting automated release for version $VERSION"
# Check if we're in a git repository
if ! git rev-parse --git-dir > /dev/null 2>&1; then
print_error "Not in a git repository!"
exit 1
fi
# Use PHP release script
print_status "🔧 Executing PHP release automation..."
php scripts/release.php "$VERSION" "$COMMIT_MSG"
print_success "🎉 Automated release completed!"
print_status "📊 Next steps:"
echo " • Monitor GitHub Actions: https://github.com/btafoya/revive-adserver-restapi-plugin/actions"
echo " • Check release: https://github.com/btafoya/revive-adserver-restapi-plugin/releases"
echo " • Download will be: reviveRestApi-$VERSION.zip"