Skip to content

Commit 049741d

Browse files
Merge pull request #124 from AppsFlyerSDK/releases/6.x.x/6.10.x/6.10.1-rc1
Releases/6.x.x/6.10.x/6.10.1 rc1
2 parents 55dfe35 + 4cab35e commit 049741d

File tree

18 files changed

+220
-108
lines changed

18 files changed

+220
-108
lines changed

Podfile renamed to .github/bash_scripts/podfile_creation.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Uncomment the next line to define a global platform for your project
1+
#!/bin/bash
2+
echo "# Uncomment the next line to define a global platform for your project
23
# platform :ios, '9.0'
34
45
target 'segment-appsflyer-ios' do
@@ -18,4 +19,5 @@ target 'SegmentAppsFlyeriOSTests' do
1819
# Pods for SegmentAppsFlyeriOSTests
1920
pod 'OCMock'
2021
21-
end
22+
end" > Podfile
23+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
appsflyerLibVersion=$1
4+
5+
sed -i '' "s/version_appsflyerLib = \'.*\'/version_appsflyerLib = \'$appsflyerLibVersion\'/g" segment-appsflyer-ios.podspec
6+
7+
sed -r -i '' "s/(.*AppsFlyerLib.*)([0-9]+\.[0-9]+\.[0-9]+)(.*)/\1$appsflyerLibVersion\3/g" Package.swift
8+
9+
sed -r -i '' "s/(.*pod \'segment-appsflyer-ios\')(.*\'[0-9]+\.[0-9]+\.[0-9]+\')/\1,:podspec => \'\.\.\/\.\.\/segment-appsflyer-ios.podspec\'/g" examples/SwiftPodsSample/Podfile
10+
sed -r -i '' "s/(.*pod \'segment-appsflyer-ios\')(.*\'[0-9]+\.[0-9]+\.[0-9]+\')/\1,:podspec => \'\.\.\/\.\.\/segment-appsflyer-ios.podspec\'/g" examples/ObjcPodsSample/Podfile
11+
12+
sed -r -i '' "s/(## This is a Segment wrapper for AppsFlyer SDK that is built with iOS SDK v)(.*)/\1$appsflyerLibVersion./g" README.md
13+
sed -r -i '' "s/(.*pod \'segment-appsflyer-ios.*)([0-9]+\.[0-9]+\.[0-9]+)(.*)/\1$appsflyerLibVersion\3/g" README.md
14+
15+
touch "releasenotes.$appsflyerLibVersion"

