Skip to content

Commit

Permalink
chore(CI): add CircleCI config (#48)
Browse files Browse the repository at this point in the history
* chore(CI): add CircleCI config

* chore: fix package-lock

package.json and package-lock got out of sync

* chore: set version to 0.0.0-no-version

Semantic Release handles versions now and it doesn't update them in the
repo. Having a version here would be just confusing as it would be out
of sync with the real version of the code anyway.
  • Loading branch information
Thomaash authored Aug 2, 2019
1 parent 4325c2a commit 7b50a6a
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 9 deletions.
118 changes: 118 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2.1

executors:
node:
docker:
- image: circleci/node:12.7
working_directory: ~/repo

jobs:
prepare:
executor: node

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: npm ci

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

- persist_to_workspace:
root: .
paths:
- '*'

build:
executor: node

steps:
- attach_workspace:
at: .

- run: npm run build

- persist_to_workspace:
root: .
paths:
- 'dist'

lint:
executor: node

steps:
- attach_workspace:
at: .

- run: npm run lint

test:
executor: node

steps:
- attach_workspace:
at: .

- run: npm run test-cov

release:
executor: node

steps:
- attach_workspace:
at: .

- run:
name: Prepare NPM
command: |
npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN
- run:
name: Prepare Git
command: |
git config user.email "[email protected]"
git config user.name "Tomáš Vyčítal"
- run:
name: Release
command: |
npx semantic-release
workflows:
version: 2

build:
jobs:
- prepare

- build:
requires:
- prepare

# - lint:
# requires:
# - prepare

- test:
requires:
- prepare

- release:
requires:
- prepare
- build
# - lint
- test
6 changes: 6 additions & 0 deletions .releaserc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
branch: master
plugins:
- '@semantic-release/commit-analyzer'
- '@semantic-release/release-notes-generator'
- '@semantic-release/npm'
- '@semantic-release/github'
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vis-network",
"version": "5.1.1",
"version": "0.0.0-no-version",
"description": "A dynamic, browser-based visualization library.",
"homepage": "http://visjs.org/",
"license": "(Apache-2.0 OR MIT)",
Expand Down

0 comments on commit 7b50a6a

Please sign in to comment.