cashbill
Version:
A TypeScript library for making payments through CashBill gateway.
59 lines (55 loc) • 1.32 kB
YAML
version: 2
defaults:
docker:
- image: circleci/node:latest
working_directory: ~/repo
jobs:
build:
<<:
steps:
- checkout
- restore_cache:
name: Restore Npm Package Cache
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Install Dependencies
command: npm install
- save_cache:
name: Save Npm Package Cache
key: dependency-cache-{{ checksum "package.json" }}
paths:
- node_modules
- run:
name: Test
command: npm run test
- run:
name: Build
command: npm run build
- persist_to_workspace:
root: ~/repo
paths: .
- store_artifacts:
path: ./dist
destination: dist
release:
<<:
steps:
- attach_workspace:
at: ~/repo
- run:
name: Authenticate with registry
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc
- run:
name: Publish package
command: npm publish
workflows:
version: 2
build_and_release:
jobs:
- build
- release:
requires:
- build
filters:
branches:
only: master