Skip to content

Commit

Permalink
Use CircleCI v2
Browse files Browse the repository at this point in the history
  • Loading branch information
sbstjn committed Nov 14, 2017
1 parent f8b71c7 commit 84c501c
Show file tree
Hide file tree
Showing 2 changed files with 189 additions and 26 deletions.
189 changes: 189 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,189 @@
defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node:8.0

whitelist: &whitelist
paths:
- .npmignore
- coverage/*
- dist/*
- node_modules/*
- src/*
- test/*
- CODE_OF_CONDUCT.md
- LICENSE.md
- package.json
- README.md
- tsconfig.json
- tslint.json
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.

0 comments on commit 84c501c

Please sign in to comment.