Skip to content

Commit f918878

Browse files
Merge pull request #86 from AppsFlyerSDK/releases/6.x.x/6.10.x/6.10.3-rc1
Releases/6.x.x/6.10.x/6.10.3 rc1
2 parents 80d39bb + 67b419a commit f918878

File tree

14 files changed

+247
-19
lines changed

14 files changed

+247
-19
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
appsflyerversion=$1
4+
rc=$2
5+
6+
sed -E -i '' "s/(.*af-android-sdk:)([0-9]+\.[0-9]+\.[0-9]+)'/\1$appsflyerversion\'/g" app/build.gradle
7+
8+
sed -E -i '' "s/(.*af-android-sdk:)([0-9]+\.[0-9]+\.[0-9]+)'/\1$appsflyerversion\'/g" segmenttestapp/build.gradle
9+
10+
version_code=$(grep -E 'VERSION_CODE=([0-9]+)' gradle.properties | grep -o '[0-9]\+')
11+
version_code=$((version_code+1))
12+
sed -E -i '' "s/VERSION_CODE=([0-9]+)/VERSION_CODE=$version_code/g" gradle.properties
13+
14+
sed -E -i '' "s/VERSION_NAME=([0-9]+\.[0-9]+\.[0-9]+)/VERSION_NAME=$appsflyerversion-rc$rc/g" gradle.properties
15+
16+
sed -E -i '' "s/(POM_ARTIFACT_ID=.*)/\1-beta/g" gradle.properties
17+
18+
sed -E -i '' "s/(Built with AppsFlyer Android SDK.*)([0-9]+\.[0-9]+\.[0-9]+)(.*)/\1$appsflyerversion\3/g" Readme.md
19+
sed -E -i '' "s/(.*appsflyer:segment-android-integration:)([0-9]+\.[0-9]+\.[0-9]+)(.*)/\1$appsflyerversion\3/g" Readme.md
20+
21+
sed -E -i '' "s/(.*setPluginInfo.*)([0-9]+\.[0-9]+\.[0-9]+)(.*)/\1$appsflyerversion\3/g" app/src/main/java/com/segment/analytics/android/integrations/appsflyer/AppsflyerIntegration.java
22+
23+
touch "releasenotes.$appsflyerversion"

