Skip to content

Commit

Permalink
ci: add manual trigger for docs update & extra documents
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmed Moussa <[email protected]>
  • Loading branch information
hamada147 committed Nov 30, 2023
1 parent 7f16819 commit 4ba4801
Show file tree
Hide file tree
Showing 10 changed files with 279 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
To submit a new issue, please, use one of the following templates:

https://github.com/input-output-hk/atala-prism-didcomm-kmm/issues/new/choose

Thank you!
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/1-bug-report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Bug Report
description: Report a bug in the Atala PRISM DIDComm

body:
- type: dropdown
id: is-regression
attributes:
label: Is this a regression?
options:
- 'Yes'
- 'No'
validations:
required: true

- type: textarea
id: description
attributes:
label: Description
validations:
required: true

- type: textarea
id: exception-or-error
attributes:
label: Please provide the exception or error you saw

- type: textarea
id: environment
attributes:
label: Please provide the environment you discovered this bug in

- type: textarea
id: other
attributes:
label: Anything else?
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/2-feature-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: 'Feature Request'
description: Suggest a new feature for Atala PRISM DIDComm

body:
- type: textarea
id: proposed-feature
attributes:
label: Proposed feature
validations:
required: true

- type: textarea
id: description
attributes:
label: Feature description
validations:
required: true

- type: textarea
id: other
attributes:
label: Anything else?
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
blank_issues_enabled: false
28 changes: 28 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Overview
<!-- What this PR does, and why is needed, a useful description is expected, and relevant tickets should be mentioned -->

Fixes #<issue number>

## Checklist

### My PR contains...
* [ ] No code changes (changes to documentation, CI, metadata, etc.)
* [ ] Bug fixes (non-breaking change which fixes an issue)
* [ ] Improvements (misc. changes to existing features)
* [ ] Features (non-breaking change which adds functionality)

### My changes...
* [ ] are breaking changes
* [ ] are not breaking changes
* [ ] If yes to above: I have updated the documentation accordingly

### Documentation
* [ ] My changes do not require a change to the project documentation
* [ ] My changes require a change to the project documentation
* [ ] If yes to above: I have updated the documentation accordingly

### Tests
* [ ] My changes can not or do not need to be tested
* [ ] My changes can and should be tested by unit and/or integration tests
* [ ] If yes to above: I have added tests to cover my changes
* [ ] If yes to above: I have taken care to cover edge cases in my tests
59 changes: 59 additions & 0 deletions .github/workflows/release-documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
# kics-scan ignore
name: "Release Documentation"

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 }}

on:
workflow_dispatch:
push:
tags:
- "*"

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"

- name: "Dokka Documentation Generation"
run: |
./gradlew dokkaHtml
- name: "Push"
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: gh-pages # The branch name where you want to push the assets
FOLDER: "apollo/build/dokka/html/" # The directory where your assets are generated
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub will automatically add this - you don't need to bother getting a token
MESSAGE: "feat(docs): ({sha}) {msg}" # The commit message
41 changes: 36 additions & 5 deletions apollo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackOutput.Target
import org.jetbrains.kotlin.gradle.tasks.CInteropProcess
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.net.URL

val currentModuleName: String = "Apollo"
val os: OperatingSystem = OperatingSystem.current()
Expand Down Expand Up @@ -314,14 +315,43 @@ ktlint {
}

