Skip to content

Commit

Permalink
Merge e1fd0ac into 2f3a28c
Browse files Browse the repository at this point in the history
  • Loading branch information
morisgateno-appsflyer authored Jun 13, 2024
2 parents 2f3a28c + e1fd0ac commit added50
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 29 deletions.
8 changes: 6 additions & 2 deletions .github/bash_scripts/pre_release.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#!/bin/bash

appsflyerLibVersion=$1
rcVersion=$2

sed -i '' "s/version_appsflyerLib = \'.*\'/version_appsflyerLib = \'$appsflyerLibVersion\'/g" segment-appsflyer-ios.podspec
sed -i '' "s/version_plugin = \'.*\'/version_plugin = \'$rcVersion\'/g" segment-appsflyer-ios.podspec
sed -i '' "s/s.name = \"segment-appsflyer-ios\"/s.name = \"segment-appsflyer-ios-qa\"/g" segment-appsflyer-ios.podspec
mv segment-appsflyer-ios.podspec segment-appsflyer-ios-qa.podspec

sed -r -i '' "s/(.*AppsFlyerLib.*)([0-9]+\.[0-9]+\.[0-9]+)(.*)/\1$appsflyerLibVersion\3/g" Package.swift

sed -r -i '' "s/(.*pod \'segment-appsflyer-ios\')(.*\'[0-9]+\.[0-9]+\.[0-9]+\')/\1,:podspec => \'\.\.\/\.\.\/segment-appsflyer-ios.podspec\'/g" examples/SwiftPodsSample/Podfile
sed -r -i '' "s/(.*pod \'segment-appsflyer-ios\')(.*\'[0-9]+\.[0-9]+\.[0-9]+\')/\1,:podspec => \'\.\.\/\.\.\/segment-appsflyer-ios.podspec\'/g" examples/ObjcPodsSample/Podfile
sed -r -i '' "s/(.*pod \'segment-appsflyer-ios\')(.*\'[0-9]+\.[0-9]+\.[0-9]+\')/\1,\'$rcVersion\'/g" examples/SwiftPodsSample/Podfile
sed -r -i '' "s/(.*pod \'segment-appsflyer-ios\')(.*\'[0-9]+\.[0-9]+\.[0-9]+\')/\1,\'$rcVersion\'/g" examples/ObjcPodsSample/Podfile

sed -r -i '' "s/(## This is a Segment wrapper for AppsFlyer SDK that is built with iOS SDK v)(.*)/\1$appsflyerLibVersion./g" README.md
sed -r -i '' "s/(.*pod \'segment-appsflyer-ios.*)([0-9]+\.[0-9]+\.[0-9]+)(.*)/\1$appsflyerLibVersion\3/g" README.md
Expand Down
4 changes: 3 additions & 1 deletion .github/bash_scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

releaseVersion=$1

sed -r -i '' "s/version_plugin = \'[0-9]+\.[0-9]+\.[0-9]+\'/version_plugin = \'$releaseVersion\'/g" segment-appsflyer-ios.podspec
sed -r -i '' "s/version_plugin = \'[0-9]+\.[0-9]+\.[0-9]+.*\'/version_plugin = \'$releaseVersion\'/g" segment-appsflyer-ios-qa.podspec
sed -i '' "s/s.name = \"segment-appsflyer-ios-qa\"/s.name = \"segment-appsflyer-ios\"/g" segment-appsflyer-ios-qa.podspec
mv segment-appsflyer-ios-qa.podspec segment-appsflyer-ios.podspec

