Skip to content

Commit

Permalink
build: upgrade Kotlin, tools & CI
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmed Moussa <[email protected]>
  • Loading branch information
hamada147 committed Jan 10, 2024
1 parent 1f1ea82 commit 5393a21
Show file tree
Hide file tree
Showing 28 changed files with 666 additions and 333 deletions.
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
root = true

[*.{kt,kts}]
ktlint_code_style = ktlint_official
ktlint_standard_no_semi = disabled
ktlint_standard_trailing-comma-on-call-site = disabled
ktlint_standard_trailing-comma-on-declaration-site = disabled
ktlint_standard_function-signature = disabled
ktlint_standard_max-line-length = disabled
34 changes: 0 additions & 34 deletions .github/workflows/lint.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/release-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ env:
on:
workflow_dispatch:
push:
tags:
- "*"
branches:
- "main"

jobs:
build:
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
# kics-scan ignore
name: "Release"

defaults:
run:
shell: bash

env:
JAVA_VERSION: 11
NODEJS_VERSION: 16.17.0
ATALA_GITHUB_ACTOR: ${{ secrets.ATALA_GITHUB_ACTOR }}
ATALA_GITHUB_TOKEN: ${{ secrets.ATALA_GITHUB_TOKEN }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

on:
workflow_dispatch:
push:
branches:
- "main"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: "Checkout the repo"
uses: actions/checkout@v3

- name: "Validate Gradle Wrapper"
uses: gradle/wrapper-validation-action@v1

- name: "Cache gradle"
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/.konan
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: "Install Java ${{ env.JAVA_VERSION }}"
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: "zulu"

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

- name: "Release"
env:
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 }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
BASE64_ARMORED_GPG_SIGNING_KEY_MAVEN: ${{ secrets.BASE64_ARMORED_GPG_SIGNING_KEY_MAVEN }}
SIGNING_KEY_PASSWORD: ""
run: |
npm install
npx semantic-release
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ Pods/
*.jks
*yarn.lock
JSLibs/iohk-crypto/node_modules
node_modules/*
package-lock.json
2 changes: 1 addition & 1 deletion .mega-linter.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
APPLY_FIXES: none
FILTER_REGEX_EXCLUDE: (karma.config.js|polyfill.js|timeout.js)
FILTER_REGEX_EXCLUDE: (karma.config.js|polyfill.js|timeout.js|CHANGELOG.md)
VALIDATE_ALL_CODEBASE: true
REPOSITORY_DEVSKIM_DISABLE_ERRORS: true
MARKDOWN_MARKDOWN_LINK_CHECK_FILTER_REGEX_EXCLUDE: (pull-request.yml|Deployment.yml|badge.svg)
Expand Down
38 changes: 38 additions & 0 deletions .releaserc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
branches:
- name: "main"
- name: "release"
- name: "prerelease"
prerelease: "snapshot"

plugins:
- "@semantic-release/commit-analyzer"
- "@semantic-release/release-notes-generator"
- ["@semantic-release/changelog", {changelogFile: "CHANGELOG.md"}]
- "gradle-semantic-release-plugin"
- [
"@semantic-release/git",
{
assets: [
"CHANGELOG.md",
"gradle.properties"
],
message: "chore(release): cut wallet sdk version ${nextRelease.version}
${nextRelease.notes}",
},
]
- [
"semantic-release-slack-bot",
{
notifyOnSuccess: true,
notifyOnFail: true,
markdownReleaseNotes: true,
onSuccessTemplate:
{text: "A new version of `$package_name` successfully released!\n
Version: `v${nextRelease.version}`\n
Tag: $repo_url/releases/tag/v${nextRelease.version}n
\n
Release notes:\n
$release_notes"},
},
]
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Mercury

[![Kotlin](https://img.shields.io/badge/kotlin-1.8.20-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![Kotlin](https://img.shields.io/badge/kotlin-1.9.22-blue.svg?logo=kotlin)](http://kotlinlang.org)
![badge-license]
![badge-latest-release]

![android](https://camo.githubusercontent.com/b1d9ad56ab51c4ad1417e9a5ad2a8fe63bcc4755e584ec7defef83755c23f923/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d616e64726f69642d3645444238442e7376673f7374796c653d666c6174)
![ios](https://camo.githubusercontent.com/1fec6f0d044c5e1d73656bfceed9a78fd4121b17e82a2705d2a47f6fd1f0e3e5/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d696f732d4344434443442e7376673f7374796c653d666c6174)
![jvm](https://camo.githubusercontent.com/700f5dcd442fd835875568c038ae5cd53518c80ae5a0cf12c7c5cf4743b5225b/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d6a766d2d4442343133442e7376673f7374796c653d666c6174)
![js](https://camo.githubusercontent.com/3e0a143e39915184b54b60a2ecedec75e801f396d34b5b366c94ec3604f7e6bd/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d6a732d4638444235442e7376673f7374796c653d666c6174)
![getNode-js](https://camo.githubusercontent.com/d08fda729ceebcae0f23c83499ca8f06105350f037661ac9a4cc7f58edfdbca9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d6e6f64656a732d3638613036332e7376673f7374796c653d666c6174)
![badge-platform-android]
![badge-platform-ios]
![badge-platform-jvm]
![badge-platform-js]
![badge-platform-js-node]

![Atala Prism Logo](Logo.png)

Expand Down Expand Up @@ -36,3 +38,14 @@ This software is provided 'as-is', without any express or implied warranty. In n
authors be held liable for any damages arising from the use of this software. Permission is granted
to anyone to use this software for any purpose, including commercial applications, and to alter it
and redistribute it freely.

<!-- TAG_VERSION -->
[badge-latest-release]: https://img.shields.io/badge/latest--release-1.0.5--alpha-blue.svg?style=flat
[badge-license]: https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat

<!-- TAG_PLATFORMS -->
[badge-platform-android]: http://img.shields.io/badge/-android-6EDB8D.svg?style=flat
[badge-platform-ios]: http://img.shields.io/badge/-ios-CDCDCD.svg?style=flat
[badge-platform-jvm]: http://img.shields.io/badge/-jvm-DB413D.svg?style=flat
[badge-platform-js]: http://img.shields.io/badge/-js-F8DB5D.svg?style=flat
[badge-platform-js-node]: https://img.shields.io/badge/-nodejs-68a063.svg?style=flat
101 changes: 98 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
import java.util.Base64

val publishedMavenId: String = "io.iohk.atala.prism.didcomm"

plugins {
id("org.jetbrains.dokka") version "1.9.10"
id("maven-publish")
id("signing")
id("io.github.gradle-nexus.publish-plugin") version "2.0.0-rc-1"
id("org.jlleitschuh.gradle.ktlint") version "11.6.1"
}

buildscript {
Expand All @@ -13,15 +19,16 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.22")
classpath("com.android.tools.build:gradle:7.2.2")
classpath("org.jetbrains.dokka:dokka-base:1.9.10")
}
}

group = publishedMavenId

allprojects {
version = "1.0.5-alpha"
group = "io.iohk.atala.prism.didcomm"
group = publishedMavenId

repositories {
google()
Expand All @@ -35,9 +42,81 @@ allprojects {
}
}

apply(plugin = "org.jlleitschuh.gradle.ktlint")
apply(plugin = "org.gradle.maven-publish")
apply(plugin = "org.gradle.signing")

publishing {
publications {
withType<MavenPublication> {
groupId = publishedMavenId
artifactId = project.name
version = project.version.toString()
pom {
name.set("Atala PRISM DIDPeer")
description.set("DIDComm V2 & Peer:DID")
url.set("https://docs.atalaprism.io/")
organization {
name.set("IOG")
url.set("https://iog.io/")
}
issueManagement {
system.set("Github")
url.set("https://github.com/input-output-hk/atala-prism-didcomm-kmm")
}
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("[email protected]")
organization.set("IOG")
roles.add("developer")
url.set("https://github.com/hamada147")
}
developer {
id.set("elribonazo")
name.set("Javier Ribó")
email.set("[email protected]")
organization.set("IOG")
roles.add("developer")
}
developer {
id.set("cristianIOHK")
name.set("Cristian Gonzalez")
email.set("[email protected]")
organization.set("IOG")
roles.add("developer")
}
}
scm {
connection.set("scm:git:git://input-output-hk/atala-prism-didcomm-kmm.git")
developerConnection.set("scm:git:ssh://input-output-hk/atala-prism-didcomm-kmm.git")
url.set("https://github.com/input-output-hk/atala-prism-didcomm-kmm")
}
}
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)
}
}
}
repositories {
maven {
this.name = "GitHubPackages"
Expand All @@ -49,8 +128,24 @@ allprojects {
}
}
}

ktlint {
verbose.set(true)
outputToConsole.set(true)
}
}

rootProject.plugins.withType(NodeJsRootPlugin::class.java) {
rootProject.extensions.getByType(NodeJsRootExtension::class.java).nodeVersion = "16.17.0"
}

nexusPublishing {
repositories {
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"))
}
}
}
25 changes: 19 additions & 6 deletions didpeer/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# PeerDID

[![Kotlin](https://img.shields.io/badge/kotlin-1.8.20-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![Kotlin](https://img.shields.io/badge/kotlin-1.9.22-blue.svg?logo=kotlin)](http://kotlinlang.org)
![badge-license]
![badge-latest-release]

![android](https://camo.githubusercontent.com/b1d9ad56ab51c4ad1417e9a5ad2a8fe63bcc4755e584ec7defef83755c23f923/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d616e64726f69642d3645444238442e7376673f7374796c653d666c6174)
![ios](https://camo.githubusercontent.com/1fec6f0d044c5e1d73656bfceed9a78fd4121b17e82a2705d2a47f6fd1f0e3e5/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d696f732d4344434443442e7376673f7374796c653d666c6174)
![jvm](https://camo.githubusercontent.com/700f5dcd442fd835875568c038ae5cd53518c80ae5a0cf12c7c5cf4743b5225b/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d6a766d2d4442343133442e7376673f7374796c653d666c6174)
![js](https://camo.githubusercontent.com/3e0a143e39915184b54b60a2ecedec75e801f396d34b5b366c94ec3604f7e6bd/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d6a732d4638444235442e7376673f7374796c653d666c6174)
![getNode-js](https://camo.githubusercontent.com/d08fda729ceebcae0f23c83499ca8f06105350f037661ac9a4cc7f58edfdbca9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d6e6f64656a732d3638613036332e7376673f7374796c653d666c6174)
![badge-platform-android]
![badge-platform-ios]
![badge-platform-jvm]
![badge-platform-js]
![badge-platform-js-node]

![Atala Prism Logo](../Logo.png)

Expand Down Expand Up @@ -128,3 +130,14 @@ Example of DID documents:
- [Default] 2020 verification materials (`Ed25519VerificationKey2020` and `X25519KeyAgreementKey2020`) with multibase base58 (`publicKeyMultibase`) public key encoding.
- JWK (`JsonWebKey2020`) using JWK (`publicKeyJwk`) public key encoding
- 2018/2019 verification materials (`Ed25519VerificationKey2018` and `X25519KeyAgreementKey2019`) using base58 (`publicKeyBase58`) public key encoding.

<!-- TAG_VERSION -->
[badge-latest-release]: https://img.shields.io/badge/latest--release-1.0.5--alpha-blue.svg?style=flat
[badge-license]: https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat

<!-- TAG_PLATFORMS -->
[badge-platform-android]: http://img.shields.io/badge/-android-6EDB8D.svg?style=flat
[badge-platform-ios]: http://img.shields.io/badge/-ios-CDCDCD.svg?style=flat
[badge-platform-jvm]: http://img.shields.io/badge/-jvm-DB413D.svg?style=flat
[badge-platform-js]: http://img.shields.io/badge/-js-F8DB5D.svg?style=flat
[badge-platform-js-node]: https://img.shields.io/badge/-nodejs-68a063.svg?style=flat
Loading

0 comments on commit 5393a21

Please sign in to comment.