Skip to content

Commit 6132ddb

Browse files
authored
ci: create the staging repo using dedicated actions (AlchemistSimulator#4083)
1 parent e77ecad commit 6132ddb

2 files changed

Lines changed: 38 additions & 28 deletions

File tree

.github/workflows/build-and-deploy.yml

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -141,32 +141,16 @@ jobs:
141141
- ci-preparation
142142
if: fromJSON(needs.ci-preparation.outputs.may-deploy)
143143
outputs:
144-
repo-id: ${{ steps.staging-repo.outputs.MavenCentral }}
144+
repo-id: ${{ steps.create-staging-repo.outputs.staging-repo-id }}
145145
steps:
146-
- name: Checkout the repo
147-
uses: actions/checkout@v4.2.2
148-
- uses: DanySK/build-check-deploy-gradle-action@3.5.28
146+
- id: create-staging-repo
147+
name: Create a staging repository
148+
uses: danysk/action-create-ossrh-staging-repo@1.1.0
149149
with:
150+
group-id: "it.unibo.alchemist"
150151
maven-central-username: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
151152
maven-central-password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
152-
should-run-codecov: false
153-
should-deploy: ${{ needs.ci-preparation.outputs.will-release }}
154-
build-command: true
155-
check-command: true
156-
deploy-command: |
157-
./gradlew ${{ needs.ci-preparation.outputs.force-version }} createStagingRepositoryOnMavenCentral --parallel
158-
- name: Save the staging repository ID
159-
if: needs.ci-preparation.outputs.will-release == 'true'
160-
id: staging-repo
161-
run: |
162-
[[ -f build/staging-repo-ids.properties ]] || (
163-
echo "Staging repositories ID file not found" &&
164-
exit 1
165-
)
166-
REPO_IDS=$(cat build/staging-repo-ids.properties)
167-
echo "Staging repositories IDs:\n$REPO_IDS"
168-
echo $REPO_IDS >> $GITHUB_OUTPUT
169-
153+
repo-description: "Alchemist ${{ needs.ci-preparation.outputs.next-version }}"
170154

171155
# Assemble all artifacts and upload them
172156
assemble-and-upload:
@@ -214,12 +198,6 @@ jobs:
214198
${{ needs.ci-preparation.outputs.force-version }}\
215199
-PstagingRepositoryId=${{ needs.staging-repo.outputs.repo-id }}\
216200
uploadOSSRH uploadKotlinMultiplatform uploadJvm uploadJs close --parallel || \
217-
#
218-
# Drop the staging repository if the build is not a release
219-
#
220-
if [[ "${{ needs.ci-preparation.outputs.will-release }}" != "true" ]]; then
221-
./gradlew -PstagingRepositoryId=${{ needs.staging-repo.outputs.repo-id }} drop --parallel
222-
fi
223201
clean-command: |
224202
# Clean the build directory on Win and Mac
225203
if [[ "${{ contains('Linux', runner.os) }}" == "false" ]]; then
@@ -543,6 +521,20 @@ jobs:
543521
$gitToken = "${{ secrets.DEPLOYMENT_TOKEN }}"
544522
.\wingetcreate.exe update $env:packageID --version $packageVersion --urls "$installerUrl" --submit --token $gitToken
545523
524+
drop-staging-repo:
525+
needs:
526+
- staging-repo
527+
- release
528+
runs-on: ubuntu-24.04
529+
if: always() && !(contains(needs.staging-repo.result, 'failure') || contains(needs.staging-repo.result, 'cancelled'))
530+
steps:
531+
- name: Drop staging repository
532+
uses: danysk/action-drop-ossrh-staging-repo@1.0.3
533+
with:
534+
repo-id: ${{ needs.staging-repo.outputs.repo-id }}
535+
maven-central-username: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
536+
maven-central-password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
537+
546538
success:
547539
runs-on: ubuntu-24.04
548540
needs:

javadoc-io.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
"ch.qos.logback/logback-classic/1.5.15": {
33
"first": "https://javadoc.io/doc/ch.qos.logback/logback-classic/1.5.15"
44
},
5+
"ch.qos.logback/logback-classic/1.5.16": {
6+
"first": "https://javadoc.io/doc/ch.qos.logback/logback-classic/1.5.16",
7+
"second": "https://javadoc.io/doc/ch.qos.logback/logback-classic/1.5.16/element-list"
8+
},
59
"com.apollographql.apollo3/apollo-compiler/4.0.0-beta.7": {
610
"first": "https://javadoc.io/doc/com.apollographql.apollo3/apollo-compiler/4.0.0-beta.7"
711
},
@@ -95,6 +99,9 @@
9599
"first": "https://javadoc.io/doc/commons-codec/commons-codec/1.17.1",
96100
"second": "https://javadoc.io/doc/commons-codec/commons-codec/1.17.1/element-list"
97101
},
102+
"commons-codec/commons-codec/1.17.2": {
103+
"first": "https://javadoc.io/doc/commons-codec/commons-codec/1.17.2"
104+
},
98105
"commons-io/commons-io/2.18.0": {
99106
"first": "https://javadoc.io/doc/commons-io/commons-io/2.18.0",
100107
"second": "https://javadoc.io/doc/commons-io/commons-io/2.18.0/element-list"
@@ -187,6 +194,10 @@
187194
"first": "https://javadoc.io/doc/net.harawata/appdirs/1.2.2",
188195
"second": "https://javadoc.io/doc/net.harawata/appdirs/1.2.2/element-list"
189196
},
197+
"net.harawata/appdirs/1.3.0": {
198+
"first": "https://javadoc.io/doc/net.harawata/appdirs/1.3.0",
199+
"second": "https://javadoc.io/doc/net.harawata/appdirs/1.3.0/element-list"
200+
},
190201
"net.pearx.kasechange/kasechange/1.4.1": {
191202
"first": "https://javadoc.io/doc/net.pearx.kasechange/kasechange/1.4.1"
192203
},
@@ -343,6 +354,9 @@
343354
"org.jetbrains.kotlinx/kotlinx-serialization-json/1.7.3": {
344355
"first": "https://javadoc.io/doc/org.jetbrains.kotlinx/kotlinx-serialization-json/1.7.3"
345356
},
357+
"org.jetbrains.kotlinx/kotlinx-serialization-json/1.8.0": {
358+
"first": "https://javadoc.io/doc/org.jetbrains.kotlinx/kotlinx-serialization-json/1.8.0"
359+
},
346360
"org.jgrapht/jgrapht-core/1.5.2": {
347361
"first": "https://javadoc.io/doc/org.jgrapht/jgrapht-core/1.5.2",
348362
"second": "https://javadoc.io/doc/org.jgrapht/jgrapht-core/1.5.2/element-list"
@@ -366,6 +380,10 @@
366380
"first": "https://javadoc.io/doc/org.mockito/mockito-core/5.14.2",
367381
"second": "https://javadoc.io/doc/org.mockito/mockito-core/5.14.2/element-list"
368382
},
383+
"org.mockito/mockito-core/5.15.2": {
384+
"first": "https://javadoc.io/doc/org.mockito/mockito-core/5.15.2",
385+
"second": "https://javadoc.io/doc/org.mockito/mockito-core/5.15.2/element-list"
386+
},
369387
"org.mongodb/mongodb-driver-sync/5.2.1": {
370388
"first": "https://javadoc.io/doc/org.mongodb/mongodb-driver-sync/5.2.1"
371389
},

0 commit comments

Comments
 (0)