Skip to content

Commit

Permalink
ci: create the staging repo using dedicated actions (AlchemistSimulat…
Browse files Browse the repository at this point in the history
  • Loading branch information
DanySK authored and AngeloFilaseta committed Jan 17, 2025
1 parent 766a51e commit d2ed3d4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 28 deletions.
48 changes: 20 additions & 28 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,32 +141,16 @@ jobs:
- ci-preparation
if: fromJSON(needs.ci-preparation.outputs.may-deploy)
outputs:
repo-id: ${{ steps.staging-repo.outputs.MavenCentral }}
repo-id: ${{ steps.create-staging-repo.outputs.staging-repo-id }}
steps:
- name: Checkout the repo
uses: actions/checkout@v4.2.2
- uses: DanySK/build-check-deploy-gradle-action@3.5.28
- id: create-staging-repo
name: Create a staging repository
uses: danysk/action-create-ossrh-staging-repo@1.1.0
with:
group-id: "it.unibo.alchemist"
maven-central-username: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
maven-central-password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
should-run-codecov: false
should-deploy: ${{ needs.ci-preparation.outputs.will-release }}
build-command: true
check-command: true
deploy-command: |
./gradlew ${{ needs.ci-preparation.outputs.force-version }} createStagingRepositoryOnMavenCentral --parallel
- name: Save the staging repository ID
if: needs.ci-preparation.outputs.will-release == 'true'
id: staging-repo
run: |
[[ -f build/staging-repo-ids.properties ]] || (
echo "Staging repositories ID file not found" &&
exit 1
)
REPO_IDS=$(cat build/staging-repo-ids.properties)
echo "Staging repositories IDs:\n$REPO_IDS"
echo $REPO_IDS >> $GITHUB_OUTPUT
repo-description: "Alchemist ${{ needs.ci-preparation.outputs.next-version }}"

# Assemble all artifacts and upload them
assemble-and-upload:
Expand Down Expand Up @@ -214,12 +198,6 @@ jobs:
${{ needs.ci-preparation.outputs.force-version }}\
-PstagingRepositoryId=${{ needs.staging-repo.outputs.repo-id }}\
uploadOSSRH uploadKotlinMultiplatform uploadJvm uploadJs close --parallel || \
#
# Drop the staging repository if the build is not a release
#
if [[ "${{ needs.ci-preparation.outputs.will-release }}" != "true" ]]; then
./gradlew -PstagingRepositoryId=${{ needs.staging-repo.outputs.repo-id }} drop --parallel
fi
clean-command: |
# Clean the build directory on Win and Mac
if [[ "${{ contains('Linux', runner.os) }}" == "false" ]]; then
Expand Down Expand Up @@ -543,6 +521,20 @@ jobs:
$gitToken = "${{ secrets.DEPLOYMENT_TOKEN }}"
.\wingetcreate.exe update $env:packageID --version $packageVersion --urls "$installerUrl" --submit --token $gitToken
drop-staging-repo:
needs:
- staging-repo
- release
runs-on: ubuntu-24.04
if: always() && !(contains(needs.staging-repo.result, 'failure') || contains(needs.staging-repo.result, 'cancelled'))
steps:
- name: Drop staging repository
uses: danysk/action-drop-ossrh-staging-repo@1.0.3
with:
repo-id: ${{ needs.staging-repo.outputs.repo-id }}
maven-central-username: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
maven-central-password: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}

success:
runs-on: ubuntu-24.04
needs:
Expand Down
18 changes: 18 additions & 0 deletions javadoc-io.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"ch.qos.logback/logback-classic/1.5.15": {
"first": "https://javadoc.io/doc/ch.qos.logback/logback-classic/1.5.15"
},
"ch.qos.logback/logback-classic/1.5.16": {
"first": "https://javadoc.io/doc/ch.qos.logback/logback-classic/1.5.16",
"second": "https://javadoc.io/doc/ch.qos.logback/logback-classic/1.5.16/element-list"
},
"com.apollographql.apollo3/apollo-compiler/4.0.0-beta.7": {
"first": "https://javadoc.io/doc/com.apollographql.apollo3/apollo-compiler/4.0.0-beta.7"
},
Expand Down Expand Up @@ -95,6 +99,9 @@
"first": "https://javadoc.io/doc/commons-codec/commons-codec/1.17.1",
"second": "https://javadoc.io/doc/commons-codec/commons-codec/1.17.1/element-list"
},
"commons-codec/commons-codec/1.17.2": {
"first": "https://javadoc.io/doc/commons-codec/commons-codec/1.17.2"
},
"commons-io/commons-io/2.18.0": {
"first": "https://javadoc.io/doc/commons-io/commons-io/2.18.0",
"second": "https://javadoc.io/doc/commons-io/commons-io/2.18.0/element-list"
Expand Down Expand Up @@ -187,6 +194,10 @@
"first": "https://javadoc.io/doc/net.harawata/appdirs/1.2.2",
"second": "https://javadoc.io/doc/net.harawata/appdirs/1.2.2/element-list"
},
"net.harawata/appdirs/1.3.0": {
"first": "https://javadoc.io/doc/net.harawata/appdirs/1.3.0",
"second": "https://javadoc.io/doc/net.harawata/appdirs/1.3.0/element-list"
},
"net.pearx.kasechange/kasechange/1.4.1": {
"first": "https://javadoc.io/doc/net.pearx.kasechange/kasechange/1.4.1"
},
Expand Down Expand Up @@ -343,6 +354,9 @@
"org.jetbrains.kotlinx/kotlinx-serialization-json/1.7.3": {
"first": "https://javadoc.io/doc/org.jetbrains.kotlinx/kotlinx-serialization-json/1.7.3"
},
"org.jetbrains.kotlinx/kotlinx-serialization-json/1.8.0": {
"first": "https://javadoc.io/doc/org.jetbrains.kotlinx/kotlinx-serialization-json/1.8.0"
},
"org.jgrapht/jgrapht-core/1.5.2": {
"first": "https://javadoc.io/doc/org.jgrapht/jgrapht-core/1.5.2",
"second": "https://javadoc.io/doc/org.jgrapht/jgrapht-core/1.5.2/element-list"
Expand All @@ -366,6 +380,10 @@
"first": "https://javadoc.io/doc/org.mockito/mockito-core/5.14.2",
"second": "https://javadoc.io/doc/org.mockito/mockito-core/5.14.2/element-list"
},
"org.mockito/mockito-core/5.15.2": {
"first": "https://javadoc.io/doc/org.mockito/mockito-core/5.15.2",
"second": "https://javadoc.io/doc/org.mockito/mockito-core/5.15.2/element-list"
},
"org.mongodb/mongodb-driver-sync/5.2.1": {
"first": "https://javadoc.io/doc/org.mongodb/mongodb-driver-sync/5.2.1"
},
Expand Down

0 comments on commit d2ed3d4

Please sign in to comment.