Skip to content

Commit

Permalink
MOEN-31729: Publish Plugin Integration (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishek-engg-mobilesdk committed Aug 14, 2024
1 parent 4e6d7e7 commit 54c7c0e
Show file tree
Hide file tree
Showing 12 changed files with 90 additions and 98 deletions.
33 changes: 26 additions & 7 deletions .github/workflows/pull_request_verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,48 @@ on:
types: [ opened, reopened, ready_for_review, synchronize ]
branches: [ "development", "master" ]

env:
ORG_GRADLE_PROJECT_oss_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_oss_mavenCentralUsername }}
ORG_GRADLE_PROJECT_oss_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_oss_mavenCentralPassword }}
ORG_GRADLE_PROJECT_profileId: ${{ secrets.ORG_GRADLE_PROJECT_profileId }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKey }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKeyId }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKeyPassword }}

jobs:
assemble-verification:
environment: publishing_gradle_config
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
strategy:
fail-fast: true
steps:
- name: Checkout sdk automation scripts
uses: actions/checkout@v3
with:
repository: moengage/sdk-automation-scripts
path: sdk-automation-scripts
token: ${{ secrets.SDK_BOT_ACCESS_TOKEN }}
- name: Automation script setup
uses: ./sdk-automation-scripts/actions/android-repository-setup
- name: Checkout code
uses: actions/checkout@v3
with:
path: source
fetch-depth: 0
fetch-tags: true
token: ${{ secrets.SDK_BOT_ACCESS_TOKEN }}
- name: Set up repository
working-directory: source
run: |
echo segmentWriteKey="Dummy Segment Key" >> ./local.properties
echo moengageWorkspaceId="Dummy MoEngage Key" >> ./local.properties
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- name: Set up gradle cache
uses: gradle/gradle-build-action@v2
- name: Build project
working-directory: source
run: ./gradlew assemble
- name: Unit test
working-directory: source
run: ./gradlew test
- name: Ktlint check
working-directory: source
run: ./gradlew ktlintcheck
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release

on:
workflow_dispatch:

jobs:
release:
environment: publishing_gradle_config
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- name: Checkout sdk automation scripts
uses: actions/checkout@v3
with:
repository: moengage/sdk-automation-scripts
path: sdk-automation-scripts
token: ${{ secrets.SDK_BOT_ACCESS_TOKEN }}
- name: Automation script setup
uses: ./sdk-automation-scripts/actions/android-repository-setup
- name: Checkout code
uses: actions/checkout@v3
with:
path: source
fetch-depth: 0
fetch-tags: true
token: ${{ secrets.SDK_BOT_ACCESS_TOKEN }}
- name: Release Catalog
working-directory: source
env:
ORG_GRADLE_PROJECT_oss_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_oss_mavenCentralUsername }}
ORG_GRADLE_PROJECT_oss_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_oss_mavenCentralPassword }}
ORG_GRADLE_PROJECT_profileId: ${{ secrets.ORG_GRADLE_PROJECT_profileId }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKey }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKeyId }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKeyPassword }}
run: |
kotlinc -script ../sdk-automation-scripts/scripts/release/segment-release.main.kts
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# moengage-segment-kotlin-destination

# Next Release

## Next version
- Integration MoEngage release plugin

# 31-07-2024

## 2.3.0
Expand Down
11 changes: 4 additions & 7 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
### Releasing
# Release Process

1. Change the version name in `gradle.properties`.(version name- X.Y.Z)
2. Update the `CHANGELOG.md` for the impending release.
3. Run the following command `./gradlew moengage-segment-integration:publish --no-daemon --no-parallel`
4. `git commit -am "Prepare for release X.Y.Z."` (where X.Y.Z is the new version)
5. `git tag -a X.Y.Z -m "Version X.Y.Z"` (where X.Y.Z is the new version)
6. `git push && git push --tags`
- Merge all the releasing changes into `development`
- Update the `moe-android-sdk` and `android-dependency-catalog-internal` version in `development`
- Push the changes to remote and run the release action on `development` branch
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ plugins {
alias(libs.plugins.plugin.google.play.service) apply false
alias(moengageInternal.plugins.plugin.kotlin.serialization) apply false
alias(moengageInternal.plugins.plugin.ktlint) apply false
alias(moengageInternal.plugins.plugin.release) apply false
}

subprojects {
Expand Down
21 changes: 12 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ android.useAndroidX=true
android.nonTransitiveRClass=true

GROUP=com.moengage
# POM meta-data
PROJECT_URL=https://github.com/moengage/moengage-segment-integration

SCM_CONNECTION=scm:git@github.com:moengage/moengage-segment-integration.git
SCM_DEV_CONNECTION=scm:git@github.com:moengage/moengage-segment-integration.git

LICENCE_NAME=The MIT License (MIT)
LICENCE_URL=https://opensource.org/licenses/MIT
# POM meta-data
POM_URL=https://github.com/moengage/moengage-segment-integration
POM_LICENCE_NAME=The MIT License (MIT)
POM_LICENCE_URL=https://opensource.org/licenses/MIT
POM_SCM_URL=https\://moengage.com
POM_SCM_CONNECTION=scm:git@github.com:moengage/moengage-segment-integration.git
POM_SCM_DEV_CONNECTION=scm:git@github.com:moengage/moengage-segment-integration.git
POM_DEVELOPER_ID=moengage
POM_DEVELOPER_NAME=MoEngage

DEVELOPER_ID=moengage
DEVELOPER_NAME=MoEngage
# Release Configuration
HOST=OSS_PORTAL
IN_MEMORY_SIGNING=true
2 changes: 0 additions & 2 deletions moengage-segment-integration/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ plugins {
alias(moengageInternal.plugins.plugin.kotlin.android)
}

apply(from = "../scripts/gradle/release.gradle")

val libVersionName = project.findProperty("VERSION_NAME") as String

android {
Expand Down
2 changes: 1 addition & 1 deletion moengage-segment-integration/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARTIFACT_NAME=moengage-segment-integration
NAME=MoEngage Segment Integration
DESCRIPTION=MoEngage-Segment Bundled integration
POM_DESCRIPTION=MoEngage-Segment Bundled integration
VERSION_NAME=6.5.8
3 changes: 1 addition & 2 deletions moengage-segment-kotlin-destination/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ plugins {
alias(moengageInternal.plugins.plugin.android.lib)
alias(moengageInternal.plugins.plugin.kotlin.android)
alias(moengageInternal.plugins.plugin.kotlin.serialization)
alias(moengageInternal.plugins.plugin.release)
}

apply(from = "../scripts/gradle/release.gradle")

val libVersionName = project.findProperty("VERSION_NAME") as String

android {
Expand Down
2 changes: 1 addition & 1 deletion moengage-segment-kotlin-destination/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARTIFACT_NAME=moengage-segment-kotlin-destination
NAME=MoEngage Segment Kotlin Destination
DESCRIPTION=MoEngage-Segment Kotlin Destination
POM_DESCRIPTION=MoEngage-Segment Kotlin Destination
VERSION_NAME=2.3.0
68 changes: 0 additions & 68 deletions scripts/gradle/release.gradle

This file was deleted.

2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencyResolutionManagement {
}
versionCatalogs {
create("moengageInternal") {
from("com.moengage:android-dependency-catalog-internal:2.1.0")
from("com.moengage:android-dependency-catalog-internal:2.1.1")
}
create("moengage") {
from("com.moengage:android-dependency-catalog:4.4.0")
Expand Down

0 comments on commit 54c7c0e

Please sign in to comment.