Skip to content

Commit

Permalink
chore(release): pulling release-v2/2.5.0 into master-v2
Browse files Browse the repository at this point in the history
chore(release): pulling release-v2/2.5.0 into master-v2
  • Loading branch information
itsdebs authored Oct 31, 2023
2 parents aba7771 + 35e5e6b commit f04b894
Show file tree
Hide file tree
Showing 16 changed files with 80 additions and 43 deletions.
28 changes: 9 additions & 19 deletions .github/workflows/publish-new-github-release-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,13 @@ jobs:
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION=${BRANCH_NAME#hotfix-}
VERSION=${VERSION#release-v2/}
echo "release_version=$VERSION" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get the latest version tag v2
id: extract-previous-version-v2
run: |
TAGS=$(git tag --sort=-v:refname)
TAGS_ARRAY=($TAGS)
VERSION=${TAGS_ARRAY[0]}
echo "previous_version=$VERSION" >> $GITHUB_OUTPUT
- name: Setup Node v2
uses: actions/setup-node@v3
with:
Expand All @@ -57,35 +47,35 @@ jobs:
- name: Create Monorepo Release Tag v2
id: create_monorepo_release_v2
run: |
git tag -a v${{ steps.extract-version.outputs.release_version }} -m "chore: release v${{ steps.extract-version.outputs.release_version }}"
git push origin refs/tags/v${{ steps.extract-version.outputs.release_version }}
git tag -a v${{ steps.extract-version-v2.outputs.release_version }} -m "chore: release v${{ steps.extract-version-v2.outputs.release_version }}"
git push origin refs/tags/v${{ steps.extract-version-v2.outputs.release_version }}
- name: Get the two latest versions
run: |
CURRENT_VERSION=$(git tag -l "v*" --sort=-version:refname | head -n 1)
LAST_VERSION=$(git tag -l "v*" --sort=-version:refname | head -n 2 | awk 'NR == 2 { print $1 }')
CURRENT_VERSION=$(git tag -l "v2*" --sort=-version:refname | head -n 1)
LAST_VERSION=$(git tag -l "v2*" --sort=-version:refname | head -n 2 | awk 'NR == 2 { print $1 }')
echo "Current version: $CURRENT_VERSION"
echo "Previous version: $LAST_VERSION"
echo "current_version=$(echo $CURRENT_VERSION)" >> $GITHUB_ENV
echo "last_version=$(echo $LAST_VERSION)" >> $GITHUB_ENV
echo "current_monorepo_version=$(echo $CURRENT_VERSION)" >> $GITHUB_ENV
echo "last_monorepo_version=$(echo $LAST_VERSION)" >> $GITHUB_ENV
echo "DATE=$(date)" >> $GITHUB_ENV
- name: Create GitHub Releases v2
id: create_release_v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm run release:github -- --base=$last_version --head=$current_version
npm run release:github -- --base=${{ env.last_monorepo_version }} --head=${{ env.current_monorepo_version }}
- name: Create pull request into develop v2
uses: repo-sync/pull-request@v2
with:
source_branch: 'master-v2'
destination_branch: 'develop-v2'
github_token: ${{ secrets.PAT }}
pr_title: 'chore(release): pulling master-v2 into develop-v2 post release v${{ steps.extract-version.outputs.release_version }}'
pr_title: 'chore(release): pulling master-v2 into develop-v2 post release v${{ steps.extract-version-v2.outputs.release_version }}'
pr_body: ':crown: *An automated PR*'
pr_reviewer: 'itsdebs'

Expand Down Expand Up @@ -131,7 +121,7 @@ jobs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Release: <${{env.RELEASES_URL}}${{ steps.extract-previous-version.outputs.previous_version }}...v${{ steps.extract-version.outputs.release_version }}|v${{ steps.extract-version.outputs.release_version }}>*\n${{ env.DATE }}"
"text": "*Release: <${{env.RELEASES_URL}}${{ env.last_monorepo_version }}...v${{steps.extract-version-v2.outputs.release_version }}|v${{ steps.extract-version-v2.outputs.release_version }}>*\n${{ env.DATE }}"
}
}
]
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/release-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ on:
- master-v2
types:
- closed
workflow_dispatch:
jobs:
release-v2:
if: (startsWith(github.event.pull_request.head.ref, 'release-v2/') || startsWith(github.event.pull_request.head.ref, 'hotfix-release-v2/')) && github.event.pull_request.merged == true # only merged pull requests must trigger this job
if: (${{ github.event_name == 'workflow_dispatch' }} && startsWith(github.ref, 'refs/heads/master-v2')) || ((startsWith(github.event.pull_request.head.ref, 'release-v2/') || startsWith(github.event.pull_request.head.ref, 'hotfix-release-v2/')) && github.event.pull_request.merged == true) # only merged pull requests must trigger this job
runs-on: ubuntu-latest
environment: deployment
steps:
Expand Down Expand Up @@ -48,19 +49,20 @@ jobs:
- name: Get the two latest versions
run: |
CURRENT_VERSION=$(git tag -l "v*" --sort=-version:refname | head -n 1)
LAST_VERSION=$(git tag -l "v*" --sort=-version:refname | head -n 2 | awk 'NR == 2 { print $1 }')
CURRENT_VERSION=$(git tag -l "v2*" --sort=-version:refname | head -n 1)
LAST_VERSION=$(git tag -l "v2*" --sort=-version:refname | head -n 2 | awk 'NR == 2 { print $1 }')
echo "Current version: $CURRENT_VERSION"
echo "Previous version: $LAST_VERSION"
echo "current_version=$(echo $CURRENT_VERSION)" >> $GITHUB_ENV
echo "last_version=$(echo $LAST_VERSION)" >> $GITHUB_ENV
echo "current_monorepo_version=$(echo $CURRENT_VERSION)" >> $GITHUB_ENV
echo "last_monorepo_version=$(echo $LAST_VERSION)" >> $GITHUB_ENV
echo "DATE=$(date)" >> $GITHUB_ENV
- name: Publish release to sonatype
run: |
git fetch --no-tags --prune --depth=100 origin master-v2
npm run release:sonatype -- --base=$last_version --head=$current_version
npm run release:sonatype -- --base=${{ env.last_monorepo_version }} --head=${{ env.current_monorepo_version }}
env:
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rudderstack/rudder-sdk-android-monorepo",
"version": "2.4.0",
"version": "2.5.0",
"description": "Rudder Android SDK monorepo",
"keywords": [
"android",
Expand Down
7 changes: 7 additions & 0 deletions repository/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [0.2.2](https://github.com/rudderlabs/rudder-sdk-android/compare/[email protected]@0.2.2) (2023-10-31)


### Bug Fixes

* added discard policy ([#347](https://github.com/rudderlabs/rudder-sdk-android/issues/347)) ([94714ab](https://github.com/rudderlabs/rudder-sdk-android/commit/94714ab35195a609746d639e20a121a705216ca1))

## 0.2.1 (2023-10-04)

### Bug Fixes
Expand Down
5 changes: 3 additions & 2 deletions repository/CHANGELOG_LATEST.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 0.2.1 (2023-10-04)
## [0.2.2](https://github.com/rudderlabs/rudder-sdk-android/compare/[email protected]@0.2.2) (2023-10-31)


### Bug Fixes
* table not found in database. added locks ([#326](https://github.com/rudderlabs/rudder-sdk-android/issues/326)) ([1b5e670](https://github.com/rudderlabs/rudder-sdk-android/commit/1b5e670d5b10fe640099dc11353ae746ea6035b0))

* added discard policy ([#347](https://github.com/rudderlabs/rudder-sdk-android/issues/347)) ([94714ab](https://github.com/rudderlabs/rudder-sdk-android/commit/94714ab35195a609746d639e20a121a705216ca1))

4 changes: 2 additions & 2 deletions repository/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ GROUP=com.rudderstack.android.sdk
POM_PACKAGING=aar
android.enableJetifier=true
android.useAndroidX=true
VERSION_CODE=3
VERSION_NAME=0.2.1
VERSION_CODE=4
VERSION_NAME=0.2.2
POM_NAME=ORM library by RudderStack for android
POM_DESCRIPTION=ORM library used in Rudderstack SDK Version 2 for android
2 changes: 1 addition & 1 deletion repository/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "repository",
"version": "0.2.1",
"version": "0.2.2",
"description": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down
4 changes: 2 additions & 2 deletions repository/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"github": {
"executor": "@jscutlery/semver:github",
"options": {
"title": "[email protected].1",
"tag": "[email protected].1",
"title": "[email protected].2",
"tag": "[email protected].2",
"notesFile": "./repository/CHANGELOG_LATEST.md"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ import android.database.sqlite.SQLiteOpenHelper
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
import java.util.concurrent.SynchronousQueue
import java.util.concurrent.ThreadPoolExecutor
import java.util.concurrent.TimeUnit


/**
* Singleton class to act as the Database helper
Expand Down Expand Up @@ -65,7 +69,13 @@ object RudderDatabase {
databaseCreatedCallback: ((SQLiteDatabase?) -> Unit)? = null,
databaseUpgradeCallback: ((SQLiteDatabase?, oldVersion: Int, newVersion: Int) -> Unit)? = null
) {
commonExecutor = executorService ?: Executors.newCachedThreadPool()
commonExecutor = executorService ?: ThreadPoolExecutor(
0,
Int.MAX_VALUE,
60L,
TimeUnit.SECONDS,
SynchronousQueue(), ThreadPoolExecutor.DiscardPolicy()
);
this.entityFactory = entityFactory
if (sqliteOpenHelper != null)
return
Expand Down
12 changes: 12 additions & 0 deletions rudderreporter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).

## [0.4.0](https://github.com/rudderlabs/rudder-sdk-android/compare/[email protected]@0.4.0) (2023-10-31)


### Features

* added os version to labels ([#348](https://github.com/rudderlabs/rudder-sdk-android/issues/348)) ([0e6aaf1](https://github.com/rudderlabs/rudder-sdk-android/commit/0e6aaf13407dd0601026f216b1fe662f8f9db46b))


### Bug Fixes

* added jvm overloads ([#353](https://github.com/rudderlabs/rudder-sdk-android/issues/353)) ([0cd4d5d](https://github.com/rudderlabs/rudder-sdk-android/commit/0cd4d5d9de4b465a55b87dabfa3caccc78aa40f1))

## [0.3.1](https://github.com/rudderlabs/rudder-sdk-android/compare/[email protected]@0.3.1) (2023-10-16)


Expand Down
4 changes: 2 additions & 2 deletions rudderreporter/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ GROUP=com.rudderstack.android.sdk
POM_PACKAGING=aar
android.enableJetifier=true
android.useAndroidX=true
VERSION_CODE=4
VERSION_NAME=0.3.1
VERSION_CODE=5
VERSION_NAME=0.4.0
POM_NAME=Rudderstack Stats Collection library for android
POM_DESCRIPTION=Rudderstack Stats Collection library for android
2 changes: 1 addition & 1 deletion rudderreporter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rudderreporter",
"version": "0.3.1",
"version": "0.4.0",
"description": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@

package com.rudderstack.android.ruddermetricsreporterandroid

import android.os.Build
import com.fasterxml.jackson.annotation.JsonProperty
import com.google.gson.annotations.SerializedName
import com.rudderstack.rudderjsonadapter.JsonAdapter
import com.squareup.moshi.Json

data class LibraryMetadata(
data class LibraryMetadata @JvmOverloads constructor(
@get:JsonProperty("name")
@SerializedName("name")
@Json(name = "name")
Expand All @@ -35,7 +36,11 @@ data class LibraryMetadata(
@get:JsonProperty("write_key")
@SerializedName("write_key")
@Json(name = "write_key")
val writeKey: String
val writeKey: String,
@get:JsonProperty("os_version")
@SerializedName("os_version")
@Json(name = "os_version")
val osVersion: String = Build.VERSION.SDK_INT.toString()
) : JSerialize<LibraryMetadata> {
override fun serialize(jsonAdapter: JsonAdapter): String? {
return jsonAdapter.writeToJson(this)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class ErrorModel(
"notifier" to mapOf(
"name" to libraryMetadata.name,
"version" to libraryMetadata.sdkVersion,
"url" to "https://github.com/rudderlabs/rudder-sdk-android"
"url" to "https://github.com/rudderlabs/rudder-sdk-android",
"os_version" to libraryMetadata.osVersion
)
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package com.rudderstack.android.ruddermetricsreporterandroid

import android.os.Build
import com.rudderstack.android.ruddermetricsreporterandroid.internal.DefaultUploaderTestGson
import com.rudderstack.android.ruddermetricsreporterandroid.internal.DefaultUploaderTestJackson
import com.rudderstack.android.ruddermetricsreporterandroid.internal.DefaultUploaderTestMoshi
Expand All @@ -33,7 +34,15 @@ abstract class LibraryMetadataTest {
fun serialize() {
val libraryMetadata = LibraryMetadata("test","1.0","4","abcde")
val json = libraryMetadata.serialize(jsonAdapter)
assertEquals("{\"name\":\"test\",\"sdk_version\":\"1.0\",\"version_code\":\"4\",\"write_key\":\"abcde\"}",json)
assertEquals("{\"name\":\"test\",\"sdk_version\":\"1.0\",\"version_code\":\"4\"," +
"\"write_key\":\"abcde\",\"os_version\":\"${Build.VERSION.SDK_INT}\"}",json)
}
@Test
fun `serialize with version`() {
val libraryMetadata = LibraryMetadata("test","1.0","4","abcde", "[14]")
val json = libraryMetadata.serialize(jsonAdapter)
assertEquals("{\"name\":\"test\",\"sdk_version\":\"1.0\",\"version_code\":\"4\"," +
"\"write_key\":\"abcde\",\"os_version\":\"[14]\"}",json)
}
}
class LibraryMetadataTestGson : LibraryMetadataTest() {
Expand Down

0 comments on commit f04b894

Please sign in to comment.