@@ -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 :
0 commit comments