Skip to content

Commit

Permalink
[MT-1497] Version 3.2.0 (#17)
Browse files Browse the repository at this point in the history
Update to target XCode 15 and iOS 12
Add publish script and use ditto to zip the files to avoid codesign issue
  • Loading branch information
Enricoza authored Mar 8, 2024
1 parent 2811262 commit 64f4477
Show file tree
Hide file tree
Showing 10 changed files with 106 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "tealium/tealium-swift" ~> 2.11
github "tealium/tealium-swift" ~> 2.12
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json" == 10.7
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import PackageDescription
let package = Package(
name: "TealiumFirebase",
platforms: [
.iOS(.v11)
.iOS(.v12)
],
products: [
.library(name: "TealiumFirebase", targets: ["TealiumFirebase"])
],
dependencies: [
.package(name: "TealiumSwift", url: "https://github.com/tealium/tealium-swift", .upToNextMajor(from: "2.11.1")),
.package(name: "TealiumSwift", url: "https://github.com/tealium/tealium-swift", .upToNextMajor(from: "2.12.0")),
.package(name: "Firebase", url: "https://github.com/firebase/firebase-ios-sdk.git", .upToNextMajor(from: "10.7.0"))
],
targets: [
Expand Down
2 changes: 1 addition & 1 deletion Sources/FirebaseConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ enum FirebaseConstants {
static let commandId = "firebaseAnalytics"
static let description = "Firebase Remote Command"
static let errorPrefix = "Tealium Firebase: "
static let version = "3.1.0"
static let version = "3.2.0"

enum Keys {
static let sessionTimeout = "firebase_session_timeout_seconds"
Expand Down
8 changes: 4 additions & 4 deletions TealiumFirebase.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Pod::Spec.new do |s|
# ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.name = "TealiumFirebase"
s.module_name = "TealiumFirebase"
s.version = "3.1.0"
s.version = "3.2.0"
s.summary = "Tealium Swift and Firebase integration"
s.description = <<-DESC
Tealium's integration with Firebase for iOS.
Expand All @@ -20,7 +20,7 @@ Pod::Spec.new do |s|

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

# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.source = { :git => "https://github.com/Tealium/tealium-ios-firebase-remote-command.git", :tag => "#{s.version}" }
Expand All @@ -30,8 +30,8 @@ Pod::Spec.new do |s|

# ――― Dependencies ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.static_framework = true
s.ios.dependency 'tealium-swift/Core', '~> 2.11'
s.ios.dependency 'tealium-swift/RemoteCommands', '~> 2.11'
s.ios.dependency 'tealium-swift/Core', '~> 2.12'
s.ios.dependency 'tealium-swift/RemoteCommands', '~> 2.12'
s.dependency 'Firebase', '~> 10.7'
s.dependency 'FirebaseAnalytics', '~> 10.7'
end
6 changes: 3 additions & 3 deletions TealiumFirebase.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -510,7 +510,7 @@
);
INFOPLIST_FILE = "$(SRCROOT)/Sources/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -544,7 +544,7 @@
);
INFOPLIST_FILE = "$(SRCROOT)/Sources/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
2 changes: 1 addition & 1 deletion TealiumFirebaseExample/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'
platform :ios, '12.0'

target 'TealiumFirebaseExample' do
# Comment the next line if you don't want to use dynamic frameworks
Expand Down
22 changes: 11 additions & 11 deletions TealiumFirebaseExample/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,18 @@ PODS:
- nanopb/decode (2.30909.1)
- nanopb/encode (2.30909.1)
- PromisesObjC (2.3.1)
- tealium-swift/Core (2.11.1)
- tealium-swift/Lifecycle (2.11.1):
- tealium-swift/Core (2.12.2)
- tealium-swift/Lifecycle (2.12.2):
- tealium-swift/Core
- tealium-swift/RemoteCommands (2.11.1):
- tealium-swift/RemoteCommands (2.12.2):
- tealium-swift/Core
- tealium-swift/TagManagement (2.11.1):
- tealium-swift/TagManagement (2.12.2):
- tealium-swift/Core
- TealiumFirebase (3.1.0):
- TealiumFirebase (3.2.0):
- Firebase (~> 10.7)
- FirebaseAnalytics (~> 10.7)
- tealium-swift/Core (~> 2.11)
- tealium-swift/RemoteCommands (~> 2.11)
- tealium-swift/Core (~> 2.12)
- tealium-swift/RemoteCommands (~> 2.12)

DEPENDENCIES:
- tealium-swift/Lifecycle
Expand Down Expand Up @@ -125,9 +125,9 @@ SPEC CHECKSUMS:
GoogleUtilities: 202e7a9f5128accd11160fb9c19612de1911aa19
nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5
PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
tealium-swift: e904760e180bada93e78e760d5349c0be06f350f
TealiumFirebase: 65ef042c25eb9eb4778907219c9b003589422b55
tealium-swift: 4b7e3dda42d7c1de6acb769abad9920346d17d43
TealiumFirebase: b489c74d3a1d7d81ad806e4da4638be6ea9870b9

PODFILE CHECKSUM: 2ea8c99e4b0c653bfca4a9a075ae84ee63f91f9f
PODFILE CHECKSUM: a4e910fa3529d9d8e69f4558a9a644ea2b7341b5

COCOAPODS: 1.14.2
COCOAPODS: 1.15.2
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@
"$(PROJECT_DIR)/Carthage/Build/iOS",
);
INFOPLIST_FILE = TealiumFirebaseExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -534,7 +534,7 @@
"$(PROJECT_DIR)/Carthage/Build/iOS",
);
INFOPLIST_FILE = TealiumFirebaseExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
67 changes: 67 additions & 0 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# 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/FirebaseConstants.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=$(<TealiumFirebase.podspec)
podspecRegex="^.*s.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
17 changes: 14 additions & 3 deletions xcframeworks.sh
Original file line number Diff line number Diff line change
@@ -1,19 +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
zip -r "${ZIP_PATH}" "${XCFRAMEWORK_PATH}"
ditto -ck --rsrc --sequesterRsrc --keepParent "${XCFRAMEWORK_PATH}" "${ZIP_PATH}"
rm -rf "${XCFRAMEWORK_PATH}"
fi
}

# do the work
surmagic xcf

zip_xcframeworks
# 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."
echo "Done! Upload ${ZIP_PATH} to GitHub when you create the release."

0 comments on commit 64f4477

Please sign in to comment.