.github/bash_scripts/release.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
releaseversion=$1
4+
5+
sed -i '' 's/^/* /' "releasenotes.$releaseversion"
6+
NEW_VERSION_RELEASE_NOTES=$(cat "releasenotes.$releaseversion")
7+
NEW_VERSION_SECTION="### $releaseversion\n$NEW_VERSION_RELEASE_NOTES\n\n"
8+
echo -e "$NEW_VERSION_SECTION$(cat RELEASENOTES.md)" > RELEASENOTES.md
9+
10+
rm -r "releasenotes.$releaseversion"
11+
12+
sed -E -i '' "s/VERSION_NAME=([0-9]+\.[0-9]+\.[0-9]+).*/VERSION_NAME=$releaseversion/g" gradle.properties
13+
14+
sed -E -i '' "s/(POM_ARTIFACT_ID=.*)-beta/\1/g" gradle.properties
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: pre-release
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
Change-HardCoded-Version:
8+
name: Pre Release
9+
runs-on:
10+
- self-hosted
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
- name: Determine release tag and release branch
16+
run: |
17+
TAG=$(echo "${{github.ref_name}}" | grep -Eo '[0-9]+.[0-9]+.[0-9]+')
18+
RC=$(echo "${{github.ref_name}}" | grep -Eo '[0-9]+$')
19+
echo "PLUGIN_VERSION=$TAG" >> $GITHUB_ENV
20+
echo "RC_NUMBER=$RC" >> $GITHUB_ENV
21+
- name: run script
22+
run: bash .github/bash_scripts/pre_release.sh ${{env.PLUGIN_VERSION}} ${{env.RC_NUMBER}}
23+
- name: Commit changes
24+
uses: EndBug/add-and-commit@v9
25+
with:
26+
author_name: Moris Gateno
27+
author_email: [email protected]
28+
message: 'Commited from github action - prepaing the repo for QA.'
29+
add: '.'
30+
- name: Set up JDK
31+
uses: actions/setup-java@v1
32+
with:
33+
java-version: '11'
34+
- name: Grant execute permission for gradlew
35+
run: |
36+
chmod +x ./gradlew
37+
- name: Publish package to QA (-Beta)
38+
run: |
39+
./gradlew publish
40+
- name: Notify with Slack
41+
uses: slackapi/[email protected]
42+
with:
43+
payload: |
44+
{
45+
"appsflyer_version": "${{env.PLUGIN_VERSION}}",
46+
"environment": "QA"
47+
}
48+
env:
49+
SLACK_WEBHOOK_URL: ${{ secrets.CI_SLACK_WEBHOOK_URL }}
50+
51+
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:
16+
- self-hosted
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
- name: PR branch check
21+
uses: mdecoleman/[email protected]
22+
id: vars
23+
with:
24+
repo-token: ${{ secrets.CI_GITHUB_TOKEN }}
25+
- name: Determine release tag and release branch
26+
run: |
27+
TAG=$(echo "${{ steps.vars.outputs.branch }}" | grep -Eo '[0-9]+.[0-9]+.[0-9]+')
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: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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:
12+
- self-hosted
13+
outputs:
14+
answer: ${{ steps.filter.outputs.releasenotesfile }}
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: dorny/paths-filter@v2
18+
id: filter
19+
with:
20+
filters: |
21+
releasenotesfile:
22+
- 'releasenotes.**'
23+
24+
Run-Unit-Tests:
25+
needs: Check-If-ReleaseNotes-Pushed
26+
if: needs.Check-If-ReleaseNotes-Pushed.outputs.answer == 'false'
27+
uses: ./.github/workflows/unit-tests-workflow.yml
28+
secrets: inherit
29+
30+
Deploy-Locally-To-QA:
31+
needs: [Run-Unit-Tests,Check-If-ReleaseNotes-Pushed]
32+
if: needs.Check-If-ReleaseNotes-Pushed.outputs.answer == 'false'
33+
uses: ./.github/workflows/prepare-for-QA-release.yml
34+
secrets: inherit
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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:
15+
- self-hosted
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 "PLUGIN_VERSION=$TAG" >> $GITHUB_ENV
28+
echo "RELEASE_BRANCH_NAME=${{ steps.vars.outputs.branch }}" >> $GITHUB_ENV
29+
echo "push new release >> $TAG"
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: Set up JDK
50+
uses: actions/setup-java@v1
51+
with:
52+
java-version: '11'
53+
- name: Grant execute permission for gradlew
54+
run: |
55+
chmod +x ./gradlew
56+
- name: Publish package
57+
run: |
58+
./gradlew publish
59+
- name: Notify with Slack
60+
uses: slackapi/[email protected]
61+
with:
62+
payload: |
63+
{
64+
"appsflyer_version": "${{env.PLUGIN_VERSION}}",
65+
"environment": "Production"
66+
}
67+
env:
68+
SLACK_WEBHOOK_URL: ${{ secrets.CI_SLACK_WEBHOOK_URL }}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ name: CI - Tests
22
on:
33
push:
44
branches-ignore:
5-
- 'main'
5+
- 'master'
66
- 'releases/**'
7+
workflow_call:
78
jobs:
89
Tests:
9-
runs-on: ubuntu-latest
10+
runs-on:
11+
- self-hosted
1012
steps:
1113
- uses: actions/checkout@v2
1214
- name: Set up JDK

RELEASENOTES.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Release Notes
1+
### 6.10.3
2+
* * Update Android SDK to v6.10.1
3+
* * Added CI-CD pipeline
24

35
### 6.10.2
46
* Update Android SDK to v6.10.2

Readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ You can track installs, updates and sessions and also track additional in-app ev
2121

2222
---
2323

24-
Built with AppsFlyer Android SDK `v6.10.2`
24+
Built with AppsFlyer Android SDK `v6.10.3`
2525

2626
## Table of content
2727

@@ -95,7 +95,7 @@ And to start the AppsFlyer SDK, use `void startAppsFlyer(Context context)` API.
9595

9696
Add the AppsFlyer Segment Integration dependency to your app `build.gradle` file.
9797
```java
98-
implementation 'com.appsflyer:segment-android-integration:6.10.2'
98+
implementation 'com.appsflyer:segment-android-integration:6.10.3'
9999
implementation 'com.android.installreferrer:installreferrer:2.1'
100100
```
101101

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ android {
3939

4040
dependencies {
4141
implementation 'androidx.test.ext:junit:1.1.5'
42-
implementation 'com.appsflyer:af-android-sdk:6.10.2'
42+
implementation 'com.appsflyer:af-android-sdk:6.10.3'
4343
compileOnly 'com.android.installreferrer:installreferrer:2.1'
4444
compileOnly 'com.segment.analytics.android:analytics:4.+'
4545
testImplementation 'androidx.test:core:1.4.0'
@@ -59,4 +59,4 @@ tasks.withType(Test) {
5959
}
6060
}
6161

62-
apply from:file("publish.gradle")
62+
apply from:file("publish.gradle")

0 commit comments

Comments
 (0)