Skip to content

Commit b22d86a

Browse files
authored
Merge pull request #62 from middleware-labs/sourcemap-plugin
art: updated gradle jobs
2 parents 30a71f7 + 6141af7 commit b22d86a

4 files changed

Lines changed: 41 additions & 75 deletions

File tree

.github/workflows/publish-sourcemap-plugin.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ jobs:
2929

3030
- name: Publish Sourcemap Plugin
3131
run: |
32-
echo "Publishing plugin ${{ github.event.inputs.versionName }}🚀🚀"
33-
./gradlew :sourcemap-plugin:publish --no-daemon
34-
echo "Published✅"
32+
echo "Publishing plugin ${{ github.event.inputs.versionName }} 🚀"
33+
./gradlew :sourcemap-plugin:publishAndReleaseToMavenCentral --no-daemon
34+
echo "Published ✅"
3535
env:
3636
ORG_GRADLE_PROJECT_VERSION_NAME: ${{ github.event.inputs.versionName }}
3737
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
3838
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
3939
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET }}
4040
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.GPG_ID }}
41-
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSWORD }}
41+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSWORD }}

.github/workflows/publish.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@v4.1.1
16-
- name: Set up Java 17 for running Gradle
16+
17+
- name: Set up Java 17
1718
uses: actions/setup-java@v3.13.0
1819
with:
1920
distribution: temurin
@@ -22,16 +23,11 @@ jobs:
2223
- name: Grant Permission to Execute Gradle
2324
run: chmod +x gradlew
2425

25-
- name: Build with Gradle
26-
uses: gradle/gradle-build-action@v2
27-
with:
28-
arguments: build
29-
3026
- name: Publish Library
3127
run: |
32-
echo "Publishing library🚀"
33-
./gradlew publishToMavenCentral
34-
echo "Published✅"
28+
echo "Publishing library ${{ github.event.inputs.versionName }} 🚀"
29+
./gradlew :sdk:publishAndReleaseToMavenCentral --no-daemon --no-configuration-cache
30+
echo "Published ✅"
3531
env:
3632
ORG_GRADLE_PROJECT_VERSION_NAME: ${{ github.event.inputs.versionName }}
3733
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
@@ -58,5 +54,5 @@ jobs:
5854
- name: Create Release
5955
uses: mikepenz/action-gh-release@v0.2.0-a03
6056
with:
61-
body: ${{steps.github_release.outputs.changelog}}
57+
body: ${{ steps.github_release.outputs.changelog }}
6258
tag_name: ${{ github.event.inputs.versionName }}

sdk/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ plugins {
44
}
55

66
mavenPublishing {
7-
publishToMavenCentral(true)
7+
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)
88
signAllPublications()
99

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

1213
pom {
1314
name = "Middleware Android RUM SDK"
@@ -35,6 +36,7 @@ mavenPublishing {
3536
}
3637
}
3738
}
39+
3840
android {
3941
namespace 'io.middleware.android.sdk'
4042
compileSdk 36

sourcemap-plugin/build.gradle

Lines changed: 27 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
plugins {
22
id 'groovy'
33
id 'java-gradle-plugin'
4-
id 'maven-publish'
5-
id 'signing'
4+
id 'com.vanniktech.maven.publish' version '0.34.0'
65
}
76

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

12-
java {
13-
withSourcesJar()
14-
withJavadocJar()
15-
}
16-
1710
dependencies {
1811
compileOnly 'com.android.tools.build:gradle:8.3.0'
1912
implementation localGroovy()
@@ -28,66 +21,41 @@ gradlePlugin {
2821
}
2922
}
3023

31-
publishing {
32-
publications {
33-
maven(MavenPublication) {
34-
from components.java
35-
artifactId = 'middleware-sourcemap-gradle-plugin'
24+
mavenPublishing {
25+
// Publishes to Maven Central via the new portal
26+
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)
27+
28+
// Signs with in-memory key from CI env
29+
signAllPublications()
3630

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

42-
licenses {
43-
license {
44-
name = 'The Apache License, Version 2.0'
45-
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
46-
}
47-
}
48-
developers {
49-
developer {
50-
id = 'middleware-labs'
51-
name = 'Middleware Team'
52-
email = 'support@middleware.io'
53-
}
54-
}
55-
scm {
56-
connection = 'scm:git:git://github.com/middleware-labs/middleware-android.git'
57-
developerConnection = 'scm:git:ssh://github.com/middleware-labs/middleware-android.git'
58-
url = 'https://github.com/middleware-labs/middleware-android'
59-
}
33+
pom {
34+
name = 'Middleware Sourcemap Gradle Plugin'
35+
description = 'Gradle plugin for uploading R8/ProGuard mapping files to Middleware'
36+
url = 'https://github.com/middleware-labs/middleware-android'
37+
38+
licenses {
39+
license {
40+
name = 'The Apache License, Version 2.0'
41+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
6042
}
6143
}
62-
}
63-
64-
repositories {
65-
maven {
66-
name = "OSSRH"
67-
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
68-
credentials {
69-
// These now map correctly to ORG_GRADLE_PROJECT_mavenCentralUsername / Password
70-
username = project.findProperty('mavenCentralUsername') ?: ''
71-
password = project.findProperty('mavenCentralPassword') ?: ''
44+
developers {
45+
developer {
46+
id = 'middleware-labs'
47+
name = 'Middleware Team'
48+
email = 'support@middleware.io'
7249
}
7350
}
51+
scm {
52+
connection = 'scm:git:git://github.com/middleware-labs/middleware-android.git'
53+
developerConnection = 'scm:git:ssh://github.com/middleware-labs/middleware-android.git'
54+
url = 'https://github.com/middleware-labs/middleware-android'
55+
}
7456
}
7557
}
7658

77-
signing {
78-
def signingKey = project.findProperty('signingInMemoryKey')
79-
def signingKeyId = project.findProperty('signingInMemoryKeyId')
80-
def signingPassword = project.findProperty('signingInMemoryKeyPassword')
81-
82-
// Use in-memory ASCII-armored key (no gpg keyring needed on CI)
83-
if (signingKey) {
84-
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
85-
}
86-
87-
required { signingKey != null && gradle.taskGraph.hasTask("publish") }
88-
sign publishing.publications.maven
89-
}
90-
9159
tasks.named('processResources') {
9260
duplicatesStrategy = DuplicatesStrategy.INCLUDE
9361
}

0 commit comments

Comments
 (0)