Skip to content

Commit af2412c

Browse files
committed
fix: read version from bundle at runtime instead of hardcoding (#15)
The app displayed a stale version because SettingsView had a hardcoded version string that fell out of sync. Now it reads CFBundleShortVersionString from the bundle at runtime, which the CI workflow already sets from the git tag. Also removes the SettingsView sed replacement from bump-version.sh since it's no longer needed, and syncs all remaining version references to 1.9.0. Closes #15
1 parent eb58f4a commit af2412c

6 files changed

Lines changed: 9 additions & 11 deletions

File tree

Casks/vpn-bypass.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Or if using local tap: brew install --cask --no-quarantine ./Casks/vpn-bypass.rb
44

55
cask "vpn-bypass" do
6-
version "1.8.2"
6+
version "1.9.0"
77
sha256 "e3d2b80be266c1a703c0b00172fa4ad843225898a82662381061b6781d656702"
88

99
url "https://github.com/GeiserX/VPN-Bypass/releases/download/v#{version}/VPN-Bypass-#{version}.dmg"

Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.8.2</string><!-- VERSION -->
20+
<string>1.9.0</string><!-- VERSION -->
2121
<key>CFBundleVersion</key>
2222
<string>21</string>
2323
<key>LSMinimumSystemVersion</key>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<p align="center">
1212
<img src="https://img.shields.io/badge/macOS-13%2B-blue" alt="macOS 13+">
1313
<img src="https://img.shields.io/badge/Swift-5.9-orange" alt="Swift 5.9">
14-
<a href="https://github.com/GeiserX/VPN-Bypass/releases"><img src="https://img.shields.io/badge/version-1.8.1-green" alt="Version"></a>
14+
<a href="https://github.com/GeiserX/VPN-Bypass/releases"><img src="https://img.shields.io/badge/version-1.9.0-green" alt="Version"></a>
1515
</p>
1616

1717
## Why?

Sources/SettingsView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,7 @@ struct GeneralTab: View {
12631263
HStack {
12641264
VStack(alignment: .leading, spacing: 2) {
12651265
BrandedAppName(fontSize: 13)
1266-
Text("Version 1.9.0")
1266+
Text("Version \(Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "Unknown")")
12671267
.font(.system(size: 11))
12681268
.foregroundColor(Color(hex: "6B7280"))
12691269
}

docs/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
### Improved
1414
- **OpenAI / ChatGPT Service** - Added all relevant OpenAI and ChatGPT domains including core properties, auth, CDN, Azure/Cloudflare infrastructure, LiveKit voice, anti-bot, and analytics endpoints
1515

16+
### Fixed
17+
- **Version Display** - App now reads version from the bundle at runtime instead of a hardcoded string, ensuring the displayed version always matches the release (#15)
18+
1619
## [1.8.1] - 2026-02-25
1720

1821
### Fixed

scripts/bump-version.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,11 @@ echo " → Info.plist"
2323
sed -i '' "s/<string>[0-9]*\.[0-9]*\.[0-9]*<\/string><!-- VERSION -->/<string>$NEW_VERSION<\/string><!-- VERSION -->/" Info.plist 2>/dev/null || \
2424
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $NEW_VERSION" Info.plist
2525

26-
# 2. SettingsView.swift - Version display
27-
echo " → Sources/SettingsView.swift"
28-
sed -i '' "s/Text(\"Version [0-9]*\.[0-9]*\.[0-9]*\")/Text(\"Version $NEW_VERSION\")/" Sources/SettingsView.swift
29-
sed -i '' "s/Text(\"v[0-9]*\.[0-9]*\.[0-9]*\")/Text(\"v$NEW_VERSION\")/" Sources/SettingsView.swift
30-
31-
# 3. README.md - Badge
26+
# 2. README.md - Badge
3227
echo " → README.md"
3328
sed -i '' "s/version-[0-9]*\.[0-9]*\.[0-9]*-green/version-$NEW_VERSION-green/" README.md
3429

35-
# 4. Casks/vpn-bypass.rb (optional - usually auto-updated by release workflow)
30+
# 3. Casks/vpn-bypass.rb (optional - usually auto-updated by release workflow)
3631
if [ -f "Casks/vpn-bypass.rb" ]; then
3732
echo " → Casks/vpn-bypass.rb"
3833
sed -i '' "s/version \"[0-9]*\.[0-9]*\.[0-9]*\"/version \"$NEW_VERSION\"/" Casks/vpn-bypass.rb

0 commit comments

Comments
 (0)