From 8f98b5ae7d106ac7a977f3676492c7c2ee0e73e9 Mon Sep 17 00:00:00 2001 From: Yurii Shynbuiev - IOHK Date: Wed, 7 Aug 2024 14:17:43 +0700 Subject: [PATCH] fix: publish to OSSHR repository (#188) Signed-off-by: Yurii Shynbuiev Signed-off-by: Hyperledger Bot Co-authored-by: Hyperledger Bot --- .github/workflows/release.yml | 7 +- .releaserc.yml | 2 + README.md | 4 +- build.gradle.kts | 191 ++++++++++++++++------------------ package.json | 4 +- 5 files changed, 101 insertions(+), 107 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 440ceda38..4bbfd54f5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,6 +42,7 @@ jobs: - name: "Install Java ${{ env.JAVA_VERSION }}" uses: actions/setup-java@v4 + continue-on-error: true with: java-version: "${{ env.JAVA_VERSION }}" distribution: zulu @@ -56,9 +57,9 @@ jobs: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - - name: "Install autoconf, automake, libtool" + - name: "Install autoconf, automake, libtool, rustup" run: | - brew install autoconf automake libtool + brew install autoconf automake libtool rustup - name: "Install Mac ToolChain" run: | @@ -106,7 +107,7 @@ jobs: id: import_gpg with: gpg_private_key: ${{ secrets.HYP_BOT_GPG_PRIVATE }} - passphrase: ${{ secrets.HYP_BOT_GPG_PASSWORD }} + passphrase: ${{ secrets.HYP_BOT_GPG_PASSWORD }} git_user_signingkey: true git_commit_gpgsign: true git_config_global: true diff --git a/.releaserc.yml b/.releaserc.yml index 450667959..5ab14073b 100644 --- a/.releaserc.yml +++ b/.releaserc.yml @@ -2,6 +2,8 @@ branches: - name: "main" - name: "release/*" prerelease: "snapshot" + - name: "beta" + prerelease: true plugins: - "@semantic-release/commit-analyzer" diff --git a/README.md b/README.md index b72da2c7a..f5519b066 100644 --- a/README.md +++ b/README.md @@ -109,9 +109,9 @@ You should be able to import and build the project in IntelliJ IDEA now. Here is a list of common issues you might face and its solutions. -##### Enviroment Variables were added but not available +##### Environment Variables were added but not available -If you already added the envorment variable to your CMD profile and still not being available. +If you already added the environment variable to your CMD profile and still not being available. **Solution** diff --git a/build.gradle.kts b/build.gradle.kts index 99bf033db..3205f8a78 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ plugins { id("org.jlleitschuh.gradle.ktlint") version "11.6.1" id("maven-publish") id("org.jetbrains.kotlinx.kover") version "0.7.5" - id("io.github.gradle-nexus.publish-plugin") version "2.0.0-rc-1" + id("io.github.gradle-nexus.publish-plugin") version "2.0.0" id("signing") id("com.android.library") version "8.1.4" apply false } @@ -35,111 +35,102 @@ allprojects { apply(plugin = "org.gradle.maven-publish") apply(plugin = "org.gradle.signing") - // Allowed projects to publish to maven - val allowedProjectsToPublish = listOf("apollo") - if (allowedProjectsToPublish.contains(project.name) && project.name.contains("androidDebug")) { - publishing { - repositories { - maven { - name = "OSSRH" - url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") - credentials { - username = project.findProperty("sonatypeUsername") as String? ?: System.getenv("OSSRH_USERNAME") - password = project.findProperty("sonatypePassword") as String? ?: System.getenv("OSSRH_TOKEN") + publishing { + publications.withType { + groupId = publishedMavenId + artifactId = project.name + version = project.version.toString() + pom { + name.set("Identus Apollo") + description.set("Collection of the cryptographic methods used all around Identus platform") + url.set("https://docs.atalaprism.io/") + organization { + name.set("Hyperledger") + url.set("https://www.hyperledger.org/") + } + issueManagement { + system.set("Github") + url.set("https://github.com/hyperledger/identus-apollo") + } + licenses { + license { + name.set("The Apache License, Version 2.0") + url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") } } - } - publications { - withType { - groupId = publishedMavenId - artifactId = project.name - version = project.version.toString() - pom { - name.set("Identus Apollo") - description.set("Collection of the cryptographic methods used all around Identus platform") - url.set("https://docs.atalaprism.io/") - organization { - name.set("IOG") - url.set("https://iog.io/") - } - issueManagement { - system.set("Github") - url.set("https://github.com/hyperledger/identus-apollo") - } - licenses { - license { - name.set("The Apache License, Version 2.0") - url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") - } - } - developers { - developer { - id.set("hamada147") - name.set("Ahmed Moussa") - email.set("ahmed.moussa@iohk.io") - organization.set("IOG") - roles.add("developer") - url.set("https://github.com/hamada147") - } - developer { - id.set("amagyar-iohk") - name.set("Allain Magyar") - email.set("allain.magyar@iohk.io") - organization.set("IOG") - roles.add("qc") - } - developer { - id.set("antonbaliasnikov") - name.set("Anton Baliasnikov") - email.set("anton.baliasnikov@iohk.io") - organization.set("IOG") - roles.add("qc") - } - developer { - id.set("elribonazo") - name.set("Javier Ribó") - email.set("javier.ribo@iohk.io") - organization.set("IOG") - roles.add("developer") - } - developer { - id.set("goncalo-frade-iohk") - name.set("Gonçalo Frade") - email.set("goncalo.frade@iohk.io") - organization.set("IOG") - roles.add("developer") - } - developer { - id.set("curtis-h") - name.set("Curtis Harding") - email.set("curtis.harding@iohk.io") - organization.set("IOG") - roles.add("developer") - } - developer { - id.set("cristianIOHK") - name.set("Cristian Gonzalez") - email.set("cristian.castro@iohk.io") - organization.set("IOG") - roles.add("developer") - } - } - scm { - connection.set("scm:git:git://git@github.com/hyperledger/identus-apollo.git") - developerConnection.set("scm:git:ssh://git@github.com/hyperledger/identus-apollo.git") - url.set("https://github.com/hyperledger/identus-apollo") - } + developers { + developer { + id.set("hamada147") + name.set("Ahmed Moussa") + email.set("ahmed.moussa@iohk.io") + organization.set("IOG") + roles.add("developer") + url.set("https://github.com/hamada147") } - - signing { - useInMemoryPgpKeys( - project.findProperty("signing.signingSecretKey") as String? ?: System.getenv("OSSRH_GPG_SECRET_KEY"), - project.findProperty("signing.signingSecretKeyPassword") as String? ?: System.getenv("OSSRH_GPG_SECRET_KEY_PASSWORD") - ) - sign(this@withType) + developer { + id.set("amagyar-iohk") + name.set("Allain Magyar") + email.set("allain.magyar@iohk.io") + organization.set("IOG") + roles.add("qc") + } + developer { + id.set("antonbaliasnikov") + name.set("Anton Baliasnikov") + email.set("anton.baliasnikov@iohk.io") + organization.set("IOG") + roles.add("qc") + } + developer { + id.set("elribonazo") + name.set("Javier Ribó") + email.set("javier.ribo@iohk.io") + organization.set("IOG") + roles.add("developer") + } + developer { + id.set("goncalo-frade-iohk") + name.set("Gonçalo Frade") + email.set("goncalo.frade@iohk.io") + organization.set("IOG") + roles.add("developer") } + developer { + id.set("curtis-h") + name.set("Curtis Harding") + email.set("curtis.harding@iohk.io") + organization.set("IOG") + roles.add("developer") + } + developer { + id.set("cristianIOHK") + name.set("Cristian Gonzalez") + email.set("cristian.castro@iohk.io") + organization.set("IOG") + roles.add("developer") + } + developer { + id.set("yshyn-iohk") + name.set("Yurii Shynbuiev") + email.set("yurii.shynbuiev@iohk.io") + organization.set("IOG") + roles.add("developer") + } + } + scm { + connection.set("scm:git:git://git@github.com/hyperledger/identus-apollo.git") + developerConnection.set("scm:git:ssh://git@github.com/hyperledger/identus-apollo.git") + url.set("https://github.com/hyperledger/identus-apollo") } } + + signing { + useInMemoryPgpKeys( + project.findProperty("signing.signingSecretKey") as String? ?: System.getenv("OSSRH_GPG_SECRET_KEY"), + project.findProperty("signing.signingSecretKeyPassword") as String? ?: System.getenv("OSSRH_GPG_SECRET_KEY_PASSWORD") + ) + sign(this@withType) + } } } } diff --git a/package.json b/package.json index e70e61dbe..36f9f2d79 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,8 @@ "@semantic-release/changelog": "^6.0.2", "@semantic-release/exec": "^6.0.3", "@semantic-release/git": "^10.0.1", - "gradle-semantic-release-plugin": "1.7.7", - "semantic-release": "^21.0.2", + "gradle-semantic-release-plugin": "1.9.2", + "semantic-release": "^24.0.0", "semantic-release-slack-bot": "^4.0.2" } }