Skip to content

Commit 3d0d107

Browse files
committed
ci: share gradle cache with release, change staging dir to string: target/staging-deploy, not creating the dir
1 parent e0ca12b commit 3d0d107

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

.github/workflows/build-main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ jobs:
3333
java-version: 17
3434
distribution: 'temurin'
3535

36+
- name: Setup Gradle
37+
uses: gradle/actions/setup-gradle@v4
38+
3639
- name: Detect modified subprojects
3740
uses: ./.github/actions/detect-modified-projects
3841
id: detect-modified-subprojects

.github/workflows/release.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,6 @@ jobs:
122122
distribution: temurin
123123
java-version: "17"
124124

125-
- name: Cache Gradle packages
126-
uses: actions/cache@v4
127-
with:
128-
path: ~/.gradle/caches
129-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
130-
restore-keys: |
131-
${{ runner.os }}-gradle-
132-
133125
- name: Setup Gradle
134126
uses: gradle/actions/setup-gradle@v4
135127

build.gradle.kts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -283,20 +283,15 @@ jreleaser {
283283
passphrase = jreleaserGpgPassphrase
284284
}
285285
deploy {
286-
val stagingDir =
287-
layout.buildDirectory
288-
.dir("staging-deploy")
289-
.get()
290-
.asFile
291-
if (!stagingDir.exists()) stagingDir.mkdirs()
286+
val stagingDir = "target/staging-deploy"
292287
maven {
293288
mavenCentral {
294289
create(
295290
"release-deploy",
296291
closureOf<MavenCentralMavenDeployer> {
297292
active = RELEASE
298293
url = "https://central.sonatype.com/api/v1/publisher"
299-
stagingRepository(stagingDir.absolutePath)
294+
stagingRepository(stagingDir)
300295

301296
username = mcUsername
302297
password = mcPassword
@@ -318,7 +313,7 @@ jreleaser {
318313
snapshotSupported = true
319314
closeRepository = true
320315
releaseRepository = true
321-
stagingRepository(stagingDir.absolutePath)
316+
stagingRepository(stagingDir)
322317

323318
username = mcUsername
324319
password = mcPassword

0 commit comments

Comments
 (0)