ci: add iPhone deploy workflow + CI/CD setup docs #4
@@ -36,6 +36,14 @@ jobs:
|
||||
- name: Setup PATH
|
||||
run: echo "/opt/homebrew/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Clean ALL caches
|
||||
run: |
|
||||
rm -rf ~/Library/Developer/Xcode/DerivedData
|
||||
rm -rf ~/Library/Caches/org.swift.swiftpm
|
||||
rm -rf ~/Library/org.swift.swiftpm
|
||||
rm -rf .build
|
||||
rm -rf ~/.cache/act/*/hostexecutor/tabatago-swift/build
|
||||
|
||||
- name: Install tools (xcodegen, node, firebase)
|
||||
run: |
|
||||
brew install xcodegen node || true
|
||||
@@ -63,6 +71,7 @@ jobs:
|
||||
-allowProvisioningUpdates \
|
||||
-skipPackagePluginValidation \
|
||||
SWIFT_ENABLE_EXPLICIT_MODULES=NO \
|
||||
ONLY_ACTIVE_ARCH=NO \
|
||||
CODE_SIGN_STYLE=Automatic DEVELOPMENT_TEAM=2MJF39L8VY
|
||||
|
||||
- name: Package IPA
|
||||
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -58,3 +58,8 @@ Config/Secrets.xcconfig
|
||||
_Users_*
|
||||
swift-generated-sources/
|
||||
tabatago-swift/build/
|
||||
|
||||
# Swift Package Manager
|
||||
Package.resolved
|
||||
.build/
|
||||
DerivedData/
|
||||
|
||||
@@ -1,30 +1,38 @@
|
||||
import Foundation
|
||||
#if canImport(PostHog)
|
||||
import PostHog
|
||||
#endif
|
||||
|
||||
/// PostHog analytics — mirrors the event taxonomy from the Expo app.
|
||||
final class AnalyticsService: @unchecked Sendable {
|
||||
|
||||
static let shared = AnalyticsService()
|
||||
|
||||
#if canImport(PostHog)
|
||||
private let apiKey: String =
|
||||
Bundle.main.infoDictionary?["POSTHOG_API_KEY"] as? String ?? ""
|
||||
|
||||
private let host = "https://eu.posthog.com"
|
||||
#endif
|
||||
|
||||
private init() {}
|
||||
|
||||
func initialize() {
|
||||
#if canImport(PostHog)
|
||||
guard !apiKey.isEmpty else { return }
|
||||
let config = PostHogConfig(apiKey: apiKey, host: host)
|
||||
config.captureApplicationLifecycleEvents = true
|
||||
config.captureScreenViews = false // manual tracking
|
||||
PostHogSDK.shared.setup(config)
|
||||
#endif
|
||||
}
|
||||
|
||||
// ─── Screens ────────────────────────────────────────────────
|
||||
|
||||
func screen(_ name: String, properties: [String: Any] = [:]) {
|
||||
#if canImport(PostHog)
|
||||
PostHogSDK.shared.screen(name, properties: properties)
|
||||
#endif
|
||||
}
|
||||
|
||||
// ─── Onboarding ─────────────────────────────────────────────
|
||||
@@ -100,6 +108,8 @@ final class AnalyticsService: @unchecked Sendable {
|
||||
// ─── Private ─────────────────────────────────────────────────
|
||||
|
||||
private func capture(_ event: String, properties: [String: Any] = [:]) {
|
||||
#if canImport(PostHog)
|
||||
PostHogSDK.shared.capture(event, properties: properties.isEmpty ? nil : properties)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ packages:
|
||||
from: "5.0.0"
|
||||
PostHog:
|
||||
url: https://github.com/PostHog/posthog-ios
|
||||
exactVersion: "3.62.0"
|
||||
revision: "3.62.0"
|
||||
|
||||
targets:
|
||||
TabataGo:
|
||||
|
||||
Reference in New Issue
Block a user