Skip to content

Commit

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

Releases/6.x.x/6.10.x/6.10.3 rc1
  • Loading branch information
morisgateno-appsflyer authored May 1, 2023
2 parents 80d39bb + 67b419a commit f918878
Show file tree
Hide file tree
Showing 14 changed files with 247 additions and 19 deletions.
23 changes: 23 additions & 0 deletions .github/bash_scripts/pre_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

appsflyerversion=$1
rc=$2

sed -E -i '' "s/(.*af-android-sdk:)([0-9]+\.[0-9]+\.[0-9]+)'/\1$appsflyerversion\'/g" app/build.gradle

sed -E -i '' "s/(.*af-android-sdk:)([0-9]+\.[0-9]+\.[0-9]+)'/\1$appsflyerversion\'/g" segmenttestapp/build.gradle

version_code=$(grep -E 'VERSION_CODE=([0-9]+)' gradle.properties | grep -o '[0-9]\+')
version_code=$((version_code+1))
sed -E -i '' "s/VERSION_CODE=([0-9]+)/VERSION_CODE=$version_code/g" gradle.properties

sed -E -i '' "s/VERSION_NAME=([0-9]+\.[0-9]+\.[0-9]+)/VERSION_NAME=$appsflyerversion-rc$rc/g" gradle.properties

sed -E -i '' "s/(POM_ARTIFACT_ID=.*)/\1-beta/g" gradle.properties

sed -E -i '' "s/(Built with AppsFlyer Android SDK.*)([0-9]+\.[0-9]+\.[0-9]+)(.*)/\1$appsflyerversion\3/g" Readme.md
sed -E -i '' "s/(.*appsflyer:segment-android-integration:)([0-9]+\.[0-9]+\.[0-9]+)(.*)/\1$appsflyerversion\3/g" Readme.md

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

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

releaseversion=$1

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"

sed -E -i '' "s/VERSION_NAME=([0-9]+\.[0-9]+\.[0-9]+).*/VERSION_NAME=$releaseversion/g" gradle.properties

sed -E -i '' "s/(POM_ARTIFACT_ID=.*)-beta/\1/g" gradle.properties
51 changes: 51 additions & 0 deletions .github/workflows/prepare-for-QA-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: pre-release

on:
workflow_call:

jobs:
Change-HardCoded-Version:
name: Pre Release
runs-on:
- self-hosted

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]+')
RC=$(echo "${{github.ref_name}}" | grep -Eo '[0-9]+$')
echo "PLUGIN_VERSION=$TAG" >> $GITHUB_ENV
echo "RC_NUMBER=$RC" >> $GITHUB_ENV
- name: run script
run: bash .github/bash_scripts/pre_release.sh ${{env.PLUGIN_VERSION}} ${{env.RC_NUMBER}}
- 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.'
add: '.'
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Grant execute permission for gradlew
run: |
chmod +x ./gradlew
- name: Publish package to QA (-Beta)
run: |
./gradlew publish
- name: Notify with Slack
uses: slackapi/[email protected]
with:
payload: |
{
"appsflyer_version": "${{env.PLUGIN_VERSION}}",
"environment": "QA"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.CI_SLACK_WEBHOOK_URL }}


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:
- self-hosted
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
- 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
34 changes: 34 additions & 0 deletions .github/workflows/release-QA-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

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:
- self-hosted
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
secrets: inherit

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
secrets: inherit
68 changes: 68 additions & 0 deletions .github/workflows/release-production-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
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:
- self-hosted
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"
- 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: Set up JDK
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Grant execute permission for gradlew
run: |
chmod +x ./gradlew
- name: Publish package
run: |
./gradlew publish
- name: Notify with Slack
uses: slackapi/[email protected]
with:
payload: |
{
"appsflyer_version": "${{env.PLUGIN_VERSION}}",
"environment": "Production"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.CI_SLACK_WEBHOOK_URL }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ name: CI - Tests
on:
push:
branches-ignore:
- 'main'
- 'master'
- 'releases/**'
workflow_call:
jobs:
Tests:
runs-on: ubuntu-latest
runs-on:
- self-hosted
steps:
- uses: actions/checkout@v2
- name: Set up JDK
Expand Down
4 changes: 3 additions & 1 deletion RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Release Notes
### 6.10.3
* * Update Android SDK to v6.10.1
* * Added CI-CD pipeline

### 6.10.2
* Update Android SDK to v6.10.2
Expand Down
4 changes: 2 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You can track installs, updates and sessions and also track additional in-app ev

---

Built with AppsFlyer Android SDK `v6.10.2`
Built with AppsFlyer Android SDK `v6.10.3`

## Table of content

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

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

Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ android {

dependencies {
implementation 'androidx.test.ext:junit:1.1.5'
implementation 'com.appsflyer:af-android-sdk:6.10.2'
implementation 'com.appsflyer:af-android-sdk:6.10.3'
compileOnly 'com.android.installreferrer:installreferrer:2.1'
compileOnly 'com.segment.analytics.android:analytics:4.+'
testImplementation 'androidx.test:core:1.4.0'
Expand All @@ -59,4 +59,4 @@ tasks.withType(Test) {
}
}

apply from:file("publish.gradle")
apply from:file("publish.gradle")
9 changes: 4 additions & 5 deletions app/publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,10 @@ afterEvaluate {
}
}

signing {
logger("signing")
sign publishing.publications
}

signing {
logger("signing")
sign publishing.publications
}

publish.dependsOn build
publishToMavenLocal.dependsOn build
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public Integration<AppsFlyerLib> create(ValueMap settings, Analytics analytics)
listener = new ConversionListener(analytics);
}

AppsFlyerLib.getInstance().setPluginInfo(new PluginInfo(Plugin.SEGMENT,"6.10.2"));
AppsFlyerLib.getInstance().setPluginInfo(new PluginInfo(Plugin.SEGMENT,"6.10.3"));
afLib.setDebugLog(logger.logLevel != Analytics.LogLevel.NONE);
afLib.init(devKey, listener, application.getApplicationContext());
if (deepLinkListener != null)
Expand Down Expand Up @@ -321,4 +321,4 @@ private Context getContext() {



}
}
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

GROUP=com.appsflyer

VERSION_CODE=12
VERSION_NAME=6.10.2
VERSION_CODE=13
VERSION_NAME=6.10.3
POM_ARTIFACT_ID=segment-android-integration
POM_PACKAGING=aar

Expand All @@ -40,4 +40,4 @@ POM_DEVELOPER_ID=appsflyer
POM_DEVELOPER_NAME=AppsFlyer, Inc.

android.useAndroidX=true
android.enableJetifier=true
android.enableJetifier=true
4 changes: 2 additions & 2 deletions segmenttestapp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies {
implementation project(path: ':app')
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.appsflyer:af-android-sdk:6.10.2'
implementation 'com.appsflyer:af-android-sdk:6.10.3'
implementation 'com.segment.analytics.android:analytics:4.+'
implementation 'com.android.installreferrer:installreferrer:2.1'
}
}

0 comments on commit f918878

Please sign in to comment.