Skip to content

Minimal updates required for downstream cardano-wallet #479

Minimal updates required for downstream cardano-wallet

Minimal updates required for downstream cardano-wallet #479

Workflow file for this run

name: TypeScript NPM Package
on:
pull_request:
push:
branches: [ "master" ]
tags: [ "*.*.*" ]
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: jsapi
env:
NODE_OPTIONS: "--max-old-space-size=5120"
steps:
- name: '📥 Checkout Code'
uses: actions/checkout@v2.3.4
- uses: cachix/install-nix-action@v13
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
extra_nix_config: |
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
substituters = https://cache.iog.io https://cache.nixos.org/
- name: 'Install dependencies'
run: 'nix-shell --run "npm install"'
- name: 'Build'
run: 'nix-shell --run "npm run build"'
- name: 'Test'
run: 'nix-shell --run "npm run test"'
- name: 'Typedoc'
run: 'nix-shell --run "npm run typedoc"'
- name: 'Demo'
run: 'nix-build -A demo -o result-demo'
- name: 'Prepare Documentation'
run: |
mkdir ../_build
mv _docs ../_build/typescript
cp -R --no-preserve=all ./result-demo/share/doc/cardano-addresses-demo-js ../_build/demo
- name: '📤 Publish Documentation'
if: ${{ startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build
enable_jekyll: true
keep_files: true
user_name: 'William King Noel Bot'
user_email: 'adrestia@iohk.io'
- name: 'npm publish'
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
tag="${GITHUB_REF/refs\/tags\//}"
package_version="$(jq -r .version package.json)"
echo "tag=$tag\npackage_version=$package_version"
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
nix-shell --run "npm publish"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}