File tree Expand file tree Collapse file tree 1 file changed +76
-0
lines changed Expand file tree Collapse file tree 1 file changed +76
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Javascript Node CircleCI 2.0 configuration file
2
+ #
3
+ # Check https://circleci.com/docs/2.0/language-javascript/ for more details
4
+ #
5
+ version : 2
6
+ jobs :
7
+ build :
8
+ docker :
9
+ # specify the version you desire here
10
+ - image : circleci/node:7.10
11
+
12
+ # Specify service dependencies here if necessary
13
+ # CircleCI maintains a library of pre-built images
14
+ # documented at https://circleci.com/docs/2.0/circleci-images/
15
+ # - image: circleci/mongo:3.4.4
16
+
17
+ working_directory : ~/repo
18
+
19
+ steps :
20
+ - checkout
21
+
22
+ # Download and cache dependencies
23
+ - restore_cache :
24
+ keys :
25
+ - v1-dependencies-{{ checksum "package.json" }}
26
+ # fallback to using the latest cache if no exact match is found
27
+ - v1-dependencies-
28
+
29
+ - run : npm install
30
+
31
+ - save_cache :
32
+ paths :
33
+ - node_modules
34
+ key : v1-dependencies-{{ checksum "package.json" }}
35
+
36
+ # run build
37
+ - run :
38
+ name : " build dist files"
39
+ command : |
40
+ CIRCLE_TAG="$(git tag -l --points-at HEAD)"
41
+ echo ${CIRCLE_TAG} > circle_tag.txt
42
+ npm run build
43
+ - run :
44
+ root : ~/repo
45
+ command : |
46
+ tar czf vue-app-dist.tgz dist
47
+ - persist_to_workspace :
48
+ root : ~/repo
49
+ paths :
50
+ - dist
51
+ - ./*.tgz
52
+ - circle_tag.txt
53
+
54
+ publish :
55
+ docker :
56
+ - image : cibuilds/github:0.10
57
+ steps :
58
+ - attach_workspace :
59
+ at : ./
60
+ - run :
61
+ name : " Publish Release on GitHub"
62
+ command : |
63
+ CIRCLE_TAG=$(cat circle_tag.txt)
64
+ echo $CIRCLE_TAG
65
+ ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${CIRCLE_TAG} *.tgz
66
+ workflows :
67
+ version : 2
68
+ build_and_publish :
69
+ jobs :
70
+ - build
71
+ - publish :
72
+ requires :
73
+ - build
74
+ filters :
75
+ tags :
76
+ only : /^v.*/
You can’t perform that action at this time.
0 commit comments