Skip to content

CEP-18 v1.2.0

CEP-18 v1.2.0 #4

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: publish-casper-cep18-js-client
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-22.04
strategy:
matrix:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version: [16.x, 20.x]
steps:
- name: Checkout
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b #v3.0.2
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
components: rustfmt, clippy
# Needed for gcc install
- run: sudo apt update && sudo apt install -y build-essential wabt
- uses: Swatinem/rust-cache@v1
- run: make prepare
- run: make build-contract
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@5b949b50c3461bbcd5a540b150c368278160234a #v3.4.0
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
- name: Install
working-directory: ./client-js
run: npm install
- name: Generate WASMS
working-directory: ./client-js
run: npm run generate:wasm
- name: build
working-directory: ./client-js
run: npm run build
- name: test
working-directory: ./client-js
run: npm run test:unit
- name: Publish to NPM
working-directory: ./client-js
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}