Skip to content

Commit

Permalink
Merge pull request #124 from AppsFlyerSDK/releases/6.x.x/6.10.x/6.10.…
Browse files Browse the repository at this point in the history
…1-rc1

Releases/6.x.x/6.10.x/6.10.1 rc1
  • Loading branch information
morisgateno-appsflyer authored Apr 3, 2023
2 parents 55dfe35 + 4cab35e commit 049741d
Show file tree
Hide file tree
Showing 18 changed files with 220 additions and 108 deletions.
6 changes: 4 additions & 2 deletions Podfile → .github/bash_scripts/podfile_creation.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Uncomment the next line to define a global platform for your project
#!/bin/bash
echo "# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'segment-appsflyer-ios' do
Expand All @@ -18,4 +19,5 @@ target 'SegmentAppsFlyeriOSTests' do
# Pods for SegmentAppsFlyeriOSTests
pod 'OCMock'
end
end" > Podfile

15 changes: 15 additions & 0 deletions .github/bash_scripts/pre_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

appsflyerLibVersion=$1

sed -i '' "s/version_appsflyerLib = \'.*\'/version_appsflyerLib = \'$appsflyerLibVersion\'/g" segment-appsflyer-ios.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/(## 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

touch "releasenotes.$appsflyerLibVersion"
15 changes: 15 additions & 0 deletions .github/bash_scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

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/(.*pod \'segment-appsflyer-ios\')(.*)/\1,\'$releaseVersion\'/g" examples/SwiftPodsSample/Podfile
sed -r -i '' "s/(.*pod \'segment-appsflyer-ios\')(.*)/\1,\'$releaseVersion\'/g" examples/ObjcPodsSample/Podfile

sed -i '' 's/^/* /' "releasenotes.$releaseVersion"
NEW_VERSION_RELEASE_NOTES=$(cat "releasenotes.$releaseVersion")
NEW_VERSION_SECTION="### $releaseVersion\n$NEW_VERSION_RELEASE_NOTES\n\n"
echo -e "$NEW_VERSION_SECTION$(cat RELEASENOTES.md)" > RELEASENOTES.md

rm -r "releasenotes.$releaseVersion"
26 changes: 26 additions & 0 deletions .github/workflows/prepare-for-QA-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: pre-release

on:
workflow_call:

jobs:
Change-HardCoded-Version:
name: Pre Release
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Determine release tag and release branch
run: |
TAG=$(echo "${{github.ref_name}}" | grep -Eo '[0-9]+.[0-9]+.[0-9]+')
echo "PLUGIN_VERSION=$TAG" >> $GITHUB_ENV
- name: run script
run: bash .github/bash_scripts/pre_release.sh ${{env.PLUGIN_VERSION}}
- 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: '.'

35 changes: 35 additions & 0 deletions .github/workflows/prepare-for-release-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Prepare plugin for production

on:
pull_request:
types:
- opened
branches:
- 'master'
# - 'dev/add-release-workflow'

jobs:
Prepare-Plugin-For-Production:
if: startsWith(github.head_ref, 'releases/')
name: Prepare for production after testing the plugin
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: PR branch check
uses: mdecoleman/[email protected]
id: vars
with:
repo-token: ${{ secrets.CI_GITHUB_TOKEN }}
- name: Determine release tag and release branch
run: |
TAG=$(echo "${{ steps.vars.outputs.branch }}" | grep -Eo '[0-9]+.[0-9]+.[0-9]+')
echo "from branch: ${{github.head_ref}}"
echo "PLUGIN_VERSION=$TAG" >> $GITHUB_ENV
- name: run script
run: bash .github/bash_scripts/release.sh ${{env.PLUGIN_VERSION}}
- name: Commit and Push
run : |
git add .
git commit -m"Commited from github action - prepaing the repo for production."
git push origin HEAD:${{ steps.vars.outputs.branch }} --force
31 changes: 31 additions & 0 deletions .github/workflows/release-QA-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

name: Release plugin to QA

on:
push:
branches:
- releases/[0-9]+.x.x/[0-9]+.[0-9]+.x/[0-9]+.[0-9]+.[0-9]+-rc[0-9]+

jobs:
Check-If-ReleaseNotes-Pushed:
runs-on: ubuntu-latest
outputs:
answer: ${{ steps.filter.outputs.releasenotesfile }}
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
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

Deploy-Locally-To-QA:
needs: [Run-Unit-Tests,Check-If-ReleaseNotes-Pushed]
if: needs.Check-If-ReleaseNotes-Pushed.outputs.answer == 'false'
uses: ./.github/workflows/prepare-for-QA-release.yml
63 changes: 63 additions & 0 deletions .github/workflows/release-production-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Release plugin to production

on:
pull_request:
types:
- closed
branches:
- 'master'
# - 'dev/add-release-workflow'

jobs:
Deploy-To-Production:
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'releases/')
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: PR branch check
uses: mdecoleman/[email protected]
id: vars
with:
repo-token: ${{ secrets.CI_GITHUB_TOKEN }}
- name: Determine release tag and release branch
run: |
TAG=$(echo "${{ steps.vars.outputs.branch }}" | grep -Eo '[0-9]+.[0-9]+.[0-9]+')
echo "PLUGIN_VERSION=$TAG" >> $GITHUB_ENV
echo "RELEASE_BRANCH_NAME=${{ steps.vars.outputs.branch }}" >> $GITHUB_ENV
echo "push new release >> $TAG"
echo "from branch: ${{github.head_ref}}"
- name: Create release and tag
env:
TAG: ${{env.PLUGIN_VERSION}}
uses: "actions/github-script@v5"
with:
script: |
try {
await github.rest.repos.createRelease({
draft: false,
generate_release_notes: false,
name: process.env.TAG,
owner: context.repo.owner,
prerelease: false,
repo: context.repo.repo,
tag_name: process.env.TAG
});
} catch (error) {
core.setFailed(error.message);
}
- name: Install Cocoapods
run: gem install cocoapods
- name: Push to COCOAPODS
uses: michaelhenry/[email protected]
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.CI_COCOAPODS_TOKEN }}
- name: Notify with SLack
uses: slackapi/[email protected]
with:
payload: |
{
"appsflyer_version": "${{env.PLUGIN_VERSION}}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.CI_SLACK_WEBHOOK_URL }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name: CI - Tests
on:
push:
branches-ignore:
- 'main'
- 'master'
- 'releases/**'
workflow_call:
jobs:
Tests:
runs-on: macos-12
Expand All @@ -12,7 +13,9 @@ jobs:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: create Podfile
run: bash .github/bash_scripts/podfile_creation.sh
- name: CocoaPod Install
run: pod install
run: pod install
- name: Test
run: xcodebuild test -scheme segment-appsflyer-ios -workspace segment-appsflyer-ios.xcworkspace -destination 'platform=iOS Simulator,name=iPhone 13' | xcpretty && exit ${PIPESTATUS[0]}
run: xcodebuild test -scheme segment-appsflyer-ios -workspace segment-appsflyer-ios.xcworkspace -destination 'platform=iOS Simulator,name=iPhone 13' | xcpretty && exit ${PIPESTATUS[0]}
2 changes: 0 additions & 2 deletions Cartfile

This file was deleted.

2 changes: 0 additions & 2 deletions Cartfile.resolved

This file was deleted.

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.9.1")),
.package(name: "AppsFlyerLib" , url: "https://github.com/AppsFlyerSDK/AppsFlyerFramework.git", .exact("6.10.1")),
],
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.9.1.
## This is a Segment wrapper for AppsFlyer SDK that is built with iOS SDK v6.10.1.