// Dokka implementation
tasks.withType<DokkaTask> {
moduleName.set(project.name)
tasks.withType<DokkaTask>().configureEach {
moduleName.set(currentModuleName)
moduleVersion.set(rootProject.version.toString())
description = "This is a Kotlin Multiplatform Library for cryptography"
pluginConfiguration<org.jetbrains.dokka.base.DokkaBase, org.jetbrains.dokka.base.DokkaBaseConfiguration> {
customAssets = listOf(rootDir.resolve("Logo.png"))
}
dokkaSourceSets {
// TODO: Figure out how to include files to the documentations
named("commonMain") {
includes.from("Module.md", "docs/Module.md")
configureEach {
jdkVersion.set(11)
languageVersion.set("1.8.20")
apiVersion.set("2.0")
includes.from(
"docs/Base64.md",
"docs/SecureRandom.md",
)
sourceLink {
localDirectory.set(projectDir.resolve("src"))
remoteUrl.set(URL("https://github.com/input-output-hk/atala-prism-apollo/tree/main/src"))
remoteLineSuffix.set("#L")
}
externalDocumentationLink {
url.set(URL("https://kotlinlang.org/api/latest/jvm/stdlib/"))
}
externalDocumentationLink {
url.set(URL("https://kotlinlang.org/api/kotlinx.serialization/"))
}
externalDocumentationLink {
url.set(URL("https://api.ktor.io/"))
}
externalDocumentationLink {
url.set(URL("https://kotlinlang.org/api/kotlinx-datetime/"))
packageListUrl.set(URL("https://kotlinlang.org/api/kotlinx-datetime/"))
}
externalDocumentationLink {
url.set(URL("https://kotlinlang.org/api/kotlinx.coroutines/"))
}
}
}
}
Expand All @@ -335,6 +365,7 @@ npmPublish {
named("js") {
scope.set("atala")
packageName.set("apollo")
readme.set(rootDir.resolve("README.md"))
packageJson {
author {
name.set("IOG")
Expand Down
50 changes: 50 additions & 0 deletions apollo/docs/Base64.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Package io.iohk.atala.prism.apollo.base64

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

![android](https://camo.githubusercontent.com/b1d9ad56ab51c4ad1417e9a5ad2a8fe63bcc4755e584ec7defef83755c23f923/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d616e64726f69642d3645444238442e7376673f7374796c653d666c6174)
![apple-silicon](https://camo.githubusercontent.com/a92c841ffd377756a144d5723ff04ecec886953d40ac03baa738590514714921/687474703a2f2f696d672e736869656c64732e696f2f62616467652f737570706f72742d2535424170706c6553696c69636f6e2535442d3433424246462e7376673f7374796c653d666c6174)
![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)
![macos](https://camo.githubusercontent.com/1b8313498db244646b38a4480186ae2b25464e5e8d71a1920c52b2be5212b909/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d6d61636f732d3131313131312e7376673f7374796c653d666c6174)
![tvos](https://camo.githubusercontent.com/4ac08d7fb1bcb8ef26388cd2bf53b49626e1ab7cbda581162a946dd43e6a2726/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d74766f732d3830383038302e7376673f7374796c653d666c6174)
![watchos](https://camo.githubusercontent.com/135dbadae40f9cabe7a3a040f9380fb485cff36c90909f3c1ae36b81c304426b/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d77617463686f732d4330433043302e7376673f7374796c653d666c6174)

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

Apollo Base64 is Kotlin Multiplatform library containing:

- Standard
- URL safe

## Supported Targets

| Platform | Supported |
|------------------------------------------|--------------------|
| iOS x86 64 | :heavy_check_mark: |
| iOS Arm 64 | :heavy_check_mark: |
| iOS Arm 32 | :heavy_check_mark: |
| iOS Simulator Arm 64 (Apple Silicon) | :heavy_check_mark: |
| JVM | :heavy_check_mark: |
| Android | :heavy_check_mark: |
| JS Browser | :heavy_check_mark: |
| NodeJS Browser | :heavy_check_mark: |
| macOS Arm 64 (Apple Silicon) | :heavy_check_mark: |

## Usage

### Base64 Standard

```kotlin
val helloWorld = "V2VsY29tZSB0byBJT0c=".base64Decoded // "Hello, world!"
println("Welcome to IOG".base64Encoded) // Prints "SGVsbG8sIHdvcmxkIQ=="
```

### Base64 URL

```kotlin
val helloWorld = "V2VsY29tZSB0byBJT0c".base64UrlDecoded // "Hello, world!"
println("Welcome to IOG".base64UrlEncoded) // Prints "SGVsbG8sIHdvcmxkIQ"
```
38 changes: 38 additions & 0 deletions apollo/docs/SecureRandom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Package io.iohk.atala.prism.apollo.securerandom

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

![android](https://camo.githubusercontent.com/b1d9ad56ab51c4ad1417e9a5ad2a8fe63bcc4755e584ec7defef83755c23f923/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d616e64726f69642d3645444238442e7376673f7374796c653d666c6174)
![apple-silicon](https://camo.githubusercontent.com/a92c841ffd377756a144d5723ff04ecec886953d40ac03baa738590514714921/687474703a2f2f696d672e736869656c64732e696f2f62616467652f737570706f72742d2535424170706c6553696c69636f6e2535442d3433424246462e7376673f7374796c653d666c6174)
![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)
![macos](https://camo.githubusercontent.com/1b8313498db244646b38a4480186ae2b25464e5e8d71a1920c52b2be5212b909/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d6d61636f732d3131313131312e7376673f7374796c653d666c6174)
![tvos](https://camo.githubusercontent.com/4ac08d7fb1bcb8ef26388cd2bf53b49626e1ab7cbda581162a946dd43e6a2726/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d74766f732d3830383038302e7376673f7374796c653d666c6174)
![watchos](https://camo.githubusercontent.com/135dbadae40f9cabe7a3a040f9380fb485cff36c90909f3c1ae36b81c304426b/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d77617463686f732d4330433043302e7376673f7374796c653d666c6174)

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

Apollo Secure Random is Kotlin Multiplatform library to generate secure random bytes

## Supported Targets

| Platform | Supported |
|------------------------------------------|--------------------|
| iOS x86 64 | :heavy_check_mark: |
| iOS Arm 64 | :heavy_check_mark: |
| iOS Arm 32 | :heavy_check_mark: |
| iOS Simulator Arm 64 (Apple Silicon) | :heavy_check_mark: |
| JVM | :heavy_check_mark: |
| Android | :heavy_check_mark: |
| JS Browser | :heavy_check_mark: |
| NodeJS Browser | :heavy_check_mark: |
| macOS Arm 64 (Apple Silicon) | :heavy_check_mark: |

## Usage

```kotlin
val iv: ByteArray = SecureRandom().nextBytes(16)
val seed: ByteArray = SecureRandom.generateSeed(10)
```
7 changes: 2 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin

plugins {
id("org.jetbrains.dokka") version "1.7.10"
id("org.jetbrains.dokka") version "1.9.10"
id("org.jlleitschuh.gradle.ktlint") version "11.6.1"
id("maven-publish")
id("org.jetbrains.kotlinx.kover") version "0.7.2"
Expand All @@ -17,6 +17,7 @@ buildscript {
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20")
classpath("com.android.tools.build:gradle:7.2.2")
classpath("org.jetbrains.dokka:dokka-base:1.9.10")
}
}

Expand Down Expand Up @@ -87,7 +88,3 @@ subprojects {
rootProject.plugins.withType(NodeJsRootPlugin::class.java) {
rootProject.extensions.getByType(NodeJsRootExtension::class.java).nodeVersion = "16.17.0"
}

tasks.dokkaGfmMultiModule.configure {
outputDirectory.set(buildDir.resolve("dokkaCustomMultiModuleOutput"))
}

0 comments on commit 4ba4801

Please sign in to comment.