mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
feat(apple): Build GITHUB_SHA into Apple clients (#6406)
Closes #6401 <img width="1012" alt="Screenshot 2024-08-21 at 11 52 31 PM" src="https://github.com/user-attachments/assets/3012d088-97cb-4a82-8a8f-b2a398865755"> 
This commit is contained in:
2
.github/workflows/_swift.yml
vendored
2
.github/workflows/_swift.yml
vendored
@@ -113,6 +113,7 @@ jobs:
|
||||
if [ "${{ matrix.platform }}" = "iOS" ]; then
|
||||
# Build archive
|
||||
xcodebuild archive \
|
||||
GIT_SHA=${GITHUB_SHA} \
|
||||
-skipMacroValidation \
|
||||
-archivePath $RUNNER_TEMP/Firezone.xcarchive \
|
||||
-configuration Release \
|
||||
@@ -131,6 +132,7 @@ jobs:
|
||||
elif [ "${{ matrix.platform }}" = "macOS" ]; then
|
||||
# Build app bundle
|
||||
xcodebuild build \
|
||||
GIT_SHA=${GITHUB_SHA} \
|
||||
-skipMacroValidation \
|
||||
-configuration Release \
|
||||
-scheme Firezone \
|
||||
|
||||
@@ -19,5 +19,7 @@
|
||||
<string>$(APP_GROUP_ID)</string>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>GitSha</key>
|
||||
<string>$(GIT_SHA)</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -7,6 +7,14 @@
|
||||
import Foundation
|
||||
|
||||
struct AppInfoPlistConstants {
|
||||
static var gitSha: String {
|
||||
guard let gitSha = Bundle.main.object(forInfoDictionaryKey: "GitSha") as? String,
|
||||
!gitSha.isEmpty
|
||||
else { return "unknown" }
|
||||
|
||||
return String(gitSha.prefix(8))
|
||||
}
|
||||
|
||||
static var appGroupId: String {
|
||||
guard let appGroupId = Bundle.main.object(forInfoDictionaryKey: "AppGroupIdentifier") as? String
|
||||
else {
|
||||
|
||||
@@ -365,6 +365,12 @@ public struct SettingsView: View {
|
||||
Spacer()
|
||||
}
|
||||
Spacer()
|
||||
HStack {
|
||||
Text("Build: \(AppInfoPlistConstants.gitSha)")
|
||||
.textSelection(.enabled)
|
||||
.foregroundColor(.gray)
|
||||
Spacer()
|
||||
}.padding([.leading, .bottom], 20)
|
||||
}
|
||||
#elseif os(iOS)
|
||||
VStack {
|
||||
@@ -432,6 +438,13 @@ public struct SettingsView: View {
|
||||
footer: { Text(FootnoteText.forAdvanced) }
|
||||
)
|
||||
}
|
||||
Spacer()
|
||||
HStack {
|
||||
Text("Build: \(AppInfoPlistConstants.gitSha)")
|
||||
.textSelection(.enabled)
|
||||
.foregroundColor(.gray)
|
||||
Spacer()
|
||||
}.padding([.leading, .bottom], 20)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -9,6 +9,15 @@ export default function Apple() {
|
||||
href="https://apps.apple.com/us/app/firezone/id6443661826"
|
||||
title="macOS / iOS"
|
||||
>
|
||||
{/*
|
||||
<Entry version="1.2.1" date={new Date(todo)}>
|
||||
<ul className="list-disc space-y-2 pl-4 mb-4">
|
||||
<ChangeItem pull="6406">
|
||||
Shows the Git SHA corresponding to the build on the Settings -> Advanced screen.
|
||||
</ChangeItem>
|
||||
</ul>
|
||||
</Entry>
|
||||
*/}
|
||||
<Entry version="1.2.0" date={new Date("2024-08-21")}>
|
||||
<ul className="list-disc space-y-2 pl-4 mb-4">
|
||||
<ChangeItem pull="5901">
|
||||
|
||||
Reference in New Issue
Block a user