-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-release.sh
More file actions
executable file
·76 lines (65 loc) · 1.96 KB
/
build-release.sh
File metadata and controls
executable file
·76 lines (65 loc) · 1.96 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
#!/bin/bash
# Build release package for KDE Store submission
set -e # Exit on error
# Get project root directory
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$PROJECT_ROOT"
# Check if we're in a git repository
if ! git rev-parse --git-dir > /dev/null 2>&1; then
echo "Error: Not a git repository"
exit 1
fi
# Extract version from metadata.json
METADATA_FILE="package/metadata.json"
if [ ! -f "$METADATA_FILE" ]; then
echo "Error: $METADATA_FILE not found"
exit 1
fi
# Extract version using jq or grep
if command -v jq &> /dev/null; then
VERSION=$(jq -r '.KPlugin.Version' "$METADATA_FILE")
else
# Fallback to grep/sed if jq is not available
VERSION=$(grep -oP '"Version":\s*"\K[^"]+' "$METADATA_FILE")
fi
if [ -z "$VERSION" ]; then
echo "Error: Could not extract version from $METADATA_FILE"
exit 1
fi
# Project name
PROJECT_NAME="ptimer"
ARCHIVE_NAME="${PROJECT_NAME}-${VERSION}"
PLASMOID="${ARCHIVE_NAME}.plasmoid"
echo "Building release package..."
echo "Project: $PROJECT_NAME"
echo "Version: $VERSION"
echo "Archive: $PLASMOID"
echo ""
# Check for uncommitted changes
if ! git diff-index --quiet HEAD --; 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
# Create .plasmoid package (zip of package/ contents, files at root level)
echo "Creating .plasmoid package from git..."
TMPDIR=$(mktemp -d)
git archive HEAD:package | tar -x -C "$TMPDIR"
(cd "$TMPDIR" && zip -r "$PROJECT_ROOT/$PLASMOID" .)
rm -rf "$TMPDIR"
if [ -f "$PLASMOID" ]; then
SIZE=$(du -h "$PLASMOID" | cut -f1)
echo ""
echo "✓ Successfully created: $PLASMOID ($SIZE)"
echo ""
echo "Next steps:"
echo "1. Test the package: unzip -l $PLASMOID"
echo "2. Upload to KDE Store: https://store.kde.org"
echo "3. See KDE_STORE.md for detailed instructions"
else
echo "Error: Failed to create archive"
exit 1
fi