forked from tranvuongquocdat/SideScreen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·52 lines (44 loc) · 1.28 KB
/
Copy pathrelease.sh
File metadata and controls
executable file
·52 lines (44 loc) · 1.28 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
#!/bin/bash
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
VERSION=$(cat "$ROOT_DIR/VERSION" | tr -d '[:space:]')
echo "======================================="
echo " Side Screen - Release v$VERSION"
echo "======================================="
echo ""
# 1. Lint
echo "[1/3] Linting..."
cd "$ROOT_DIR/MacHost"
if command -v swiftlint &>/dev/null; then
swiftlint lint --config .swiftlint.yml --strict --quiet
echo " Swift lint OK"
fi
cd "$ROOT_DIR/AndroidClient"
if command -v ktlint &>/dev/null; then
ktlint "app/src/main/java/**/*.kt" --relative
echo " Kotlin lint OK"
fi
# 2. Commit & push
echo "[2/3] Pushing to GitHub..."
cd "$ROOT_DIR"
if [ -n "$(git status --porcelain)" ]; then
git add -A
git status --short
read -p "Commit message: " MSG
git commit -m "$MSG"
fi
git push
# 3. Tag & release
echo "[3/3] Creating release tag..."
if git rev-parse "$VERSION" >/dev/null 2>&1; then
echo " Tag $VERSION already exists, skipping"
else
git tag "$VERSION"
git push origin "$VERSION"
echo " Tag $VERSION pushed - GitHub Actions will build the release"
fi
echo ""
echo "======================================="
echo " Done! Check: gh release view $VERSION"
echo "======================================="