forked from iotaledger/iota-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (50 loc) · 1.69 KB
/
bindings-wasm-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Wasm publish to NPM
on: workflow_dispatch
env:
CARGO_INCREMENTAL: 0
jobs:
publish-wasm:
runs-on: ubuntu-latest
defaults:
run:
working-directory: bindings/wasm
steps:
- uses: actions/checkout@v3
- name: Set up Rust
uses: ./.github/actions/setup-rust
with:
targets: "wasm32-unknown-unknown"
# Download a pre-compiled wasm-bindgen binary.
- name: Install wasm-bindgen-cli
uses: jetli/[email protected]
with:
version: "0.2.91"
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
- name: Install Yarn
run: npm i -g yarn
- name: Install JS dependencies
run: yarn
- name: Build project
run: yarn build
- name: Publish WASM bindings to NPM
shell: sh
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn publish --access public
- name: Prepare Github release
id: prepare_release
run: |
yarn pack
echo "tag_name=iota-sdk-wasm-v$(cat package.json | jq -r '.version')" >> "$GITHUB_OUTPUT"
- name: Upload package to Github release
uses: softprops/action-gh-release@v1
with:
# Token expires Jan 25, 2025
token: ${{ secrets.GH_RELEASE_PUBLISH_PAT }}
body: "https://github.com/iotaledger/iota-sdk/blob/develop/bindings/wasm/CHANGELOG.md \n https://github.com/iotaledger/iota-sdk/blob/develop/bindings/nodejs/CHANGELOG.md"
files: bindings/wasm/*.tgz
tag_name: ${{ steps.prepare_release.outputs.tag_name }}