forked from SAP-samples/ecmascript-monorepo-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
138 lines (131 loc) · 3.6 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
version: 2.1
jobs:
build-node14:
docker:
- image: circleci/node:14-browsers
working_directory: ~/repo
steps:
- run: sudo apt-get install libxss1
- checkout
- run: yarn
- run: yarn run ci
- run:
name: Define environment variable with lastest commit's message
command: |
echo 'export COMMIT_MESSAGE=$(git log -1 --pretty=format:"%s")' >> $BASH_ENV
source $BASH_ENV
- run:
name: Lint commit message
command: echo "$COMMIT_MESSAGE" | npx commitlint
- run:
command: cat ./coverage/lcov.info | ./node_modules/.bin/coveralls
environment:
COVERALLS_SERVICE_NAME: circle-ci
COVERALLS_GIT_BRANCH: ${CIRCLE_BRANCH}
build-node12:
docker:
- image: circleci/node:12-browsers
working_directory: ~/repo
steps:
- run: sudo apt-get install libxss1
- checkout
- run: yarn
- run: yarn run ci
build-node10:
docker:
- image: circleci/node:10-browsers
working_directory: ~/repo
steps:
- run: sudo apt-get install libxss1
- checkout
- run: yarn
- run: yarn run ci
compliance:
docker:
- image: circleci/python:3.6.4
working_directory: ~/workdir
steps:
- checkout
- run:
name: compliance check
command: |
pip3 install --user reuse
~/.local/bin/reuse lint
deploy-npm:
docker:
- image: circleci/node:12-browsers
working_directory: ~/repo
steps:
- run: sudo apt-get install libxss1
- checkout
- run: yarn --pure-lockfile
- run: yarn run ci
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
# To help debug when lerna detects changes to the working tree and fails the publish
- run: git status
- run: yarn run release:publish
prepare-vsix:
docker:
- image: circleci/node:12-browsers
working_directory: ~/repo
steps:
- run: sudo apt-get install libxss1
- checkout
- run: yarn
- run: yarn run ci
- run: mkdir -p artifacts && cp packages/*/*.vsix ./artifacts
- run:
name: "Inspect Artifacts Folder"
working_directory: ./artifacts
command: ls -la
- persist_to_workspace:
root: "./artifacts"
paths:
# https://golang.org/pkg/path/filepath/#Match
- "*.vsix"
deploy-gh-releases:
docker:
- image: circleci/golang:1.13
steps:
- attach_workspace:
at: ./artifacts
- run:
name: "Inspect Artifacts Folder"
working_directory: ./artifacts
command: ls -la
- run:
name: "Publish Release on GitHub"
command: |
go get github.com/tcnksm/ghr
VERSION=${CIRCLE_TAG}
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} ./artifacts/
workflows:
version: 2
voter:
jobs:
- build-node10
- build-node12
- build-node14
- compliance
release:
jobs:
- deploy-npm:
filters:
tags:
only: /^v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
- prepare-vsix:
filters:
tags:
only: /^v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
- deploy-gh-releases:
requires:
- prepare-vsix
filters:
tags:
only: /^v[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/