mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
Merge pull request #1124 from mitchellh/macos-build
macos: put build numbers back into info.plist, other metadata
This commit is contained in:
9
.github/workflows/release-tip.yml
vendored
9
.github/workflows/release-tip.yml
vendored
@ -39,6 +39,9 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
# Important so that build number generation works
|
||||
fetch-depth: 0
|
||||
|
||||
# Install Nix and use that to run our tests so our environment matches exactly.
|
||||
- uses: cachix/install-nix-action@v24
|
||||
@ -57,7 +60,8 @@ jobs:
|
||||
# Load Build Number
|
||||
- name: Build Number
|
||||
run: |
|
||||
echo "GHOSTTY_BUILD=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
|
||||
echo "GHOSTTY_BUILD=$(git rev-list --count head)" >> $GITHUB_ENV
|
||||
echo "GHOSTTY_COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
|
||||
|
||||
# GhosttyKit is the framework that is built from Zig for our native
|
||||
# Mac app to access. Build this in release mode.
|
||||
@ -74,8 +78,9 @@ jobs:
|
||||
# This will be a monotonically always increasing build number that we use.
|
||||
- name: Inject Build Number
|
||||
run: |
|
||||
echo "Setting build to $GHOSTTY_BUILD"
|
||||
/usr/libexec/PlistBuddy -c "Set :GhosttyCommit $GHOSTTY_COMMIT" "macos/build/Release/Ghostty.app/Contents/Info.plist"
|
||||
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $GHOSTTY_BUILD" "macos/build/Release/Ghostty.app/Contents/Info.plist"
|
||||
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $GHOSTTY_COMMIT" "macos/build/Release/Ghostty.app/Contents/Info.plist"
|
||||
|
||||
- name: Zip Unsigned App
|
||||
run: nix develop -c sh -c 'cd macos/build/Release && zip -9 -r --symlinks ../../../ghostty-macos-universal-unsigned.zip Ghostty.app'
|
||||
|
@ -91,5 +91,11 @@
|
||||
<string>A program in Ghostty wants to use speech recognition.</string>
|
||||
<key>NSSystemAdministrationUsageDescription</key>
|
||||
<string>A program in Ghostty requires elevated privileges.</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string></string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string></string>
|
||||
<key>GhosttyCommit</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
@ -2,14 +2,9 @@ import SwiftUI
|
||||
|
||||
struct AboutView: View {
|
||||
/// Read the commit from the bundle.
|
||||
var commit: String {
|
||||
guard let valueAny = Bundle.main.infoDictionary?["CFBundleVersion"],
|
||||
let version = valueAny as? String else {
|
||||
return "unknown"
|
||||
}
|
||||
|
||||
return version
|
||||
}
|
||||
var build: String? { Bundle.main.infoDictionary?["CFBundleVersion"] as? String }
|
||||
var commit: String? { Bundle.main.infoDictionary?["GhosttyCommit"] as? String }
|
||||
var version: String? { Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String }
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .center) {
|
||||
@ -21,9 +16,11 @@ struct AboutView: View {
|
||||
Text("Ghostty")
|
||||
.font(.title3)
|
||||
|
||||
Text("Commit: \(commit)")
|
||||
if let version = self.version {
|
||||
Text("Version: \(version)")
|
||||
.font(.body)
|
||||
}
|
||||
}
|
||||
.frame(minWidth: 300)
|
||||
.padding()
|
||||
}
|
||||
|
Reference in New Issue
Block a user