Skip to content

Commit 842896f

Browse files
committed
ci: onboard to OSS Community Develocity
Replaces the self-hosted HttpBuildCache with Develocity's remote cache at community.develocity.cloud under project `meshtastic`, matching the Meshtastic-Android onboarding (meshtastic/Meshtastic-Android#6531). - `gradle/develocity.settings.gradle` replaces `gradle/build-cache.settings.gradle`, applied from BOTH settings files: the build-logic included build does not inherit the root's configuration, and without its own it silently drops to local-cache-only and publishes no scan. - `.github/actions/gradle-setup` gains an optional `develocity_access_key` input, passed at all 12 call sites; the GRADLE_CACHE_* env blocks are gone. - Scans publish only from authenticated builds, so fork PRs and developers without a provisioned key are unaffected; only authenticated CI runs write to the cache. The GRADLE_CACHE_* secrets are no longer read but are deliberately left in place as the rollback path.
1 parent 951d81a commit 842896f

9 files changed

Lines changed: 104 additions & 94 deletions

File tree

.github/actions/gradle-setup/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ inputs:
44
cache_read_only:
55
description: 'Whether Gradle cache is read-only'
66
default: 'true'
7+
develocity_access_key:
8+
description: 'Access key for the OSS Community Develocity Instance (Build Scan publishing and remote cache writes)'
9+
required: false
710
runs:
811
using: composite
912
steps:
@@ -30,3 +33,4 @@ runs:
3033
cache-read-only: ${{ inputs.cache_read_only }}
3134
cache-cleanup: on-success
3235
add-job-summary: always
36+
develocity-access-key: ${{ inputs.develocity_access_key }}

.github/workflows/ci.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ concurrency:
1414
permissions:
1515
contents: read
1616

17-
env:
18-
GRADLE_CACHE_URL: ${{ secrets.GRADLE_CACHE_URL }}
19-
GRADLE_CACHE_USERNAME: ${{ secrets.GRADLE_CACHE_USERNAME }}
20-
GRADLE_CACHE_PASSWORD: ${{ secrets.GRADLE_CACHE_PASSWORD }}
21-
2217
jobs:
2318
lint:
2419
name: Lint
@@ -32,6 +27,7 @@ jobs:
3227
- uses: ./.github/actions/gradle-setup
3328
with:
3429
cache_read_only: ${{ github.event_name == 'pull_request' }}
30+
develocity_access_key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
3531

3632
- name: Run spotlessCheck and detektAll
3733
run: ./gradlew spotlessCheck detektAll --stacktrace
@@ -48,6 +44,7 @@ jobs:
4844
- uses: ./.github/actions/gradle-setup
4945
with:
5046
cache_read_only: ${{ github.event_name == 'pull_request' }}
47+
develocity_access_key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
5148

5249
- name: Run JVM tests and verify coverage
5350
run: ./gradlew jvmTest koverVerify --stacktrace
@@ -77,6 +74,7 @@ jobs:
7774
- uses: ./.github/actions/gradle-setup
7875
with:
7976
cache_read_only: ${{ github.event_name == 'pull_request' }}
77+
develocity_access_key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
8078

8179
- name: Run Linux native tests
8280
run: ./gradlew linuxX64Test --stacktrace
@@ -93,6 +91,7 @@ jobs:
9391
- uses: ./.github/actions/gradle-setup
9492
with:
9593
cache_read_only: ${{ github.event_name == 'pull_request' }}
94+
develocity_access_key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
9695

9796
- name: Run macOS and iOS simulator tests
9897
run: ./gradlew macosArm64Test iosSimulatorArm64Test --stacktrace
@@ -109,6 +108,7 @@ jobs:
109108
- uses: ./.github/actions/gradle-setup
110109
with:
111110
cache_read_only: ${{ github.event_name == 'pull_request' }}
111+
develocity_access_key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
112112

113113
- name: Run wasmJs browser tests
114114
run: ./gradlew wasmJsBrowserTest --stacktrace
@@ -125,6 +125,7 @@ jobs:
125125
- uses: ./.github/actions/gradle-setup
126126
with:
127127
cache_read_only: ${{ github.event_name == 'pull_request' }}
128+
develocity_access_key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
128129