sed -r -i '' "s/(.*pod \'segment-appsflyer-ios\')(.*)/\1,\'$releaseVersion\'/g" examples/SwiftPodsSample/Podfile
sed -r -i '' "s/(.*pod \'segment-appsflyer-ios\')(.*)/\1,\'$releaseVersion\'/g" examples/ObjcPodsSample/Podfile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,33 @@ on:
jobs:
Change-HardCoded-Version:
name: Pre Release
runs-on: macos-latest
runs-on: [ios, self-hosted]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Determine release tag and release branch
run: |
echo ${{github.ref_name}}
TAG=$(echo "${{github.ref_name}}" | grep -Eo '[0-9]+.[0-9]+.[0-9]+')
echo "PLUGIN_VERSION=$TAG" >> $GITHUB_ENV
echo "PLUGIN_VERSION=$TAG" >> $GITHUB_ENV
TAG_RC=$(echo "${{github.ref_name}}" | grep -Eo '[0-9]+.[0-9]+.[0-9]+-rc[0-9]+')
echo "PLUGIN_VERSION_RC=$TAG_RC" >> $GITHUB_ENV
- name: run script
run: bash .github/bash_scripts/pre_release.sh ${{env.PLUGIN_VERSION}}
run: bash .github/bash_scripts/pre_release.sh ${{env.PLUGIN_VERSION}} ${{env.PLUGIN_VERSION_RC}}
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
author_name: Moris Gateno
author_email: [email protected]
message: 'Commited from github action - prepaing the repo for QA locally.'
add: '.'
add: '.'
tag: "${{env.PLUGIN_VERSION_RC}} --force"
tag_push: '--force'
- name: Push to COCOAPODS
run: |
pod trunk me
pod trunk push segment-appsflyer-ios-qa.podspec
1 change: 0 additions & 1 deletion .github/workflows/prepare-for-release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- opened
branches:
- 'master'
# - 'dev/add-release-workflow'

jobs:
Prepare-Plugin-For-Production:
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/release-QA-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ jobs:
releasenotesfile:
- 'releasenotes.**'
Run-Unit-Tests:
needs: Check-If-ReleaseNotes-Pushed
if: needs.Check-If-ReleaseNotes-Pushed.outputs.answer == 'false'
uses: ./.github/workflows/unit-tests-workflow.yml
# Run-Unit-Tests:
# needs: Check-If-ReleaseNotes-Pushed
# if: needs.Check-If-ReleaseNotes-Pushed.outputs.answer == 'false'
# uses: ./.github/workflows/unit-tests-workflow.yml

Deploy-Locally-To-QA:
needs: [Run-Unit-Tests,Check-If-ReleaseNotes-Pushed]
Prepere-To-QA:
needs: [Check-If-ReleaseNotes-Pushed]
if: needs.Check-If-ReleaseNotes-Pushed.outputs.answer == 'false'
uses: ./.github/workflows/prepare-for-QA-release.yml
uses: ./.github/workflows/prepare-for-QA-&-release.yml

