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">

![Screenshot 2024-08-22 at 12 05
44 AM](https://github.com/user-attachments/assets/5e1209f9-e8fa-4453-9bdd-9f40339649b4)
This commit is contained in:
Jamil
2024-08-22 13:49:57 -07:00
committed by GitHub
parent 4ec78f70c2
commit 0994bd145a
5 changed files with 34 additions and 0 deletions

View File

@@ -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 \

View File

@@ -19,5 +19,7 @@
<string>$(APP_GROUP_ID)</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>GitSha</key>
<string>$(GIT_SHA)</string>
</dict>
</plist>

View File

@@ -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 {

View File

@@ -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
}

View File

@@ -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">