129130
- name: Run Windows native tests
130131
shell: bash
@@ -142,6 +143,7 @@ jobs:
142143
- uses: ./.github/actions/gradle-setup
143144
with:
144145
cache_read_only: ${{ github.event_name == 'pull_request' }}
146+
develocity_access_key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
145147

146148
# apiCheck now validates the klib/native ABI too, so it compiles native
147149
# klibs and needs the Kotlin/Native toolchain. Cache ~/.konan to avoid
@@ -170,6 +172,7 @@ jobs:
170172
- uses: ./.github/actions/gradle-setup
171173
with:
172174
cache_read_only: ${{ github.event_name == 'pull_request' }}
175+
develocity_access_key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
173176

174177
- name: Build
175178
run: ./gradlew build --stacktrace
@@ -188,6 +191,7 @@ jobs:
188191
- uses: ./.github/actions/gradle-setup
189192
with:
190193
cache_read_only: 'false'
194+
develocity_access_key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
191195

192196
- name: Compute snapshot version
193197
id: version

.github/workflows/docs.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ concurrency:
1414
group: "pages"
1515
cancel-in-progress: false
1616

17-
env:
18-
GRADLE_CACHE_URL: ${{ secrets.GRADLE_CACHE_URL }}
19-
GRADLE_CACHE_USERNAME: ${{ secrets.GRADLE_CACHE_USERNAME }}
20-
GRADLE_CACHE_PASSWORD: ${{ secrets.GRADLE_CACHE_PASSWORD }}
21-
2217
jobs:
2318
build-docs:
2419
name: Build Documentation
@@ -29,6 +24,7 @@ jobs:
2924
- uses: ./.github/actions/gradle-setup
3025
with:
3126
cache_read_only: 'false'
27+
develocity_access_key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
3228

3329
- name: Generate API documentation
3430
run: ./gradlew dokkaGeneratePublicationHtml --stacktrace

.github/workflows/release.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ concurrency:
3030
group: ${{ github.workflow }}-${{ inputs.version && format('v{0}', inputs.version) || github.ref_name }}
3131
cancel-in-progress: false
3232

33-
env:
34-
GRADLE_CACHE_URL: ${{ secrets.GRADLE_CACHE_URL }}
35-
GRADLE_CACHE_USERNAME: ${{ secrets.GRADLE_CACHE_USERNAME }}
36-
GRADLE_CACHE_PASSWORD: ${{ secrets.GRADLE_CACHE_PASSWORD }}
37-
3833
permissions:
3934
contents: write
4035
id-token: write
@@ -73,6 +68,7 @@ jobs:
7368
- uses: ./.github/actions/gradle-setup
7469
with:
7570
cache_read_only: 'false'
71+
develocity_access_key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
7672

7773
- name: Validate before publish
7874
run: ./gradlew spotlessCheck detektAll jvmTest apiCheck --stacktrace
@@ -188,6 +184,7 @@ jobs:
188184
- uses: ./.github/actions/gradle-setup
189185
with:
190186
cache_read_only: 'false'
187+
develocity_access_key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
191188

