Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
191 changes: 191 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node:8.0

whitelist: &whitelist
paths:
- .npmignore
- coverage/*
- dist/*
- node_modules/*
- src/*
- test/*
- vendor/*
- CODE_OF_CONDUCT.md
- LICENSE.md
- package.json
- README.md
- tsconfig.json
- tslint.json
- yarn.lock
version: 2
jobs:
checkout:
<<: *defaults

steps:
- checkout

- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-

- run:
name: Install Dependencies
command: yarn install

- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

- persist_to_workspace:
root: ~/repo
<<: *whitelist

lint:
<<: *defaults

steps:
- attach_workspace:
at: ~/repo

- run:
name: Lint TypeScript code
command: yarn lint

test:
<<: *defaults

steps:
- attach_workspace:
at: ~/repo

- run:
name: Test TypeScript code
command: yarn test:cover

- persist_to_workspace:
root: ~/repo
<<: *whitelist

coveralls:
<<: *defaults

steps:
- attach_workspace:
at: ~/repo

- run:
name: Submit coverage report to Coveralls.io
command: yarn coveralls

build:
<<: *defaults

steps:
- attach_workspace:
at: ~/repo

- run:
name: Build TypeScript code
command: yarn build

- persist_to_workspace:
root: ~/repo
<<: *whitelist

deploy:
<<: *defaults

steps:
- attach_workspace:
at: ~/repo

- run:
name: Write NPM Token to ~/.npmrc
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc

- run:
name: Install dot-json package
command: npm install dot-json

- run:
name: Write version to package.json
command: $(yarn bin)/dot-json package.json version ${CIRCLE_TAG:1}

- run:
name: Publish to NPM
command: npm publish --access=public

workflows:
version: 2

build:
jobs:
- checkout
- test:
requires:
- checkout
- lint:
requires:
- checkout
- coveralls:
requires:
- test
- build:
requires:
- test
- lint

release:
jobs:
- checkout:
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
- test:
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
requires:
- checkout
- lint:
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
requires:
- checkout
- coveralls:
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
requires:
- test
- build:
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
requires:
- test
- lint
- deploy:
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
requires:
- build
26 changes: 0 additions & 26 deletions circle.yml

This file was deleted.