Skip to content

Commit ad98425

Browse files
committed
ci: share built jars from main with release
- switch off applyMavenCentralRules for snapshots
1 parent cb68d3f commit ad98425

File tree

3 files changed

+24
-12
lines changed

3 files changed

+24
-12
lines changed

.github/workflows/build-main.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,6 @@ jobs:
4343
project_prefixes: ${{ matrix.project_prefix }}
4444
required_projects: ${{ matrix.project_prefix == 'ktor-server' && 'ktor-server-kafka,ktor-server-rate-limiting' || 'ktor-client-circuit-breaker' }}
4545

46-
- name: Cache Gradle packages
47-
uses: actions/cache@v4
48-
with:
49-
path: ~/.gradle/caches
50-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
51-
restore-keys: |
52-
${{ runner.os }}-gradle-
53-
5446
- name: Execute gradle tasks on ${{ steps.detect-modified-subprojects.outputs.modified_projects == '' && 'root' || steps.detect-modified-subprojects.outputs.modified_projects }}
5547
id: execute-gradle-tasks-on-projects
5648
uses: ./.github/actions/execute-gradle-tasks-on-projects
@@ -62,6 +54,15 @@ jobs:
6254
GPR_READ_TOKEN: ${{ secrets.GPR_READ_TOKEN }}
6355
GPR_WRITE_TOKEN: ${{ secrets.GPR_WRITE_TOKEN }}
6456

57+
- name: Upload built jars (${{ matrix.project_prefix }})
58+
uses: actions/upload-artifact@v4
59+
if: always()
60+
with:
61+
name: jars-${{ matrix.project_prefix }}-${{ github.sha }}
62+
path: |
63+
**/build/libs/*.jar
64+
if-no-files-found: ignore
65+
6566
deploy-docs:
6667
needs: build-main
6768
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,17 @@ jobs:
125125
- name: Setup Gradle
126126
uses: gradle/actions/setup-gradle@v4
127127

128+
- name: Download built jars from Build Main
129+
uses: actions/download-artifact@v4
130+
with:
131+
# We uploaded as: jars-${{ matrix.project_prefix }}-${{ github.sha }}
132+
pattern: jars-*-${{ github.sha }}
133+
merge-multiple: true
134+
path: downloaded-jars/
135+
136+
- name: List downloaded jars
137+
run: ls -R downloaded-jars
138+
128139
# Build & stage all subprojects into root/build/staging-deploy
129140
- name: Build & publish to local staging dir
130141
run: |

build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,15 +314,15 @@ jreleaser {
314314
"snapshot-deploy",
315315
closureOf<Nexus2MavenDeployer> {
316316
active = SNAPSHOT
317-
snapshotUrl = "https://central.sonatype.com/repository/maven-snapshots/"
318-
applyMavenCentralRules = true
317+
snapshotUrl = // for ossrh "https://s01.oss.sonatype.org/content/repositories/snapshots/"
318+
"https://central.sonatype.com/repository/maven-snapshots/"
319319
snapshotSupported = true
320320
closeRepository = true
321321
releaseRepository = true
322322
stagingRepository(stagingPath)
323323

324-
username = mcUsername
325-
password = mcPassword
324+
username = mcUsername // for ossrh ossrhUsername
325+
password = mcPassword // for ossrh ossrhPassword
326326
},
327327
)
328328
}

0 commit comments

Comments
 (0)