Skip to content

Commit

Permalink
feat: config github action publish npm
Browse files Browse the repository at this point in the history
  • Loading branch information
yubing744 committed Nov 14, 2022
1 parent a5de4f3 commit ef02f1e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish NPM bot

on:
workflow_dispatch:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: setup rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: wasm32-wasi
components: rustfmt,rust-src,clippy
default: true
profile: minimal
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '14.x'
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Javascript version of the move language compiler and disassemble

## Features
- Compiling move package into blob
- Compiling move package into blob and generate hash
- Disassemble contract

## Example
Expand Down Expand Up @@ -34,6 +34,9 @@ const startWasiTask = async () => {
const blobBuf = wasmfs.fs.readFileSync("/workspace/my-counter/target/starcoin/release/package.blob")
const base64Data = blobBuf.toString("base64")
console.log("my-counter blob:", base64Data)

const hash = wasmfs.fs.readFileSync("/workspace/my-counter/target/starcoin/release/hash.txt")
console.log("my-counter blob hash:", hash)
}

startWasiTask()
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@starcoin/move-js",
"version": "0.7.1",
"version": "0.8.0",
"description": "Javascript version of the Move language compiler, supports compiling Move code into Move bytecode in the browser.",
"keywords": [
"move",
Expand Down

0 comments on commit ef02f1e

Please sign in to comment.