Add macOS app installer workflow

This commit is contained in:
diyaa
2026-07-26 16:24:24 +02:00
parent 1f7e696f1c
commit 53fa92d222
7 changed files with 272 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
</dict>
</plist>
+26
View File
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>FchatiApp</string>
<key>CFBundleIdentifier</key>
<string>de.diyaa.fchati</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Fchati</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>14.0</string>
<key>NSHighResolutionCapable</key>
<true/>
</dict>
</plist>
+18
View File
@@ -0,0 +1,18 @@
// swift-tools-version: 5.9
import PackageDescription
let package = Package(
name: "FchatiApp",
platforms: [.macOS(.v14)],
targets: [
.executableTarget(
name: "FchatiApp",
path: "Sources/FchatiApp"
),
.testTarget(
name: "FchatiAppTests",
dependencies: ["FchatiApp"],
path: "Tests/FchatiAppTests"
)
]
)
@@ -0,0 +1,95 @@
import SwiftUI
@main
struct FchatiApp: App {
var body: some Scene {
MenuBarExtra("Fchati", systemImage: "message") {
RootView()
}
.menuBarExtraStyle(.window)
}
}
enum AppTab: String, CaseIterable, Identifiable {
case chat = "Chat"
case pairing = "Pairing"
case settings = "Settings"
var id: Self { self }
var title: String {
rawValue
}
var icon: String {
switch self {
case .chat:
"message"
case .pairing:
"link"
case .settings:
"gearshape"
}
}
}
private struct RootView: View {
@State private var selectedTab: AppTab = .chat
var body: some View {
VStack(spacing: 0) {
Picker("Section", selection: $selectedTab) {
ForEach(AppTab.allCases) { tab in
Label(tab.title, systemImage: tab.icon)
.tag(tab)
}
}
.pickerStyle(.segmented)
.labelsHidden()
.padding()
Divider()
Group {
switch selectedTab {
case .chat:
PlaceholderView(
icon: "message",
title: "No messages yet",
description: "Pair with someone to start chatting."
)
case .pairing:
PlaceholderView(
icon: "link",
title: "Pair a device",
description: "Create or join a pairing session."
)
case .settings:
PlaceholderView(
icon: "gearshape",
title: "Settings",
description: "Your preferences will appear here."
)
}
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
}
.frame(width: 360)
.frame(minHeight: 480)
}
}
private struct PlaceholderView: View {
let icon: String
let title: String
let description: String
var body: some View {
ContentUnavailableView(
title,
systemImage: icon,
description: Text(description)
)
.padding()
}
}
@@ -0,0 +1,11 @@
import XCTest
@testable import FchatiApp
final class AppTabTests: XCTestCase {
func testTabsMatchTheAppShell() {
XCTAssertEqual(AppTab.allCases, [.chat, .pairing, .settings])
XCTAssertEqual(AppTab.chat.icon, "message")
XCTAssertEqual(AppTab.pairing.icon, "link")
XCTAssertEqual(AppTab.settings.icon, "gearshape")
}
}