Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update the publishing process for hyperledger #184

Merged
merged 3 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 37 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,72 @@
---
name: Release sdk

env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
GITHUB_ACTOR: "hyperledger-bot"
GITHUB_ACTOR_EMAIL: "[email protected]"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
OSSRH_GPG_SECRET_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
OSSRH_GPG_SECRET_KEY_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}

on:
workflow_dispatch:

permissions:
contents: write
packages: write

jobs:
release:
env:
ATALA_GITHUB_ACTOR: ${{ secrets.ATALA_GITHUB_ACTOR }}
ATALA_GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.ATALA_GITHUB_TOKEN }}
token: ${{ secrets.IDENTUS_CI }}
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"

- name: Setup Java
uses: actions/setup-java@v3
- name: "Install Java ${{ env.JAVA_VERSION }}"
uses: actions/setup-java@v4
continue-on-error: true
with:
distribution: adopt
java-version: 17
java-version: "${{ env.JAVA_VERSION }}"
distribution: zulu
server-id: ossrh
server-username: ${{ secrets.OSSRH_USERNAME }}
server-password: ${{ secrets.OSSRH_PASSWORD }}
gpg-private-key: ${{ secrets.HYP_BOT_GPG_PRIVATE }}
gpg-passphrase: ${{ secrets.HYP_BOT_GPG_PASSWORD }}


- uses: crazy-max/ghaction-import-gpg@v5
id: import_gpg
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_private_key: ${{ secrets.HYP_BOT_GPG_PRIVATE }}
passphrase: ${{ secrets.HYP_BOT_GPG_PASSWORD }}
git_user_signingkey: true
git_commit_gpgsign: true
git_config_global: true
git_tag_gpgsign: false

- name: Release
- name: "Release"
env:
GITHUB_TOKEN: ${{ secrets.IDENTUS_CI }}
GIT_AUTHOR_EMAIL: ${{ steps.import_gpg.outputs.email }}
GIT_COMMITTER_EMAIL: ${{ steps.import_gpg.outputs.email }}
GIT_AUTHOR_NAME: ${{ steps.import_gpg.outputs.name }}
GIT_COMMITTER_NAME: ${{ steps.import_gpg.outputs.name }}
BASE64_ARMORED_GPG_SIGNING_KEY_MAVEN: ${{ secrets.BASE64_ARMORED_GPG_SIGNING_KEY_MAVEN }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
OSSRH_GPG_SECRET_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
OSSRH_GPG_SECRET_KEY_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
run: |
npm install
npx semantic-release
72 changes: 36 additions & 36 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import org.gradle.internal.os.OperatingSystem
import java.util.Base64

val publishedMavenId = "org.hyperledger.identus"
val os: OperatingSystem = OperatingSystem.current()
Expand All @@ -13,7 +12,7 @@ plugins {
id("org.jetbrains.kotlin.kapt") version "1.9.10"
id("maven-publish")
id("signing")
id("io.github.gradle-nexus.publish-plugin") version "2.0.0-rc-1"
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
}

buildscript {
Expand Down Expand Up @@ -101,6 +100,17 @@ subprojects {
apply(plugin = "org.gradle.signing")

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")
}
}
}
publications {
withType<MavenPublication> {
groupId = publishedMavenId
Expand All @@ -111,12 +121,12 @@ subprojects {
description.set(" Edge Agent SDK - Kotlin Multiplatform (Android/JVM)")
url.set("https://docs.atalaprism.io/")
organization {
name.set("IOG")
url.set("https://iog.io/")
name.set("Hyperledger")
url.set("https://hyperledger.org/")
}
issueManagement {
system.set("Github")
url.set("https://github.com/input-output-hk/atala-prism-wallet-sdk-kmm")
url.set("https://github.com/hyperledger/identus-edge-agent-sdk-kmp")
}
licenses {
license {
Expand All @@ -125,6 +135,14 @@ subprojects {
}
}
developers {
developer {
id.set("cristianIOHK")
name.set("Cristian Gonzalez")
email.set("[email protected]")
organization.set("IOG")
roles.add("developer")
url.set("https://github.com/cristianIOHK")
}
developer {
id.set("hamada147")
name.set("Ahmed Moussa")
Expand All @@ -140,14 +158,6 @@ subprojects {
organization.set("IOG")
roles.add("developer")
}
developer {
id.set("cristianIOHK")
name.set("Cristian Gonzalez")
email.set("[email protected]")
organization.set("IOG")
roles.add("developer")
url.set("https://github.com/cristianIOHK")
}
developer {
id.set("amagyar-iohk")
name.set("Allain Magyar")
Expand All @@ -171,29 +181,19 @@ subprojects {
}
}
scm {
connection.set("scm:git:git://input-output-hk/atala-prism-wallet-sdk-kmm.git")
developerConnection.set("scm:git:ssh://input-output-hk/atala-prism-wallet-sdk-kmm.git")
url.set("https://github.com/input-output-hk/atala-prism-wallet-sdk-kmm")
connection.set("scm:git:git://hyperledger/identus-edge-agent-sdk-kmp.git")
developerConnection.set("scm:git:ssh://hyperledger/identus-edge-agent-sdk-kmp.git")
url.set("https://github.com/hyperledger/identus-edge-agent-sdk-kmp")
}
}
if (System.getenv("BASE64_ARMORED_GPG_SIGNING_KEY_MAVEN") != null) {
if (System.getenv("BASE64_ARMORED_GPG_SIGNING_KEY_MAVEN").isNotBlank()) {
signing {
val base64EncodedAsciiArmoredSigningKey: String =
System.getenv("BASE64_ARMORED_GPG_SIGNING_KEY_MAVEN") ?: ""
val signingKeyPassword: String =
System.getenv("SIGNING_KEY_PASSWORD") ?: ""
useInMemoryPgpKeys(
String(
Base64.getDecoder().decode(
base64EncodedAsciiArmoredSigningKey.toByteArray()
)
),
signingKeyPassword
)
sign(this@withType)
}
}
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)
}
}
}
Expand All @@ -206,8 +206,8 @@ nexusPublishing {
sonatype {
nexusUrl.set(uri("https://oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots/"))
username.set(System.getenv("SONATYPE_USERNAME"))
password.set(System.getenv("SONATYPE_PASSWORD"))
username.set(System.getenv("OSSRH_USERNAME"))
password.set(System.getenv("OSSRH_TOKEN"))
}
}
}
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/input-output-hk/atala-prism-wallet-sdk-kmm.git"
"url": "git+https://github.com/hyperledger/identus-edge-agent-sdk-kmp.git"
},
"author": "IOG",
"license": "ISC",
"bugs": {
"url": "https://github.com/input-output-hk/atala-prism-wallet-sdk-kmm/issues"
"url": "https://github.com/hyperledger/identus-edge-agent-sdk-kmp/issues"
},
"homepage": "https://github.com/input-output-hk/atala-prism-wallet-sdk-kmm#readme",
"homepage": "https://github.com/hyperledger/identus-edge-agent-sdk-kmp#readme",
"devDependencies": {
"@semantic-release/changelog": "^6.0.2",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"gradle-semantic-release-plugin": "^1.7.4",
"semantic-release": "^19.0.5",
"semantic-release-slack-bot": "^3.5.3"
"gradle-semantic-release-plugin": "^1.9.2",
"semantic-release": "^24.0.0",
"semantic-release-slack-bot": "^4.0.2"
}
}
Loading