Skip to content

Commit

Permalink
Add agent QSP for analytic
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-quiltt committed Feb 26, 2024
1 parent 16fb095 commit 927b17b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Sources/QuilttConnector/QuilttConnectorWebview.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class QuilttConnectorWebview: WKWebView, WKNavigationDelegate {
self.onExitSuccess = onExitSuccess
self.onExitAbort = onExitAbort
self.onExitError = onExitError
if let url = URL(string: "https://\(config.connectorId).quiltt.app?mode=webview&oauth_redirect_url=\(config.oauthRedirectUrl)&sdk=swift") {
if let url = URL(string: "https://\(config.connectorId).quiltt.app?mode=webview&oauth_redirect_url=\(config.oauthRedirectUrl)&agent=swift-\(quilttSdkVersion)") {
let req = URLRequest(url: url)
return super.load(req)
}
Expand Down
3 changes: 3 additions & 0 deletions Sources/QuilttConnector/QuilttSdkVersion.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Foundation

public let quilttSdkVersion = "0.0.4"
47 changes: 32 additions & 15 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,25 @@ def release(level)

current_version = Semantic::Version.new(latest_release.tag_name)
new_version = current_version.increment!(level).to_s
generate_release_version_file(new_version)
new_branch = "release/#{new_version}"
push_to_git_remote(new_branch)

set_github_release(
# set_github_release(
# repository_name: REPO_NAME,
# api_token: GITHUB_TOKEN,
# name: new_version.to_s,
# tag_name: new_version.to_s,
# is_generate_release_notes: true,
# commitish: new_branch
# )

create_pull_request(
repository_name: REPO_NAME,
api_token: GITHUB_TOKEN,
name: new_version.to_s,
tag_name: new_version.to_s,
is_generate_release_notes: true,
commitish: 'main'
title: "Release #{new_version}",
head: new_branch,
base: 'main'
)
end

Expand All @@ -33,20 +44,16 @@ platform :ios do

desc 'Release minor version'
lane :release_minor do
lane :release_minor do
build_example_app
# test_example_app
release(:minor)
end
build_example_app
# test_example_app
release(:minor)
end

desc 'Release major version'
lane :release_major do
lane :release_major do
build_example_app
# test_example_app
release(:major)
end
build_example_app
# test_example_app
release(:major)
end

desc 'Build Example App'
Expand All @@ -63,4 +70,14 @@ platform :ios do
# xcargs: '-allowProvisioningUpdates'
# )
end

def generate_release_version_file(version)
sh("echo \"public let version = \\\"#{version}\\\"\" > ../Sources/QuilttConnector/QuilttSdkVersion.swift")
end

def push_to_git_remote(branch)
sh('git add ../Sources/QuilttConnector/Version.swift')
sh('git commit -m \"Bump version\"')
sh("git push origin #{branch}")
end
end

0 comments on commit 927b17b

Please sign in to comment.