Skip to content

Commit ccac1e8

Browse files
committed
Bump marketing version to 1.1.0 and add version bump script for easier version management
1 parent a8825d6 commit ccac1e8

File tree

3 files changed

+191
-29
lines changed

3 files changed

+191
-29
lines changed

VibeScribe.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@
286286
"@executable_path/../Frameworks",
287287
);
288288
MACOSX_DEPLOYMENT_TARGET = 15.0;
289-
MARKETING_VERSION = 1.0;
289+
MARKETING_VERSION = 1.1.0;
290290
PRODUCT_BUNDLE_IDENTIFIER = pfrankov.VibeScribe;
291291
PRODUCT_NAME = "$(TARGET_NAME)";
292292
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -319,7 +319,7 @@
319319
"@executable_path/../Frameworks",
320320
);
321321
MACOSX_DEPLOYMENT_TARGET = 15.0;
322-
MARKETING_VERSION = 1.0;
322+
MARKETING_VERSION = 1.1.0;
323323
PRODUCT_BUNDLE_IDENTIFIER = pfrankov.VibeScribe;
324324
PRODUCT_NAME = "$(TARGET_NAME)";
325325
PROVISIONING_PROFILE_SPECIFIER = "";

VibeScribe/Info.plist

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>CFBundleIdentifier</key>
6-
<string>pfrankov.VibeScribe</string>
7-
<key>CFBundleIconName</key>
8-
<string>AppIcon</string>
9-
<key>CFBundleDevelopmentRegion</key>
10-
<string>$(DEVELOPMENT_LANGUAGE)</string>
11-
<key>CFBundleExecutable</key>
12-
<string>$(EXECUTABLE_NAME)</string>
13-
<key>CFBundleName</key>
14-
<string>$(PRODUCT_NAME)</string>
15-
<key>CFBundleDisplayName</key>
16-
<string>VibeScribe</string>
17-
<key>CFBundlePackageType</key>
18-
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
19-
<key>CFBundleShortVersionString</key>
20-
<string>$(MARKETING_VERSION)</string>
21-
<key>CFBundleVersion</key>
22-
<string>$(CURRENT_PROJECT_VERSION)</string>
23-
<key>LSMinimumSystemVersion</key>
24-
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
25-
<key>ITSAppUsesNonExemptEncryption</key>
26-
<false/>
27-
<key>NSMicrophoneUsageDescription</key>
28-
<string>VibeScribe needs microphone access to record audio for transcription.</string>
29-
<key>NSScreenCaptureDescription</key>
30-
<string>VibeScribe needs screen capture permission to record system audio output for transcription.</string>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>VibeScribe</string>
9+
<key>CFBundleExecutable</key>
10+
<string>$(EXECUTABLE_NAME)</string>
11+
<key>CFBundleIconName</key>
12+
<string>AppIcon</string>
13+
<key>CFBundleIdentifier</key>
14+
<string>pfrankov.VibeScribe</string>
15+
<key>CFBundleName</key>
16+
<string>$(PRODUCT_NAME)</string>
17+
<key>CFBundlePackageType</key>
18+
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>$(MARKETING_VERSION)</string>
21+
<key>CFBundleVersion</key>
22+
<string>1</string>
23+
<key>ITSAppUsesNonExemptEncryption</key>
24+
<false/>
25+
<key>LSMinimumSystemVersion</key>
26+
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
27+
<key>NSMicrophoneUsageDescription</key>
28+
<string>VibeScribe needs microphone access to record audio for transcription.</string>
29+
<key>NSScreenCaptureDescription</key>
30+
<string>VibeScribe needs screen capture permission to record system audio output for transcription.</string>
3131
</dict>
32-
</plist>
32+
</plist>

