Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/publish-sourcemap-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ jobs:

- name: Publish Sourcemap Plugin
run: |
echo "Publishing plugin ${{ github.event.inputs.versionName }}🚀🚀"
./gradlew :sourcemap-plugin:publish --no-daemon
echo "Published✅"
echo "Publishing plugin ${{ github.event.inputs.versionName }} 🚀"
./gradlew :sourcemap-plugin:publishAndReleaseToMavenCentral --no-daemon
echo "Published ✅"
env:
ORG_GRADLE_PROJECT_VERSION_NAME: ${{ github.event.inputs.versionName }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.GPG_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSWORD }}
16 changes: 6 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:

steps:
- uses: actions/checkout@v4.1.1
- name: Set up Java 17 for running Gradle

- name: Set up Java 17
uses: actions/setup-java@v3.13.0
with:
distribution: temurin
Expand All @@ -22,16 +23,11 @@ jobs:
- name: Grant Permission to Execute Gradle
run: chmod +x gradlew

- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build

- name: Publish Library
run: |
echo "Publishing library🚀"
./gradlew publishToMavenCentral
echo "Published✅"
echo "Publishing library ${{ github.event.inputs.versionName }} 🚀"
./gradlew :sdk:publishAndReleaseToMavenCentral --no-daemon --no-configuration-cache
echo "Published ✅"
env:
ORG_GRADLE_PROJECT_VERSION_NAME: ${{ github.event.inputs.versionName }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
Expand All @@ -58,5 +54,5 @@ jobs:
- name: Create Release
uses: mikepenz/action-gh-release@v0.2.0-a03
with:
body: ${{steps.github_release.outputs.changelog}}
body: ${{ steps.github_release.outputs.changelog }}
tag_name: ${{ github.event.inputs.versionName }}
6 changes: 4 additions & 2 deletions sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ plugins {
}

mavenPublishing {
publishToMavenCentral(true)
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)
signAllPublications()

coordinates("io.github.middleware-labs", "android-sdk", "2.0.16")
// Reads ORG_GRADLE_PROJECT_VERSION_NAME injected by CI
coordinates("io.github.middleware-labs", "android-sdk", project.findProperty("VERSION_NAME") ?: "2.0.16")

pom {
name = "Middleware Android RUM SDK"
Expand Down Expand Up @@ -35,6 +36,7 @@ mavenPublishing {
}
}
}

android {
namespace 'io.middleware.android.sdk'
compileSdk 36
Expand Down
86 changes: 27 additions & 59 deletions sourcemap-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
plugins {
id 'groovy'
id 'java-gradle-plugin'
id 'maven-publish'
id 'signing'
id 'com.vanniktech.maven.publish' version '0.34.0'
}

group = 'io.middleware'
// Read version from ORG_GRADLE_PROJECT_VERSION_NAME env var injected by CI
version = project.findProperty('VERSION_NAME') ?: '1.0.0'

java {
withSourcesJar()
withJavadocJar()
}

dependencies {
compileOnly 'com.android.tools.build:gradle:8.3.0'
implementation localGroovy()
Expand All @@ -28,66 +21,41 @@ gradlePlugin {
}
}

publishing {
publications {
maven(MavenPublication) {
from components.java
artifactId = 'middleware-sourcemap-gradle-plugin'
mavenPublishing {
// Publishes to Maven Central via the new portal
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)

// Signs with in-memory key from CI env
signAllPublications()

pom {
name = 'Middleware Sourcemap Gradle Plugin'
description = 'Gradle plugin for uploading R8/ProGuard mapping files to Middleware'
url = 'https://github.com/middleware-labs/middleware-android'
coordinates('io.middleware', 'middleware-sourcemap-gradle-plugin', version.toString())

licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'middleware-labs'
name = 'Middleware Team'
email = 'support@middleware.io'
}
}
scm {
connection = 'scm:git:git://github.com/middleware-labs/middleware-android.git'
developerConnection = 'scm:git:ssh://github.com/middleware-labs/middleware-android.git'
url = 'https://github.com/middleware-labs/middleware-android'
}
pom {
name = 'Middleware Sourcemap Gradle Plugin'
description = 'Gradle plugin for uploading R8/ProGuard mapping files to Middleware'
url = 'https://github.com/middleware-labs/middleware-android'

licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
}

repositories {
maven {
name = "OSSRH"
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
// These now map correctly to ORG_GRADLE_PROJECT_mavenCentralUsername / Password
username = project.findProperty('mavenCentralUsername') ?: ''
password = project.findProperty('mavenCentralPassword') ?: ''
developers {
developer {
id = 'middleware-labs'
name = 'Middleware Team'
email = 'support@middleware.io'
}
}
scm {
connection = 'scm:git:git://github.com/middleware-labs/middleware-android.git'
developerConnection = 'scm:git:ssh://github.com/middleware-labs/middleware-android.git'
url = 'https://github.com/middleware-labs/middleware-android'
}
}
}

signing {
def signingKey = project.findProperty('signingInMemoryKey')
def signingKeyId = project.findProperty('signingInMemoryKeyId')
def signingPassword = project.findProperty('signingInMemoryKeyPassword')

// Use in-memory ASCII-armored key (no gpg keyring needed on CI)
if (signingKey) {
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
}

required { signingKey != null && gradle.taskGraph.hasTask("publish") }
sign publishing.publications.maven
}

tasks.named('processResources') {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
Loading