Skip to content

Commit

Permalink
ci: overhaul (#55)
Browse files Browse the repository at this point in the history
- Use Vis Bot GitHub account.
- Build before NPM publish: places the proper version into the files.
- Lint TypeScript.
- Don't trigger release outside of master branch (it didn't release, but
took quite a lot of time to just say “not publishing”).
  • Loading branch information
Thomaash committed Aug 4, 2019
1 parent 2ad538c commit 43c9459
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 deletions.
37 changes: 27 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ executors:
docker:
- image: circleci/node:12.7
working_directory: ~/repo
environment:
GIT_AUTHOR_EMAIL: [email protected]
GIT_AUTHOR_NAME: vis-bot
GIT_COMMITTER_EMAIL: [email protected]
GIT_COMMITTER_NAME: vis-bot

jobs:
prepare:
Expand Down Expand Up @@ -50,14 +55,23 @@ jobs:
paths:
- 'dist'

lint:
lint_js:
executor: node

steps:
- attach_workspace:
at: .

- run: npm run lint
- run: npm run lint:js

lint_ts:
executor: node

steps:
- attach_workspace:
at: .

- run: npm run lint:ts

test:
executor: node
Expand All @@ -80,12 +94,6 @@ jobs:
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: |
Expand All @@ -102,10 +110,14 @@ workflows:
requires:
- prepare

# - lint:
# - lint_js:
# requires:
# - prepare

- lint_ts:
requires:
- prepare

- test:
requires:
- prepare
Expand All @@ -114,5 +126,10 @@ workflows:
requires:
- prepare
- build
# - lint
# - lint_js
- lint_ts
- test
filters:
branches:
only:
- master
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@
"css:network": "concat-glob-cli -f 'lib/{network,shared}/**/*.css' -o dist/vis-network.css",
"uglify:css:network": "uglifycss dist/vis-network.css > dist/vis-network.min.css",
"images:network": "cpy lib/network/img/* dist/img/network/",
"prepublishOnly": "npm run build",
"build": "npm run types:network && npm run js:network && npm run css:network && npm run uglify:css:network && npm run images:network",
"watch": "npm run css:network && npm run uglify:css:network && npm run images:network && rollup --watch --config rollup.config.js",
"watch-dev": "npm run watch-dev",
"lint": "eslint '{lib,test}/**/*.{m,}{j,t}s{x,}'",
"lint": "npm run lint:js && npm run lint:ts",
"lint:js": "eslint '{lib,test}/**/*.js'",
"lint:ts": "eslint '{lib,test}/**/*.ts'",
"clean": "rimraf 'dist/*'",
"postinstall": "opencollective postinstall || exit 0"
},
Expand Down

0 comments on commit 43c9459

Please sign in to comment.