-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.sh
More file actions
executable file
·48 lines (39 loc) · 1.21 KB
/
release.sh
File metadata and controls
executable file
·48 lines (39 loc) · 1.21 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
#!/bin/bash
set -euo pipefail
VERSION="${1:?Usage: ./release.sh <VERSION>}"
ZIP_FILE="release/BuglyPro-${VERSION}.zip"
PODSPEC="BuglyPro.podspec"
REPO="BuglyDevTeam/BuglyPro-iOS"
export GH_TOKEN="${GITHUB_TOKEN}"
if [ ! -f "$ZIP_FILE" ]; then
echo "Error: $ZIP_FILE not found"
exit 1
fi
echo "==> Releasing BuglyPro ${VERSION}"
echo "==> Updating podspec version..."
sed -i '' "s/s.version.*=.*/s.version = \"${VERSION}\"/" "$PODSPEC"
echo "==> Committing changes..."
git add "${PODSPEC}"
if git diff --cached --quiet; then
echo "==> No changes to commit, skipping..."
else
git commit -m "Release ${VERSION}"
fi
echo "==> Tagging ${VERSION}..."
if git rev-parse "${VERSION}" >/dev/null 2>&1; then
echo "==> Tag ${VERSION} already exists, deleting..."
git tag -d "${VERSION}"
git push origin ":refs/tags/${VERSION}" || true
fi
git tag "${VERSION}"
echo "==> Pushing commit and tag..."
git push origin main
git push origin "${VERSION}"
echo "==> Creating GitHub Release and uploading zip..."
gh release create "${VERSION}" \
"$ZIP_FILE" \
--repo "$REPO" \
--title "${VERSION}" \
--notes "BuglyPro iOS SDK ${VERSION}"
echo ""
echo "==> Done! BuglyPro ${VERSION} released successfully."