Skip to content

Commit 097dab5

Browse files
authored
Merge pull request #38 from dannyrb/ci/setup-semantic-release
ci: setup semantic release
2 parents e1c0376 + 1ebe923 commit 097dab5

File tree

13 files changed

+42369
-24726
lines changed

13 files changed

+42369
-24726
lines changed

.circleci/config.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Use the latest 2.1 version of CircleCI pipeline processing engine, see https://circleci.com/docs/2.0/configuration-reference/
2+
version: 2.1
3+
4+
defaults: &defaults
5+
working_directory: ~/repo
6+
# https://circleci.com/docs/2.0/circleci-images/#language-image-variants
7+
docker:
8+
- image: circleci/node:10.15.1
9+
environment:
10+
TERM: xterm # Enable colors in term
11+
12+
jobs:
13+
CHECKOUT:
14+
<<: *defaults
15+
steps:
16+
- checkout
17+
- restore_cache:
18+
name: Restore Package Cache
19+
keys:
20+
- packages-v1-{{ .Branch }}-{{ checksum "package.json" }}
21+
- packages-v1-{{ .Branch }}-
22+
- packages-v1-
23+
- run: npm ci
24+
- save_cache:
25+
name: Save Package Cache
26+
paths:
27+
- ~/repo/node_modules
28+
key: packages-v1-{{ .Branch }}-{{ checksum "package.json" }}
29+
- persist_to_workspace:
30+
root: ~/repo
31+
paths: .
32+
33+
BUILD_AND_TEST:
34+
<<: *defaults
35+
steps:
36+
- attach_workspace:
37+
at: ~/repo
38+
- run: npm run build && npm run test
39+
# https://circleci.com/docs/2.0/collect-test-data/#karma
40+
# - store_test_results:
41+
# path: reports/junit
42+
# - store_artifacts:
43+
# path: reports/junit
44+
- persist_to_workspace:
45+
root: ~/repo
46+
paths: .
47+
48+
NPM_PUBLISH:
49+
<<: *defaults
50+
steps:
51+
- attach_workspace:
52+
at: ~/repo
53+
- run:
54+
name: Avoid hosts unknown for github
55+
command:
56+
mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking
57+
no\n" > ~/.ssh/config
58+
- run:
59+
name: Publish using Semantic Release
60+
command: npx semantic-release
61+
62+
workflows:
63+
version: 2
64+
65+
# PULL REQUEST
66+
PULL_REQUEST:
67+
jobs:
68+
- CHECKOUT:
69+
filters:
70+
branches:
71+
ignore:
72+
- master
73+
- feature/*
74+
- hotfix/*
75+
- BUILD_AND_TEST:
76+
requires:
77+
- CHECKOUT
78+
79+
# MERGE TO MASTER
80+
TEST_AND_RELEASE:
81+
jobs:
82+
- CHECKOUT:
83+
filters:
84+
branches:
85+
only: master
86+
- BUILD_AND_TEST:
87+
requires:
88+
- CHECKOUT
89+
- NPM_PUBLISH:
90+
requires:
91+
- BUILD_AND_TEST

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ yarn-debug.log*
2222
yarn-error.log*
2323
.idea
2424
.yalc
25-
yalc.lock
25+
yalc.lock
26+
yarn.lock

example/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ public/cornerstoneWADOImageLoader.min.js
44
public/cornerstoneWADOImageLoader.min.js.map
55
public/cornerstoneWADOImageLoaderCodecs.min.js
66
public/cornerstoneWADOImageLoaderWebWorker.min.js
7-
public/cornerstoneWADOImageLoaderWebWorker.min.js.map
7+
public/cornerstoneWADOImageLoaderWebWorker.min.js.map
8+
9+
yarn.lock

0 commit comments

Comments
 (0)