.github/bash_scripts/release.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
releaseVersion=$1
4+
5+
sed -r -i '' "s/version_plugin = \'[0-9]+\.[0-9]+\.[0-9]+\'/version_plugin = \'$releaseVersion\'/g" segment-appsflyer-ios.podspec
6+
7+
sed -r -i '' "s/(.*pod \'segment-appsflyer-ios\')(.*)/\1,\'$releaseVersion\'/g" examples/SwiftPodsSample/Podfile
8+
sed -r -i '' "s/(.*pod \'segment-appsflyer-ios\')(.*)/\1,\'$releaseVersion\'/g" examples/ObjcPodsSample/Podfile
9+
10+
sed -i '' 's/^/* /' "releasenotes.$releaseVersion"
11+
NEW_VERSION_RELEASE_NOTES=$(cat "releasenotes.$releaseVersion")
12+
NEW_VERSION_SECTION="### $releaseVersion\n$NEW_VERSION_RELEASE_NOTES\n\n"
13+
echo -e "$NEW_VERSION_SECTION$(cat RELEASENOTES.md)" > RELEASENOTES.md
14+
15+
rm -r "releasenotes.$releaseVersion"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: pre-release
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
Change-HardCoded-Version:
8+
name: Pre Release
9+
runs-on: macos-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
- name: Determine release tag and release branch
14+
run: |
15+
TAG=$(echo "${{github.ref_name}}" | grep -Eo '[0-9]+.[0-9]+.[0-9]+')
16+
echo "PLUGIN_VERSION=$TAG" >> $GITHUB_ENV
17+
- name: run script
18+
run: bash .github/bash_scripts/pre_release.sh ${{env.PLUGIN_VERSION}}
19+
- name: Commit changes
20+
uses: EndBug/add-and-commit@v9
21+
with:
22+
author_name: Moris Gateno
23+
author_email: [email protected]
24+
message: 'Commited from github action - prepaing the repo for QA locally.'
25+
add: '.'
26+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Prepare plugin for production
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
branches:
8+
- 'master'
9+
# - 'dev/add-release-workflow'
10+
11+
jobs:
12+
Prepare-Plugin-For-Production:
13+
if: startsWith(github.head_ref, 'releases/')
14+
name: Prepare for production after testing the plugin
15+
runs-on: macos-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
- name: PR branch check
20+
uses: mdecoleman/[email protected]
21+
id: vars
22+
with:
23+
repo-token: ${{ secrets.CI_GITHUB_TOKEN }}
24+
- name: Determine release tag and release branch
25+
run: |
26+
TAG=$(echo "${{ steps.vars.outputs.branch }}" | grep -Eo '[0-9]+.[0-9]+.[0-9]+')
27+
echo "from branch: ${{github.head_ref}}"
28+
echo "PLUGIN_VERSION=$TAG" >> $GITHUB_ENV
29+
- name: run script
30+
run: bash .github/bash_scripts/release.sh ${{env.PLUGIN_VERSION}}
31+
- name: Commit and Push
32+
run : |
33+
git add .
34+
git commit -m"Commited from github action - prepaing the repo for production."
35+
git push origin HEAD:${{ steps.vars.outputs.branch }} --force
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
name: Release plugin to QA
3+
4+
on:
5+
push:
6+
branches:
7+
- releases/[0-9]+.x.x/[0-9]+.[0-9]+.x/[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
8+
9+
jobs:
10+
Check-If-ReleaseNotes-Pushed:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
answer: ${{ steps.filter.outputs.releasenotesfile }}
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: dorny/paths-filter@v2
17+
id: filter
18+
with:
19+
filters: |
20+
releasenotesfile:
21+
- 'releasenotes.**'
22+
23+
Run-Unit-Tests:
24+
needs: Check-If-ReleaseNotes-Pushed
25+
if: needs.Check-If-ReleaseNotes-Pushed.outputs.answer == 'false'
26+
uses: ./.github/workflows/unit-tests-workflow.yml
27+
28+
Deploy-Locally-To-QA:
29+
needs: [Run-Unit-Tests,Check-If-ReleaseNotes-Pushed]
30+
if: needs.Check-If-ReleaseNotes-Pushed.outputs.answer == 'false'
31+
uses: ./.github/workflows/prepare-for-QA-release.yml
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Release plugin to production
2+
3+
on:
4+
pull_request:
5+
types:
6+
- closed
7+
branches:
8+
- 'master'
9+
# - 'dev/add-release-workflow'
10+
11+
jobs:
12+
Deploy-To-Production:
13+
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'releases/')
14+
runs-on: macos-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
- name: PR branch check
19+
uses: mdecoleman/[email protected]
20+
id: vars
21+
with:
22+
repo-token: ${{ secrets.CI_GITHUB_TOKEN }}
23+
- name: Determine release tag and release branch
24+
run: |
25+
TAG=$(echo "${{ steps.vars.outputs.branch }}" | grep -Eo '[0-9]+.[0-9]+.[0-9]+')
26+
echo "PLUGIN_VERSION=$TAG" >> $GITHUB_ENV
27+
echo "RELEASE_BRANCH_NAME=${{ steps.vars.outputs.branch }}" >> $GITHUB_ENV
28+
echo "push new release >> $TAG"
29+
echo "from branch: ${{github.head_ref}}"
30+
- name: Create release and tag
31+
env:
32+
TAG: ${{env.PLUGIN_VERSION}}
33+
uses: "actions/github-script@v5"
34+
with:
35+
script: |
36+
try {
37+
await github.rest.repos.createRelease({
38+
draft: false,
39+
generate_release_notes: false,
40+
name: process.env.TAG,
41+
owner: context.repo.owner,
42+
prerelease: false,
43+
repo: context.repo.repo,
44+
tag_name: process.env.TAG
45+
});
46+
} catch (error) {
47+
core.setFailed(error.message);
48+
}
49+
- name: Install Cocoapods
50+
run: gem install cocoapods
51+
- name: Push to COCOAPODS
52+
uses: michaelhenry/[email protected]
53+
env:
54+
COCOAPODS_TRUNK_TOKEN: ${{ secrets.CI_COCOAPODS_TOKEN }}
55+
- name: Notify with SLack
56+
uses: slackapi/[email protected]
57+
with:
58+
payload: |
59+
{
60+
"appsflyer_version": "${{env.PLUGIN_VERSION}}"
61+
}
62+
env:
63+
SLACK_WEBHOOK_URL: ${{ secrets.CI_SLACK_WEBHOOK_URL }}

.github/workflows/test.yml renamed to .github/workflows/unit-tests-workflow.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ name: CI - Tests
22
on:
33
push:
44
branches-ignore:
5-
- 'main'
5+
- 'master'
66
- 'releases/**'
7+
workflow_call:
78
jobs:
89
Tests:
910
runs-on: macos-12
@@ -12,7 +13,9 @@ jobs:
1213
- uses: maxim-lobanov/setup-xcode@v1
1314
with:
1415
xcode-version: latest-stable
16+
- name: create Podfile
17+
run: bash .github/bash_scripts/podfile_creation.sh
1518
- name: CocoaPod Install
16-
run: pod install
19+
run: pod install
1720
- name: Test
18-
run: xcodebuild test -scheme segment-appsflyer-ios -workspace segment-appsflyer-ios.xcworkspace -destination 'platform=iOS Simulator,name=iPhone 13' | xcpretty && exit ${PIPESTATUS[0]}
21+
run: xcodebuild test -scheme segment-appsflyer-ios -workspace segment-appsflyer-ios.xcworkspace -destination 'platform=iOS Simulator,name=iPhone 13' | xcpretty && exit ${PIPESTATUS[0]}

Cartfile

Lines changed: 0 additions & 2 deletions
This file was deleted.

Cartfile.resolved

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)