Skip to content

Commit

Permalink
Merge branch 'main' into release-please--branches--main
Browse files Browse the repository at this point in the history
  • Loading branch information
cre8ivejp authored Jun 22, 2023
2 parents e5bf882 + 4dc6d5b commit 1919b2a
Show file tree
Hide file tree
Showing 20 changed files with 185 additions and 29 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: norio-nomura/action-swiftlint@9f4dcd7fd46b4e75d7935cf2f4df406d5cae3684 # v3.2.1
with:
args: --strict

build:
runs-on: macos-latest
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ on:

jobs:
release:

permissions:
contents: write
pull-requests: write

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: google-github-actions/release-please-action@51ee8ae2605bd5ce1cfdcc5938684908f1cd9f69 # v3.7.9
Expand All @@ -26,4 +32,5 @@ jobs:
release-type: simple
extra-files: |
Bucketeer.podspec
Bucketeer/Sources/Internal/Utils/Version.swift
token: ${{ secrets.WORKFLOW_TOKEN }} # We need to set the PAT so the publish workflow can be triggered
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>apiEndpoint</key>
<string>${E2E_API_ENDPOINT}</string>
<key>apiKey</key>
<string>${E2E_API_KEY}</string>
<key>IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded</key>
<true/>
</dict>
</plist>
89 changes: 89 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/Bucketeer.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1420"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Bucketeer"
BuildableName = "Bucketeer"
BlueprintName = "Bucketeer"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "NO">
<EnvironmentVariables>
<EnvironmentVariable
key = "E2E_API_KEY"
value = "stub"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "E2E_API_ENDPOINT"
value = "stub"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BucketeerTests"
BuildableName = "BucketeerTests"
BlueprintName = "BucketeerTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Bucketeer"
BuildableName = "Bucketeer"
BlueprintName = "Bucketeer"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
1 change: 1 addition & 0 deletions .xcode-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14.3.0
19 changes: 11 additions & 8 deletions Bucketeer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
006E85E428E034A700B5D90D /* MockEventDao.swift in Sources */ = {isa = PBXBuildFile; fileRef = 006E85E328E034A700B5D90D /* MockEventDao.swift */; };
006E85E628E035D000B5D90D /* MockEventUpdateListener.swift in Sources */ = {isa = PBXBuildFile; fileRef = 006E85E528E035D000B5D90D /* MockEventUpdateListener.swift */; };
006E85E828E038BC00B5D90D /* MockLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 006E85E728E038BC00B5D90D /* MockLogger.swift */; };
25E2B0082A33812C002E410C /* Version.swift in Sources */ = {isa = PBXBuildFile; fileRef = 25E2B0072A33812C002E410C /* Version.swift */; };
6B6ACD69234DD5E700BD6069 /* BucketeerTVOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B6ACD67234DD5E700BD6069 /* BucketeerTVOS.h */; settings = {ATTRIBUTES = (Public, ); }; };
6B6ACD75234DD60600BD6069 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B6ACD74234DD60600BD6069 /* AppDelegate.swift */; };
6B6ACD79234DD60700BD6069 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6B6ACD78234DD60700BD6069 /* Assets.xcassets */; };
Expand Down Expand Up @@ -241,6 +242,7 @@
006E85E328E034A700B5D90D /* MockEventDao.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockEventDao.swift; sourceTree = "<group>"; };
006E85E528E035D000B5D90D /* MockEventUpdateListener.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockEventUpdateListener.swift; sourceTree = "<group>"; };
006E85E728E038BC00B5D90D /* MockLogger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockLogger.swift; sourceTree = "<group>"; };
25E2B0072A33812C002E410C /* Version.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Version.swift; sourceTree = "<group>"; };
6B6ACD65234DD5E700BD6069 /* BucketeerTVOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = BucketeerTVOS.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6B6ACD67234DD5E700BD6069 /* BucketeerTVOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BucketeerTVOS.h; sourceTree = "<group>"; };
6B6ACD68234DD5E700BD6069 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -284,8 +286,8 @@
93AC8F7B28E34ADD00A4719B /* Poller.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Poller.swift; sourceTree = "<group>"; };
93AC8F7D28E34B5C00A4719B /* EvaluationForegroundTask.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EvaluationForegroundTask.swift; sourceTree = "<group>"; };
93AC8F7F28E351C500A4719B /* ScheduledTask.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScheduledTask.swift; sourceTree = "<group>"; };
949542E32A3AEBC0008D0C60 /* MetricsEventUniqueKeyTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MetricsEventUniqueKeyTests.swift; sourceTree = "<group>"; };
E23583D22A1CE8FA004C6862 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
949542E32A3AEBC0008D0C60 /* MetricsEventUniqueKeyTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MetricsEventUniqueKeyTests.swift; sourceTree = "<group>"; };
EB2310E1209D91640023A98D /* SecondViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecondViewController.swift; sourceTree = "<group>"; };
EB2310E3209D92570023A98D /* ThirdViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThirdViewController.swift; sourceTree = "<group>"; };
EB26128C209863F100D62282 /* SplashViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -360,7 +362,6 @@
0065C3C928C7BB76002D92A2 /* BucketeerTests */ = {
isa = PBXGroup;
children = (
E23583D22A1CE8FA004C6862 /* Info.plist */,
00664C0428F933E900AB4995 /* E2E */,
00696DAD28DB5430000068E1 /* Mock */,
006E85BC28DEAF7900B5D90D /* ApiClientTests.swift */,
Expand Down Expand Up @@ -561,6 +562,7 @@
006E85C928DED75500B5D90D /* Defaults.swift */,
9353AB3D29585A980093D1F8 /* Device.swift */,
006E85D128DEF29F00B5D90D /* IdGenerator.swift */,
25E2B0072A33812C002E410C /* Version.swift */,
);
path = Utils;
sourceTree = "<group>";
Expand Down Expand Up @@ -912,6 +914,7 @@
9340CA5E28E1F29000E690CC /* Component.swift in Sources */,
9340CA6428E1F80800E690CC /* Constant.swift in Sources */,
93AC8F7528E3279E00A4719B /* DatabaseOpenHelper.swift in Sources */,
25E2B0082A33812C002E410C /* Version.swift in Sources */,
9340CA6028E1F2D400E690CC /* DataModule.swift in Sources */,
006E85CA28DED75500B5D90D /* Defaults.swift in Sources */,
9353AB3E29585A980093D1F8 /* Device.swift in Sources */,
Expand Down Expand Up @@ -1089,6 +1092,7 @@
0065C3CD28C7BB76002D92A2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
Expand Down Expand Up @@ -1123,6 +1127,7 @@
0065C3CE28C7BB76002D92A2 /* Test */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
Expand Down Expand Up @@ -1156,6 +1161,7 @@
0065C3CF28C7BB76002D92A2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
Expand Down Expand Up @@ -1195,7 +1201,6 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = BucketeerTests/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "";
IPHONEOS_DEPLOYMENT_TARGET = 15.5;
MARKETING_VERSION = 1.0;
Expand All @@ -1219,7 +1224,6 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = BucketeerTests/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "";
IPHONEOS_DEPLOYMENT_TARGET = 15.5;
MARKETING_VERSION = 1.0;
Expand All @@ -1242,7 +1246,6 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = BucketeerTests/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "";
IPHONEOS_DEPLOYMENT_TARGET = 15.5;
MARKETING_VERSION = 1.0;
Expand All @@ -1258,6 +1261,7 @@
6B6ACD6A234DD5E700BD6069 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
Expand All @@ -1282,6 +1286,7 @@
6B6ACD6B234DD5E700BD6069 /* Test */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
Expand All @@ -1305,6 +1310,7 @@
6B6ACD6C234DD5E700BD6069 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
Expand Down Expand Up @@ -1438,7 +1444,6 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MARKETING_VERSION = 2.0.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -1496,7 +1501,6 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MARKETING_VERSION = 2.0.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand Down Expand Up @@ -1591,7 +1595,6 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MARKETING_VERSION = 2.0.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_SWIFT_FLAGS = "-DTEST";
Expand Down
14 changes: 13 additions & 1 deletion Bucketeer.xcodeproj/xcshareddata/xcschemes/Bucketeer.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,19 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "NO">
<EnvironmentVariables>
<EnvironmentVariable
key = "E2E_API_ENDPOINT"
value = "stub"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "E2E_API_KEY"
value = "stub"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<Testables>
<TestableReference
skipped = "NO">
Expand Down
12 changes: 12 additions & 0 deletions Bucketeer.xcodeproj/xcshareddata/xcschemes/Example.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@
ReferencedContainer = "container:Bucketeer.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "API_KEY"
value = "stub"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "API_ENDPOINT"
value = "stub"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
2 changes: 1 addition & 1 deletion Bucketeer/Sources/Public/BKTConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ extension BKTConfig {
eventsMaxQueueSize: eventsMaxQueueSize,
pollingInterval: pollingInterval,
backgroundPollingInterval: backgroundPollingInterval,
sdkVersion: (Bundle.init(for: BKTClient.self).infoDictionary?["CFBundleShortVersionString"] as? String) ?? "",
sdkVersion: Version.current,
appVersion: appVersion,
logger: logger
)
Expand Down
1 change: 1 addition & 0 deletions BucketeerTests/E2E/BucketeerE2ETests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Foundation
import XCTest
import Bucketeer

@available(iOS 13, *)
final class BucketeerE2ETests: XCTestCase {

private var config: BKTConfig!
Expand Down
9 changes: 4 additions & 5 deletions BucketeerTests/E2E/E2ETestHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ let FEATURE_ID_JSON = "feature-ios-e2e-json"
let GOAL_ID = "goal-ios-e2e-1"
let GOAL_VALUE = 1.0

@available(iOS 13, *)
extension BKTConfig {
static func e2e() throws -> BKTConfig {
let bundle = Bundle.init(for: BucketeerE2ETests.self)
let path = bundle.path(forResource: "Info", ofType: "plist")!
let dict = NSDictionary(contentsOfFile: path) as? [String: Any] ?? [:]
let apiKey = dict["apiKey"] as? String ?? ""
let apiEndpoint = dict["apiEndpoint"] as? String ?? ""
let apiKey = ProcessInfo.processInfo.environment["E2E_API_KEY"]!
let apiEndpoint = ProcessInfo.processInfo.environment["E2E_API_ENDPOINT"]!

return try .init(
apiKey: apiKey,
Expand All @@ -32,6 +30,7 @@ extension BKTConfig {
}
}

@available(iOS 13, *)
extension BKTClient {
static func initialize(config: BKTConfig, user: BKTUser, timeoutMillis: Int64 = 5000) async throws {
return try await withCheckedThrowingContinuation { continuation in
Expand Down
1 change: 1 addition & 0 deletions BucketeerTests/EvaluationDaoTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import XCTest
@testable import Bucketeer

@available(iOS 13, *)
final class EvaluationDaoTests: XCTestCase {
let url = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("evaluation_test.db")
var path: String { url.path }
Expand Down
1 change: 1 addition & 0 deletions BucketeerTests/EventDaoTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import XCTest
@testable import Bucketeer

@available(iOS 13, *)
final class EventDaoTests: XCTestCase {
let url = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("event_test.db")
var path: String { url.path }
Expand Down
1 change: 1 addition & 0 deletions BucketeerTests/MigrationTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import XCTest
@testable import Bucketeer

@available(iOS 13, *)
class MigrationTests: XCTestCase {
let url = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("test.db")
var path: String { url.path }
Expand Down
Loading

0 comments on commit 1919b2a

Please sign in to comment.