Skip to content

Commit b0735fd

Browse files
[Feat][SDK- 471] Update publishing (#342)
* build: update gradle from 6.9.4 to 8.14.3 * build: update quality gradle files * build: update agp from 4.2.2 to 7.4.2 * build: update scala from 2.12.4 to 2.13.14 * build: update spring boot and spring dependency management * build: update revapi from 1.4.4 to 1.8.0 * build: update nebula integration testing plugin from 3.4.0 to 10.0.1 * build: bumpt agp from 7.4.2 to 8.6.0 * build: add vanniktech plugin (skip Android for the moment because agp is not applied yet) * build: update build.gradle groovy to kotlin * build: add version catalog and update settings.gradle to kotlin * build: replace release.gradle with publish convention plugin * build: update android build.gradle to kotlin * build: update ci * build: skip Android quality check for now * build: register agp in root build.gradle.kts to prevent agp not found from vanniktech * build(rollbar-java): migrate build.gradle to Kotlin and fix failing CI * build(rollbar-java): update canonical path for generated code * build(rollbar-java): declare inputs so Gradle knows when to rerun the task * build: update mokito to 5.18.0 and fix Java tests * test: fix failing test in Java 17 * build: use kotlin for rollbar-reactive-streams gradle, update testng to v7.10.2 and use mockito-core v5.13.0 * test: fix failing tests from mockito update * build: add JVM flag for BlockHound test tasks on JDK 13+ * build: add flag only in Java 17 * test: fix failing test * build(android): remove package from manifests, is deprecated in AGP 8+ * build(android-example): fix namespace misspelling * build: add Gradle JVM option to increase MetaspaceSize and heap in CI and locally * build: use Vanniktech plugin for release * build: fix release missing coordinates and add android.quality.gradle * build: skip android.quality.gradle for now * doc: update CHANGELOG for v 2.1.0-alpha.1 * update version to 2.1.0-alpha.1 and run release from branch to test publishing * build: fix signing publication * build: update signing * revert: do not release from this PR branch * fix: publish without manual confirmation in maven central --------- Co-authored-by: chris <[email protected]>
1 parent 6a72e7b commit b0735fd

File tree

32 files changed

+595
-599
lines changed

32 files changed

+595
-599
lines changed

.github/scripts/release.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,7 @@ elif [[ -z $VERSION ]]; then
3838
elif ! [[ $VERSION =~ $SEMVER_REGEX ]]; then
3939
echo "Skipping release. Bad version used."
4040
else
41-
42-
if [[ ${BASH_REMATCH[5]} == 'SNAPSHOT' ]]; then
43-
echo "Doing SNAPSHOT release..."
44-
./gradlew -Dorg.gradle.internal.http.socketTimeout=300000 -Dorg.gradle.internal.http.connectionTimeout=300000 publishToSonatype
45-
else
46-
echo "Doing release..."
47-
./gradlew -Dorg.gradle.internal.http.socketTimeout=300000 -Dorg.gradle.internal.http.connectionTimeout=300000 publishToSonatype closeAndReleaseRepository
48-
fi
41+
echo "Doing release with Vanniktech Maven Publish plugin..."
42+
./gradlew publishAndReleaseToMavenCentral --no-daemon --stacktrace
4943
echo "Release done!"
5044
fi

.github/workflows/ci.yml

Lines changed: 56 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ on:
66
required: true
77
RELEASE_GPG_PRIVATE_KEY_PASSPHRASE:
88
required: true
9-
NEXUS_USERNAME:
9+
MAVENCENTRAL_USERNAME:
1010
required: true
11-
NEXUS_PASSWORD:
11+
MAVENCENTRAL_PASSWORD:
1212
required: true
1313
push:
1414
branches: [ master ]
@@ -33,7 +33,7 @@ jobs:
3333
matrix:
3434
# Must upgrade Gradle before we can go past Java 15 here.
3535
# https://docs.gradle.org/current/userguide/compatibility.html
36-
java: [ 8, 11 ]
36+
java: [ 11, 17 ]
3737
steps:
3838
- uses: actions/checkout@v4
3939

@@ -60,7 +60,7 @@ jobs:
6060
echo ANDROID_SDK_ROOT: ${ANDROID_SDK_ROOT}
6161
6262
- name: Build
63-
run: ./gradlew clean build
63+
run: ./gradlew clean build --no-daemon
6464

6565
- name: Upload build reports
6666
if: always()
@@ -70,39 +70,74 @@ jobs:
7070
path: |
7171
**/build/reports/*
7272
73+
build-android:
74+
runs-on: ubuntu-22.04
75+
name: Build Android module with Java 17
76+
needs: [ validation ]
77+
steps:
78+
- uses: actions/checkout@v4
79+
- name: Fetch git tags
80+
run: ./.github/scripts/fetch_to_tag.sh
81+
82+
- name: Set up Java 17
83+
uses: actions/setup-java@v4
84+
with:
85+
java-version: 17
86+
distribution: 'zulu'
87+
cache: 'gradle'
88+
89+
- name: Install Android SDK
90+
run: |
91+
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "platforms;android-33" "build-tools;34.0.0"
92+
93+
- name: Build Android module
94+
run: ./gradlew :rollbar-android:build
95+
96+
- name: Upload Android build reports
97+
if: always()
98+
uses: actions/upload-artifact@v4
99+
with:
100+
name: android-java17-build-reports
101+
path: |
102+
**/build/reports/*
103+
73104
release:
74105
runs-on: ubuntu-22.04
75106
name: Release
76107
# It would be nice to run this as part of the build job, since it would be
77108
# faster and have less duplicated Yaml, it would not be possible to check
78109
# for all matrix results before publishing if this were just another step
79110
# in that job.
80-
needs: [ build ]
111+
needs: [ build, build-android ]
81112
steps:
82113
- uses: actions/checkout@v4
83114

84-
- name: Set up Java 11 for the Android SDK Manager
85-
uses: actions/setup-java@v1
115+
- name: Set up Java 17 for Android
116+
uses: actions/setup-java@v4
86117
with:
87-
java-version: 11
118+
java-version: 17
119+
distribution: 'zulu'
120+
cache: 'gradle'
88121

89122
- name: Install Android SDK
90123
run: |
91-
echo "Android SDK Manager version: `${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --version`"
92-
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "platforms;android-27" "build-tools;28.0.3"
124+
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "platforms;android-33" "build-tools;34.0.0"
93125
94-
- name: Set up Java 8 for the build
95-
uses: actions/setup-java@v4
96-
with:
97-
java-version: 8
98-
distribution: 'zulu'
99-
cache: 'gradle'
126+
- name: Import GPG key file
127+
run: |
128+
mkdir -p ~/.gradle
129+
echo "${{ secrets.RELEASE_GPG_SECRING_BASE_64 }}" | base64 --decode > ~/.gradle/secring.gpg
130+
131+
- name: Configure Gradle properties
132+
run: |
133+
cat <<EOF >> ~/.gradle/gradle.properties
134+
mavenCentralUsername=${{ secrets.MAVENCENTRAL_USERNAME }}
135+
mavenCentralPassword=${{ secrets.MAVENCENTRAL_PASSWORD }}
136+
signing.password=${{ secrets.RELEASE_GPG_PRIVATE_KEY_PASSPHRASE }}
137+
signing.keyId=${{ secrets.RELEASE_GPG_KEY_ID }}
138+
signing.secretKeyRingFile=/home/runner/.gradle/secring.gpg
139+
EOF
100140
101141
- name: Release
102-
env:
103-
RELEASE_GPG_PRIVATE_KEY: ${{ secrets.RELEASE_GPG_PRIVATE_KEY }}
104-
RELEASE_GPG_PRIVATE_KEY_PASSPHRASE: ${{ secrets.RELEASE_GPG_PRIVATE_KEY_PASSPHRASE }}
105-
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
106-
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
107142
run: |
108143
./.github/scripts/release.sh

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Change Log
22

3+
# 2.1.0-alpha.1
4+
5+
### Build
6+
- Solve security issues in native agent [#328](https://github.com/rollbar/rollbar-java/pull/328)
7+
- Bump android target sdk to 33 [#339](https://github.com/rollbar/rollbar-java/pull/339)
8+
9+
### Feat
10+
- Add threads information to payload [#327](https://github.com/rollbar/rollbar-java/pull/327)
11+
- Add ANR report [#323](https://github.com/rollbar/rollbar-java/pull/323)
12+
313
# 2.0.0
414

515
- Switching to full release
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
plugins {
2+
`kotlin-dsl`
3+
}
4+
5+
group = "com.rollbar.buildlogic"
6+
7+
repositories {
8+
gradlePluginPortal()
9+
mavenCentral()
10+
}
11+
12+
dependencies {
13+
implementation("com.vanniktech:gradle-maven-publish-plugin:0.34.0")
14+
}
15+
16+
gradlePlugin {
17+
plugins {
18+
create("rollbar-release-plugin") {
19+
id = "com.rollbar.conventions.release"
20+
implementationClass = "RollbarPublishPlugin"
21+
}
22+
}
23+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import com.vanniktech.maven.publish.MavenPublishBaseExtension
2+
import org.gradle.api.Plugin
3+
import org.gradle.api.Project
4+
5+
class RollbarPublishPlugin : Plugin<Project> {
6+
override fun apply(project: Project) {
7+
8+
project.pluginManager.withPlugin("com.android.library") {
9+
applyPlugin(project)
10+
}
11+
12+
project.plugins.withId("java-library") {
13+
applyPlugin(project)
14+
}
15+
16+
}
17+
18+
private fun applyPlugin(project: Project) {
19+
project.plugins.apply("com.vanniktech.maven.publish")
20+
21+
project.extensions.configure(MavenPublishBaseExtension::class.java) {
22+
coordinates(
23+
groupId = project.findProperty("GROUP") as String,
24+
artifactId = project.name,
25+
version = project.findProperty("VERSION_NAME") as String,
26+
)
27+
28+
pom {
29+
name.set(project.findProperty("POM_NAME") as String)
30+
description.set(project.findProperty("POM_DESCRIPTION") as String)
31+
url.set(project.findProperty("POM_URL") as String)
32+
33+
licenses {
34+
license {
35+
name.set(project.findProperty("POM_LICENCE_NAME") as String)
36+
url.set(project.findProperty("POM_LICENCE_URL") as String)
37+
distribution.set(project.findProperty("POM_LICENCE_DIST") as String)
38+
}
39+
}
40+
41+
developers {
42+
developer {
43+
id.set("rokob")
44+
name.set("Andrew Weiss")
45+
}
46+
developer {
47+
id.set("basoko")
48+
name.set("David Basoco")
49+
}
50+
developer {
51+
id.set("diegov")
52+
name.set("Diego Veralli")
53+
}
54+
}
55+
56+
scm {
57+
url.set(project.findProperty("POM_SCM_URL") as String)
58+
connection.set(project.findProperty("POM_SCM_CONNECTION") as String)
59+
developerConnection.set(project.findProperty("POM_SCM_DEV_CONNECTION") as String)
60+
}
61+
}
62+
63+
publishToMavenCentral()
64+
signAllPublications()
65+
}
66+
}
67+
}

build-logic/settings.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
dependencyResolutionManagement {
2+
repositories {
3+
google()
4+
mavenCentral()
5+
}
6+
}
7+
8+
rootProject.name = "build-logic"
9+
10+
include(":conventions")

build.gradle

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)