192189
- name: Build sample artifacts
193190
shell: bash

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
[![CI](https://github.com/meshtastic/MQTTastic-Client-KMP/actions/workflows/ci.yml/badge.svg)](https://github.com/meshtastic/MQTTastic-Client-KMP/actions/workflows/ci.yml)
99
[![codecov](https://codecov.io/gh/meshtastic/MQTTastic-Client-KMP/graph/badge.svg)](https://codecov.io/gh/meshtastic/MQTTastic-Client-KMP)
1010
[![API Docs](https://img.shields.io/badge/API%20Docs-latest-blue.svg)](https://meshtastic.github.io/MQTTastic-Client-KMP)
11+
[![Revved up by Develocity](https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?logo=Gradle&labelColor=02303A)](https://community.develocity.cloud/scans?search.rootProjectNames=MQTTastic-Client-KMP)
1112

1213
A fully-featured **MQTT 5.0 and 3.1.1** client library for **Kotlin Multiplatform** — connecting JVM, Android, iOS, macOS, Linux, Windows, and browsers through a single, idiomatic Kotlin API.
1314

build-logic/settings.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@
1919
// Standalone settings for the included build. Re-uses the same version catalog
2020
// as the main build so plugin versions stay in lockstep.
2121

22+
plugins {
23+
id("com.gradle.develocity") version "4.5.0"
24+
id("com.gradle.common-custom-user-data-gradle-plugin") version "2.8.0"
25+
}
26+
27+
// Included builds do not inherit the root's settings configuration; without its
28+
// own, this build silently drops to local-cache-only and publishes no scan.
29+
apply(from = "../gradle/develocity.settings.gradle")
30+
2231
dependencyResolutionManagement {
2332
repositories {
2433
gradlePluginPortal()

gradle/build-cache.settings.gradle

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

gradle/develocity.settings.gradle

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*
2+
* Copyright (c) 2026 Meshtastic LLC
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
*/
17+
18+
/*
19+
* Develocity — Build Scans and remote Build Cache on the OSS Community instance
20+
* (https://community.develocity.cloud), project `meshtastic`.
21+
*
22+
* Applied from BOTH settings files: the build-logic included build does not
23+
* inherit the root's configuration, and without its own it silently drops to
24+
* local-cache-only.
25+
*
26+
* Replaces the former self-hosted HttpBuildCache: GRADLE_CACHE_URL / _USERNAME /
27+
* _PASSWORD are no longer read anywhere in this repo.
28+
*/
29+
30+
def isCI = System.getenv("CI") != null
31+
32+
develocity {
33+
server = "https://community.develocity.cloud"
34+
projectId = "meshtastic"
35+
buildScan {
36+
uploadInBackground = !isCI
37+
// Unauthenticated builds (fork PRs, developers who never provisioned a key)
38+
// publish nothing rather than failing.
39+
publishing.onlyIf { it.authenticated }
40+
// Fingerprints power cache-miss comparison (CI debugging); skip the payload locally.
41+
capture { fileFingerprints = isCI }
42+
// Public instance: no machine identity. Constants on purpose — scans already
43+
// record OS/CPU and CCUD adds CI metadata. Keep the `if` OUTSIDE the closures:
44+
// capture-free closures are what the configuration cache can serialize.
45+
obfuscation {
46+
ipAddresses { addresses -> addresses.collect { "0.0.0.0" } }
47+
externalProcessName { "external-process" }
48+
if (isCI) {
49+
username { "ci" }
50+
hostname { "ci-runner" }
51+
} else {
52+
username { "local-dev" }
53+
hostname { "local-machine" }
54+
}
55+
}
56+
}
57+
}
58+
59+
// Resolved outside the buildCache block: inside it the closure delegate is
60+
// BuildCacheConfiguration, which has no `develocity` property.
61+
def develocityBuildCache = develocity.buildCache
62+
def accessKey = System.getenv("DEVELOCITY_ACCESS_KEY")?.trim()
63+
64+
buildCache {
65+
// Off on CI: runners are ephemeral and every hit comes from the remote anyway.
66+
local {
67+
enabled = !isCI
68+
}
69+
remote(develocityBuildCache) {
70+
enabled = true
71+
// Only authenticated CI writes, so unmerged and fork code cannot poison the cache.
72+
push = isCI && accessKey != null && !accessKey.isEmpty()
73+
}
74+
}

settings.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ pluginManagement {
99

1010
plugins {
1111
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
12+
id("com.gradle.develocity") version "4.5.0"
13+
id("com.gradle.common-custom-user-data-gradle-plugin") version "2.8.0"
1214
}
1315

14-
// Build Cache configuration (HTTP remote cache + local)
15-
apply(from = "gradle/build-cache.settings.gradle")
16+
// Build Scans + remote Build Cache (Develocity OSS Community instance)
17+
apply(from = "gradle/develocity.settings.gradle")
1618

1719
dependencyResolutionManagement {
1820
repositories {

0 commit comments

Comments
 (0)