Skip to content

Commit

Permalink
[MT-1497] Version 1.2.0 (#3)
Browse files Browse the repository at this point in the history
* [MT-1497] Version 1.2.0

Target XCode 15 and iOS 12
Add publish and build scripts
  • Loading branch information
Enricoza authored Mar 13, 2024
1 parent 285efb6 commit ae549f3
Show file tree
Hide file tree
Showing 11 changed files with 160 additions and 22 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,7 @@ fastlane/test_output
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/
iOSInjectionProject/

*.xcframework
*.xcframework.zip
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "BranchMetrics/ios-branch-deep-linking" ~> 1.40
github "tealium/tealium-swift" ~> 2.9
github "tealium/tealium-swift" ~> 2.12
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import PackageDescription
let package = Package(
name: "TealiumBranch",
platforms: [
.iOS(.v9)
.iOS(.v12)
],
products: [
.library(
name: "TealiumBranch",
targets: ["TealiumBranch"]),
],
dependencies: [
.package(name: "TealiumSwift", url: "https://github.com/tealium/tealium-swift", .upToNextMajor(from: "2.9.0")),
.package(name: "TealiumSwift", url: "https://github.com/tealium/tealium-swift", .upToNextMajor(from: "2.12.0")),
.package(name: "Branch", url: "https://github.com/BranchMetrics/ios-branch-sdk-spm", .upToNextMajor(from: "1.40.1"))
],
targets: [
Expand Down
38 changes: 38 additions & 0 deletions SM/Surfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?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>output_path</key>
<string>tealium-xcframeworks</string>
<key>frameworks</key>
<array>
<dict>
<key>name</key>
<string>TealiumBranch</string>
<key>targets</key>
<array>
<dict>
<key>sdk</key>
<string>iOS</string>
<key>project</key>
<string>TealiumBranch.xcodeproj</string>
<key>scheme</key>
<string>TealiumBranch</string>
</dict>
<dict>
<key>sdk</key>
<string>iOSSimulator</string>
<key>project</key>
<string>TealiumBranch.xcodeproj</string>
<key>scheme</key>
<string>TealiumBranch</string>
</dict>
</array>
</dict>
</array>
<key>finalActions</key>
<array>
<string>openDirectory</string>
</array>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Sources/BranchConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ enum BranchConstants {
static let debug = "debug"
static let seperator: Character = ","
static let errorPRefix = "TealiumBranch Error: "
static let version = "1.1.0"
static let version = "1.2.0"

struct EventKeys {
static let branchUniversalObjectProperties = "buo"
Expand Down
8 changes: 4 additions & 4 deletions TealiumBranch.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Pod::Spec.new do |spec|

# ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
spec.name = "TealiumBranch"
spec.version = "1.1.0"
spec.version = "1.2.0"
spec.summary = "Tealium Swift and Branch integration"
spec.description = <<-DESC
Tealium's integration with Branch for iOS.
Expand All @@ -17,7 +17,7 @@ Pod::Spec.new do |spec|
spec.social_media_url = "https://twitter.com/tealium"

# ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
spec.platform = :ios, "11.0"
spec.platform = :ios, "12.0"
spec.swift_version = "5.0"

# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
Expand All @@ -27,8 +27,8 @@ Pod::Spec.new do |spec|
spec.source_files = "Sources/*.{swift}"

# ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
spec.ios.dependency 'tealium-swift/Core', ' ~> 2.9'
spec.ios.dependency 'tealium-swift/RemoteCommands', ' ~> 2.9'
spec.ios.dependency 'tealium-swift/Core', ' ~> 2.12'
spec.ios.dependency 'tealium-swift/RemoteCommands', ' ~> 2.12'
spec.ios.dependency 'Branch', ' ~> 1.40'

end
2 changes: 2 additions & 0 deletions TealiumBranch.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -430,6 +431,7 @@
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
4 changes: 2 additions & 2 deletions TealiumBranchExample/Podfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'
platform :ios, '12.0'

target 'TealiumBranchExample' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

# Pods for TealiumBranchExample
pod 'TealiumBranch', :path=> '../'
pod 'tealium-swift/Lifecycle', '~> 2.6'
pod 'tealium-swift/Lifecycle', '~> 2.12'
end
22 changes: 11 additions & 11 deletions TealiumBranchExample/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
PODS:
- Branch (1.40.1)
- tealium-swift/Core (2.9.1)
- tealium-swift/Lifecycle (2.9.1):
- tealium-swift/Core (2.12.2)
- tealium-swift/Lifecycle (2.12.2):
- tealium-swift/Core
- tealium-swift/RemoteCommands (2.9.1):
- tealium-swift/RemoteCommands (2.12.2):
- tealium-swift/Core
- TealiumBranch (1.1.0):
- TealiumBranch (1.2.0):
- Branch (~> 1.40)
- tealium-swift/Core (~> 2.9)
- tealium-swift/RemoteCommands (~> 2.9)
- tealium-swift/Core (~> 2.12)
- tealium-swift/RemoteCommands (~> 2.12)

DEPENDENCIES:
- tealium-swift/Lifecycle (~> 2.6)
- tealium-swift/Lifecycle (~> 2.12)
- TealiumBranch (from `../`)

SPEC REPOS:
Expand All @@ -25,9 +25,9 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
Branch: dff731289fdda63d8648d8339dc05076a1b88881
tealium-swift: 137769254e97d4c9f7ed6e16e0768b40888e6452
TealiumBranch: de6d63eebc418a8db74b94d18aee521248fd5548
tealium-swift: 4b7e3dda42d7c1de6acb769abad9920346d17d43
TealiumBranch: d28c99a06256d42f5563664a4558e7782337ec65

PODFILE CHECKSUM: 3b53fd752a178bb62b378166462f948e7bd1fa12
PODFILE CHECKSUM: 516e7f57ed844f266336d7bb35b3e362b40b1420

COCOAPODS: 1.11.3
COCOAPODS: 1.15.2
65 changes: 65 additions & 0 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# A script to verify that the repo is up to date and the versions are correct and then runs the pod trunk push command

constants=$(<Sources/BranchConstants.swift)
regex="^.*static let version \= \"([0-9\.]*)\""

if [[ $constants =~ $regex ]]
then
versionConstant=${BASH_REMATCH[1]}
else
echo "Couldn't match the library version, exiting"
exit 1
fi
echo Version Constant $versionConstant

podspecFile=$(<TealiumBranch.podspec)
podspecRegex="^.*spec.version[[:space:]]*\= \"([0-9\.]*)\""

if [[ $podspecFile =~ $podspecRegex ]]
then
podspecVersion=${BASH_REMATCH[1]}
else
echo "Couldn't match the podspec version, exiting"
exit 1
fi
echo Podspec Version $podspecVersion

if [ $podspecVersion != $versionConstant ]
then
echo "The podspec version \"${podspecVersion}\" is different from the version constant \"${versionConstant}\".\nDid you forget to update one of the two?"
exit 1
fi

branch_name="$(git rev-parse --abbrev-ref HEAD)"
echo Current branch $branch_name
if [ $branch_name != "main" ]
then
echo "Check out to main branch before trying to publish. Current branch: ${branch_name}"
exit 1
fi

git fetch --tags
if ! git diff --quiet remotes/origin/main
then
echo "Make sure you are up to date with the remote before publishing"
exit 1
fi

latestTag=$(git describe --tags --abbrev=0)

echo Latest tag $latestTag
if [ $latestTag != $versionConstant ]
then
echo "The latest published tag \"${latestTag}\" is different from the version constant \"${versionConstant}\".\nDid you forget to add the tag to the release or did you forget to update the Constant?"
exit 1
fi

echo "All checks are passed, ready to release to CocoaPods"

echo "Do you wish to publish to CocoaPods?"
select yn in "Yes" "No"; do
case $yn in
Yes ) echo "Ok, running \"pod trunk push\" now."; pod trunk push; break;;
No ) echo "Ok, skip the release for now."; exit;;
esac
done
30 changes: 30 additions & 0 deletions xcframeworks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# variable declarations
BUILD_PATH="build"
XCFRAMEWORK_PATH="tealium-xcframeworks"
ZIP_PATH="tealium.xcframework.zip"
TEAM_NAME=XC939GDC9P

# zip all the xcframeworks
function zip_xcframeworks {
if [[ -d "${XCFRAMEWORK_PATH}" ]]; then
ditto -ck --rsrc --sequesterRsrc --keepParent "${XCFRAMEWORK_PATH}" "${ZIP_PATH}"
rm -rf "${XCFRAMEWORK_PATH}"
fi
}

# do the work
surmagic xcf

# Code Sign
for frameworkname in $XCFRAMEWORK_PATH/*.xcframework; do
echo "Codesigning $frameworkname"
codesign --timestamp -s $TEAM_NAME $frameworkname --verbose
codesign -v $frameworkname --verbose
done

zip_xcframeworks

echo ""
echo "Done! Upload ${ZIP_PATH} to GitHub when you create the release."

0 comments on commit ae549f3

Please sign in to comment.