[![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 @@ -48,12 +48,12 @@ To install the segment-appsflyer-ios integration:

**Production** version:
```ruby
pod 'segment-appsflyer-ios', '6.9.1'
pod 'segment-appsflyer-ios', '6.10.1'
```

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

Expand Down
5 changes: 4 additions & 1 deletion RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Release Notes
### 6.10.1
* Update iOS SDK to v6.10.1
* Added ci-cd.
* Added Platform Extension call.

### 6.9.1
* Updated iOS SDK to v6.9.1
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.9.1'
pod 'segment-appsflyer-ios','6.10.1'
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.9.1'
pod 'segment-appsflyer-ios','6.10.1'

end
13 changes: 8 additions & 5 deletions segment-appsflyer-ios.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
version_appsflyerLib = '6.10.1'
version_plugin = '6.10.1'

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

s.description = <<-DESC
Expand All @@ -22,14 +25,14 @@ Pod::Spec.new do |s|

s.default_subspecs = 'Main'
s.subspec 'Main' do |ss|
ss.ios.dependency 'AppsFlyerFramework','6.9.1'
ss.tvos.dependency 'AppsFlyerFramework', '6.9.1'
ss.ios.dependency 'AppsFlyerFramework',version_appsflyerLib
ss.tvos.dependency 'AppsFlyerFramework',version_appsflyerLib
ss.source_files = 'segment-appsflyer-ios/Classes/**/*'
end

s.subspec 'Strict' do |ss|
ss.ios.dependency 'AppsFlyerFramework/Strict', '6.9.1'
ss.tvos.dependency 'AppsFlyerFramework/Strict', '6.9.1'
ss.ios.dependency 'AppsFlyerFramework/Strict',version_appsflyerLib
ss.tvos.dependency 'AppsFlyerFramework/Strict',version_appsflyerLib
ss.source_files = 'segment-appsflyer-ios/Classes/**/*'
end
end
Loading

0 comments on commit 049741d

Please sign in to comment.