Skip to content

Commit 8b8052e

Browse files
Update build-and-release workflow and AboutView for improved appcast generation and version handling
🔧 Workflow Enhancements: - Updated build-and-release.yml to handle appcast.xml generation from releases.atom if the former is not found. - Added detailed logging for available files in the releases directory to aid in debugging. 📱 AboutView Improvements: - Removed unnecessary debug print statements for cleaner code while maintaining version and build number detection logic. This enhances the build process and improves the clarity of version information displayed in the app.
1 parent 34a6b8f commit 8b8052e

3 files changed

Lines changed: 12 additions & 14 deletions

File tree

.github/workflows/build-and-release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,19 @@ jobs:
247247
--full-release-notes-url "https://github.com/devopsmariocom/A6Cutter/releases" \
248248
releases/
249249
250-
# Move appcast.xml to root
250+
# Move appcast.xml to root (generate_appcast creates releases.atom)
251251
if [ -f "releases/appcast.xml" ]; then
252252
mv releases/appcast.xml .
253253
echo "✅ appcast.xml generated successfully!"
254+
elif [ -f "releases.atom" ]; then
255+
mv releases.atom appcast.xml
256+
echo "✅ appcast.xml generated successfully (from releases.atom)!"
254257
else
255258
echo "❌ Failed to generate appcast.xml"
259+
echo "📁 Available files in releases/:"
260+
ls -la releases/ || echo "No releases directory found"
261+
echo "📁 Available files in current directory:"
262+
ls -la *.xml *.atom 2>/dev/null || echo "No XML/ATOM files found"
256263
exit 1
257264
fi
258265

A6Cutter/AboutView.swift

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,41 +73,32 @@ struct AboutView: View {
7373
if let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String {
7474
// Remove 'v' prefix if present for consistent display
7575
let cleanVersion = version.hasPrefix("v") ? String(version.dropFirst()) : version
76-
print("DEBUG AboutView: CFBundleShortVersionString = '\(version)' -> cleanVersion = '\(cleanVersion)'")
7776
return cleanVersion
7877
}
79-
print("DEBUG AboutView: CFBundleShortVersionString not found")
8078
return "Deve"
8179
}
8280

8381
private var buildNumber: String {
8482
if let build = Bundle.main.infoDictionary?["CFBundleVersion"] as? String {
8583
// Check if this is a local build by looking at CFBundleShortVersionString
8684
if let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String {
87-
print("DEBUG AboutView: CFBundleVersion = '\(build)', version contains -dev: \(version.contains("-dev"))")
8885
if version.contains("-dev") {
8986
// Local build - CFBundleVersion is git commit hash
90-
print("DEBUG AboutView: Local build detected, returning git hash: '\(build)'")
9187
return build
9288
} else {
9389
// GitHub Actions build - CFBundleVersion is build number
94-
print("DEBUG AboutView: GitHub Actions build detected, returning build number: '\(build)'")
9590
return build
9691
}
9792
}
9893
}
99-
print("DEBUG AboutView: CFBundleVersion not found")
10094
return "dev"
10195
}
10296

10397
private var gitHash: String {
10498
if let hash = Bundle.main.infoDictionary?["GitHash"] as? String {
10599
// Show first 7 characters of git hash for readability
106-
let shortHash = String(hash.prefix(7))
107-
print("DEBUG AboutView: GitHash = '\(hash)' -> shortHash = '\(shortHash)'")
108-
return shortHash
100+
return String(hash.prefix(7))
109101
}
110-
print("DEBUG AboutView: GitHash not found")
111102
return "dev"
112103
}
113104

A6Cutter/Info.plist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
<key>CFBundlePackageType</key>
1414
<string>APPL</string>
1515
<key>CFBundleShortVersionString</key>
16-
<string>v1.0.30-dev</string>
16+
<string>v1.0.31-dev</string>
1717
<key>CFBundleSignature</key>
1818
<string>????</string>
1919
<key>CFBundleVersion</key>
20-
<string>7517087</string>
20+
<string>34a6b8f</string>
2121
<key>GitHash</key>
22-
<string>7517087bd06bf95e03539d5e7ddcfe3bb2ccd4ec</string>
22+
<string>34a6b8f41c3bff929b34f6b62b01c0088d873435</string>
2323
<key>LSMinimumSystemVersion</key>
2424
<string>14.0</string>
2525
<key>NSHumanReadableCopyright</key>

0 commit comments

Comments
 (0)