Browse Source

Merge pull request #100 from Relayz-io/silvestr/put-web-client-in-registry

Add CD pipeline for web-client
develop
Predko Silvestr 2 years ago
parent
commit
842251d28e
No account linked to committer's email address
2 changed files with 52 additions and 49 deletions
  1. 42
    0
      .github/workflows/cd.yml
  2. 10
    49
      README.md

+ 42
- 0
.github/workflows/cd.yml View File

1
+name: CD
2
+
3
+on:
4
+  pull_request:
5
+    branches:
6
+      - develop
7
+    types:
8
+      - closed
9
+
10
+jobs:
11
+  build-and-push-package:
12
+    if: github.event.pull_request.merged == true
13
+    runs-on: ubuntu-latest
14
+    permissions:
15
+      contents: read
16
+      packages: write
17
+    steps:
18
+      - uses: actions/checkout@v3
19
+      - uses: actions/setup-node@v3
20
+        with:
21
+          node-version: lts/*
22
+          registry-url: https://npm.pkg.github.com
23
+          scope: "@relayz-io"
24
+      - uses: actions-rs/toolchain@v1
25
+        with:
26
+          toolchain: stable
27
+          target: wasm32-unknown-unknown
28
+      - name: Install wasm-pack
29
+        run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
30
+      - name: Build an npm package
31
+        run: wasm-pack build web-client --target bundler --scope relayz-io --out-dir ../pkg --release
32
+      - name: Publish an npm package
33
+        run: |
34
+          cd pkg
35
+
36
+          if npm publish; then
37
+            echo "Package published"
38
+          else
39
+            echo "Package not published"
40
+          fi
41
+        env:
42
+          NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

+ 10
- 49
README.md View File

1
-[![CI](https://github.com/Relayz-io/client/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/Relayz-io/client/actions/workflows/ci.yml)
2
-
3
 # Client
1
 # Client
4
 
2
 
3
+[![CI](https://github.com/Relayz-io/client/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/Relayz-io/client/actions/workflows/ci.yml)
4
+
5
 ## Common-API 🦆
5
 ## Common-API 🦆
6
-Library that is used among other repositories. Implements [```Borsh```](https://borsh.io/) implementation for structures and enums. Also contain Diffie-Hellman and Ed25519 **API**
7
 
6
 
8
-## Near-Client 🗿
9
-Client library for **Near RPC**
7
+Commonly used **API** among different dependencies. For example **key-exchange-server**
10
 
8
 
11
 ## Web-Client 🦘
9
 ## Web-Client 🦘
12
-Client library for communication from browser and *Near blockchain*. It's a high-level API. User doesn't need to understand how blockchain works.
10
+
11
+Client library for communication from browser and *Near blockchain*. It's a high-level **API**. User doesn't need to understand how blockchain works.
12
+
13
+### Usage of web-client library:
14
+
15
+Please follow the [official instructions](https://docs.github.com/en/enterprise-server@3.4/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#installing-a-package) to use the latest package.
13
 
16
 
14
 ### Build
17
 ### Build
18
+
15
 ```sh
19
 ```sh
16
 wasm-pack build web-client --target bundler --out-dir ../pkg
20
 wasm-pack build web-client --target bundler --out-dir ../pkg
17
 ```
21
 ```
30
 Then:
34
 Then:
31
 
35
 
32
 `docker-compose up`
36
 `docker-compose up`
33
-
34
-## Diagrams
35
-```mermaid
36
-sequenceDiagram
37
-    participant Initiator
38
-    participant Alice
39
-    participant Bob
40
-
41
-    Initiator->>Blockchain: create meeting with id
42
-    Initiator-->>Internet: share meeting Id
43
-    loop
44
-        Initiator->>Blockchain: wait for pub. key for Alice and Bob
45
-        activate Blockchain
46
-        Blockchain--)Initiator: receive pub key [Alice, Bob]
47
-        deactivate Blockchain
48
-    end
49
-    par
50
-        Bob->>Internet: get meeting id
51
-        activate Internet
52
-        Internet--)Bob: receive meeting id
53
-        deactivate Internet
54
-    and
55
-        Alice->>Internet: get meeting id
56
-        activate Internet
57
-        Internet--)Alice: receive meeting id
58
-        deactivate Internet
59
-    end
60
-    par
61
-        Bob->>Blockchain: put temp public key for Bob
62
-        activate Blockchain
63
-        Blockchain--)Bob: Initiator public key
64
-        deactivate Blockchain
65
-    and
66
-        Alice->>Blockchain: put temp public key for Alice
67
-        activate Blockchain
68
-        Blockchain--)Alice: Initiator public key
69
-        deactivate Blockchain
70
-    end
71
-    Initiator-->>RelayServer: Olm message(symetric key) by Bob pub key
72
-    RelayServer-->>Bob: Olm message(symetric key) by Bob pub key
73
-    Initiator-->>RelayServer: Olm message(symetric key) by Alice pub key
74
-    RelayServer-->>Alice: Olm message(symetric key) by Alice pub key
75
-```

Loading…
Cancel
Save