2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let package = Package(
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(name: "Segment", url: "https://github.com/segmentio/analytics-ios.git" , from: "4.0.0"),
.package(name: "AppsFlyerLib" , url: "https://github.com/AppsFlyerSDK/AppsFlyerFramework.git", .exact("6.14.3")),
.package(name: "AppsFlyerLib" , url: "https://github.com/AppsFlyerSDK/AppsFlyerFramework.git", .exact("6.14.4")),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# AppsFlyer integration for Segment.

## This is a Segment wrapper for AppsFlyer SDK that is built with iOS SDK v6.14.3.
## This is a Segment wrapper for AppsFlyer SDK that is built with iOS SDK v6.14.4.

[![Version](https://img.shields.io/badge/cocoapods-compatible-brightgreen?logo=cocoapods&logoColor=green&style=flat)](http://cocoapods.org/pods/segment-appsflyer-ios)
[![Carthage compatible](https://img.shields.io/badge/Carthage-not_compatible-C20000.svg?style=flat)](https://github.com/Carthage/Carthage)
Expand Down Expand Up @@ -49,12 +49,12 @@ To install the segment-appsflyer-ios integration:

**Production** version:
```ruby
pod 'segment-appsflyer-ios', '6.14.3'
pod 'segment-appsflyer-ios', '6.14.4'
```

**Strict mode SDK** version:
```ruby
pod 'segment-appsflyer-ios/Strict', '6.14.3'
pod 'segment-appsflyer-ios/Strict', '6.14.4'
```
Use the strict mode SDK to completely remove IDFA collection functionality and AdSupport framework dependencies (for example, when developing apps for kids).

Expand Down
2 changes: 1 addition & 1 deletion SegmentAppsFlyeriOSTests/SEGAppsFlyerIntegrationTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ - (void)testSEGAppsFlyerIntegration_onConversionDataSuccess_happyflow{
return YES;
}]]);
OCMStub([SEGAnalyticsMock track:[OCMArg checkWithBlock:^BOOL(id obj) {
XCTAssertTrue([obj isEqual:@"Install Attributed"]);
XCTAssertTrue([obj isEqual:@"GCD-Success"]);
return YES;
}] properties:[OCMArg checkWithBlock:^BOOL(id obj) {
XCTAssertTrue([obj isEqualToDictionary:dictionaryInputToAnalytics]);
Expand Down
2 changes: 1 addition & 1 deletion examples/ObjcPodsSample/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ target 'ObjcPodsSample' do
use_frameworks!

# Pods for ObjcPodsSample
pod 'segment-appsflyer-ios','6.14.3'
pod 'segment-appsflyer-ios','6.14.4-rc19'
end
2 changes: 1 addition & 1 deletion examples/SwiftPodsSample/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ target 'SwiftPodsSample' do
use_frameworks!

# Pods for SwiftPodsSample
pod 'segment-appsflyer-ios','6.14.3'
pod 'segment-appsflyer-ios','6.14.4-rc19'

end
Empty file added releasenotes.6.14.4
Empty file.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version_appsflyerLib = '6.14.3'
version_plugin = '6.14.3'
version_appsflyerLib = '6.14.4'
version_plugin = '6.14.4-rc19'

Pod::Spec.new do |s|
s.name = "segment-appsflyer-ios"
s.name = "segment-appsflyer-ios-qa"
s.version = version_plugin
s.summary = "AppsFlyer Integration for Segment's analytics-ios library."

Expand Down
14 changes: 10 additions & 4 deletions segment-appsflyer-ios/Classes/SEGAppsFlyerIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ - (instancetype)initWithSettings:(NSDictionary *)settings withAnalytics:(SEGAnal

self.appsflyer = [self appsflyerLib];
[self.appsflyer setPluginInfoWith:AFSDKPluginSegment
pluginVersion:@"6.14.3"
pluginVersion:@"6.14.4"
additionalParams:nil];
[self.appsflyer setAppsFlyerDevKey:afDevKey];
[self.appsflyer setAppleAppID:appleAppId];
Expand Down Expand Up @@ -93,7 +93,7 @@ - (instancetype)initWithSettings:(NSDictionary *)settings withAppsflyer:(AppsFly
self.appsflyer = aAppsflyer;

[self.appsflyer setPluginInfoWith:AFSDKPluginSegment
pluginVersion:@"6.14.3"
pluginVersion:@"6.14.4"
additionalParams:nil];

NSString *afDevKey = [self.settings objectForKey:@"appsFlyerDevKey"];
Expand Down Expand Up @@ -165,7 +165,13 @@ - (void)identify:(SEGIdentifyPayload *)payload
}

- (void) start {
[self.appsflyer start];
[self.appsflyer startWithCompletionHandler:^(NSDictionary<NSString *,id> * _Nullable dictionary, NSError * _Nullable error) {
if(error == nil){

[self.appsflyer logEvent:@"Start-Success" withValues:@{}];

}
}];
}


Expand Down Expand Up @@ -257,7 +263,7 @@ - (void)onConversionDataSuccess:(nonnull NSDictionary *)conversionInfo {
// If you are working with networks that don't allow passing user level data to 3rd parties,
// you will need to apply code to filter out these networks before calling
// `[self.analytics track:@"Install Attributed" properties:[properties copy]];`
[self.analytics track:@"Install Attributed" properties: [properties copy]];
[self.analytics track:@"GCD-Success" properties: [properties copy]];


}
Expand Down

0 comments on commit added50

Please sign in to comment.