scripts/bump_version.sh

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# scripts/bump_version.sh
5+
# Usage:
6+
# ./scripts/bump_version.sh <major|minor|patch> [--build <build-number>] [--tag] [--push]
7+
# Examples:
8+
# ./scripts/bump_version.sh patch
9+
# ./scripts/bump_version.sh minor --build 10 --tag --push
10+
11+
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
12+
PLIST_PATH="$REPO_ROOT/VibeScribe/Info.plist"
13+
PBXPROJ_PATH="$REPO_ROOT/VibeScribe.xcodeproj/project.pbxproj"
14+
15+
if [ ! -f "$PLIST_PATH" ]; then
16+
echo "Info.plist not found at $PLIST_PATH"
17+
exit 1
18+
fi
19+
20+
BUMP_PART=""
21+
BUILD_NUMBER=""
22+
DO_TAG=false
23+
DO_PUSH=false
24+
25+
while [[ $# -gt 0 ]]; do
26+
case "$1" in
27+
--build)
28+
BUILD_NUMBER="$2"
29+
shift 2
30+
;;
31+
--tag)
32+
DO_TAG=true
33+
shift
34+
;;
35+
--push)
36+
DO_PUSH=true
37+
shift
38+
;;
39+
-*|--*)
40+
echo "Unknown option $1"
41+
exit 1
42+
;;
43+
*)
44+
if [ -z "$BUMP_PART" ]; then
45+
BUMP_PART="$1"
46+
else
47+
echo "Unexpected argument: $1"
48+
exit 1
49+
fi
50+
shift
51+
;;
52+
esac
53+
done
54+
55+
# Validate bump part
56+
if [[ -z "$BUMP_PART" ]]; then
57+
echo "Usage: $0 <major|minor|patch> [--build <build-number>] [--tag] [--push]"
58+
exit 1
59+
fi
60+
61+
if [[ ! "$BUMP_PART" =~ ^(major|minor|patch)$ ]]; then
62+
echo "Invalid bump part: $BUMP_PART. Use major, minor, or patch."
63+
exit 1
64+
fi
65+
66+
# Read MARKETING_VERSION from project.pbxproj (choose the highest X.Y.Z found, default 0.0.0)
67+
if [ ! -f "$PBXPROJ_PATH" ]; then
68+
echo "Xcode project not found at $PBXPROJ_PATH"
69+
exit 1
70+
fi
71+
72+
MV_LIST=$(grep -Eo 'MARKETING_VERSION = [0-9]+\.[0-9]+\.[0-9]+' "$PBXPROJ_PATH" | awk '{print $3}')
73+
if [ -z "$MV_LIST" ]; then
74+
CURRENT_VERSION="0.0.0"
75+
else
76+
CURRENT_VERSION="0.0.0"
77+
while IFS= read -r v; do
78+
if [[ "$v" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
79+
IFS='.' read -r a b c <<< "$v"
80+
IFS='.' read -r ca cb cc <<< "$CURRENT_VERSION"
81+
if (( a>ca || (a==ca && b>cb) || (a==ca && b==cb && c>cc) )); then
82+
CURRENT_VERSION="$v"
83+
fi
84+
fi
85+
done <<< "$MV_LIST"
86+
fi
87+
88+
if [[ ! "$CURRENT_VERSION" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
89+
echo "Current MARKETING_VERSION ('$CURRENT_VERSION') is not in X.Y.Z format. Resetting to 0.0.0"
90+
MAJOR=0
91+
MINOR=0
92+
PATCH=0
93+
else
94+
MAJOR=${BASH_REMATCH[1]}
95+
MINOR=${BASH_REMATCH[2]}
96+
PATCH=${BASH_REMATCH[3]}
97+
fi
98+
99+
case "$BUMP_PART" in
100+
major)
101+
MAJOR=$((MAJOR + 1))
102+
MINOR=0
103+
PATCH=0
104+
;;
105+
minor)
106+
MINOR=$((MINOR + 1))
107+
PATCH=0
108+
;;
109+
patch)
110+
PATCH=$((PATCH + 1))
111+
;;
112+
esac
113+
114+
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
115+
echo "Bumping version: $CURRENT_VERSION -> $NEW_VERSION"
116+
117+
# Update MARKETING_VERSION in project.pbxproj (all occurrences)
118+
echo "Updating MARKETING_VERSION in project to $NEW_VERSION"
119+
LC_ALL=C sed -i '' -E "s/(MARKETING_VERSION = )[0-9]+\.[0-9]+\.[0-9]+;/\\1$NEW_VERSION;/g" "$PBXPROJ_PATH"
120+
121+
# Ensure Info.plist uses $(MARKETING_VERSION) as CFBundleShortVersionString
122+
PLIST_SHORT_VER=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "$PLIST_PATH" 2>/dev/null || echo "")
123+
if [ "$PLIST_SHORT_VER" != '$(MARKETING_VERSION)' ]; then
124+
echo "Setting Info.plist CFBundleShortVersionString to $(MARKETING_VERSION)"
125+
/usr/libexec/PlistBuddy -c 'Set :CFBundleShortVersionString $(MARKETING_VERSION)' "$PLIST_PATH"
126+
fi
127+
128+
if [ -n "$BUILD_NUMBER" ]; then
129+
echo "Setting build number to $BUILD_NUMBER"
130+
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $BUILD_NUMBER" "$PLIST_PATH"
131+
else
132+
# If no build number passed, increment current numeric build (if integer), else set to 1
133+
CURRENT_BUILD=$(/usr/libexec/PlistBuddy -c "Print :CFBundleVersion" "$PLIST_PATH" 2>/dev/null || echo "")
134+
if [[ "$CURRENT_BUILD" =~ ^[0-9]+$ ]]; then
135+
NEXT_BUILD=$((CURRENT_BUILD + 1))
136+
else
137+
NEXT_BUILD=1
138+
fi
139+
echo "Auto bumping build number: $CURRENT_BUILD -> $NEXT_BUILD"
140+
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $NEXT_BUILD" "$PLIST_PATH"
141+
fi
142+
143+
git -C "$REPO_ROOT" add "$PLIST_PATH"
144+
echo "Review and commit the updated project files (Info.plist and project.pbxproj) manually."
145+
146+
# Tagging (tags are created on current HEAD; ensure you've committed changes before tagging)
147+
if [ "$DO_TAG" = true ]; then
148+
TAG_NAME="v$NEW_VERSION"
149+
echo "Creating tag $TAG_NAME on current HEAD (ensure you've committed)."
150+
git -C "$REPO_ROOT" tag -a "$TAG_NAME" -m "Release $TAG_NAME"
151+
if [ "$DO_PUSH" = true ]; then
152+
echo "Pushing tag $TAG_NAME to origin"
153+
git -C "$REPO_ROOT" push origin "$TAG_NAME"
154+
fi
155+
else
156+
if [ "$DO_PUSH" = true ]; then
157+
echo "Pushing current branch to origin"
158+
git -C "$REPO_ROOT" push
159+
fi
160+
fi
161+
162+
echo "Done. Info.plist updated at $PLIST_PATH"

0 commit comments

Comments
 (0)