|
@@ -0,0 +1,42 @@
|
|
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}}
|