forked from yarnpkg/yarn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
202 lines (190 loc) 路 4.94 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
version: 2
docker_defaults: &docker_defaults
docker:
- image: yarnpkg/dev:latest
working_directory: ~/project/yarn
macos_defaults: &macos_defaults
macos:
xcode: "9.0"
working_directory: ~/project/yarn
attach_workspace: &attach_workspace
attach_workspace:
at: ~/project
install_steps: &install_steps
steps:
- checkout
- *attach_workspace
- restore_cache:
name: Restore node_modules cache
keys:
# WARNING: add `{{ arch }}` into the keys below and separate the installation steps
# for Linux and macOS if you ever need platform-specific dependencies
# (anything using node-gyp etc.)
- v2-node-{{ .Branch }}-{{ checksum "yarn.lock" }}
- v2-node-{{ .Branch }}-
- v2-node-
- run:
name: Install Dependencies
command: yarn install --frozen-lockfile
- save_cache:
name: Save node_modules cache
key: v2-node-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- node_modules/
- persist_to_workspace:
root: ~/project
paths:
- yarn
test_build: &test_build
run:
name: Build Yarn for testing
command: |
if [ "$CIRCLE_BRANCH" == 'master' ]; then
./scripts/set-dev-version.js
fi;
yarn build
test_run: &test_run
run:
name: Tests
command: |
# Limit maxWorkers to 3 to avoid OOM on CircleCI
yarn test-only --maxWorkers 3
test_steps: &test_steps
steps:
- *attach_workspace
- *test_build
- *test_run
default_filters: &default_filters
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+$/
jobs:
install:
<<: *docker_defaults
<<: *install_steps
lint:
<<: *docker_defaults
steps:
- *attach_workspace
- run:
name: Lint
command: yarn lint
build:
<<: *docker_defaults
steps:
- *attach_workspace
- run:
name: Build distribution
command: |
if [ "$CIRCLE_BRANCH" == 'master' ]; then
./scripts/set-dev-version.js
fi;
yarn build-dist
./scripts/build-deb.sh
- store_artifacts:
path: artifacts/
destination: yarnpkg
- persist_to_workspace:
root: ~/project
paths:
- yarn
test-linux-node8:
<<: *docker_defaults
<<: *test_steps
test-linux-node6:
<<: *docker_defaults
docker:
- image: node:6
<<: *test_steps
test-linux-node4:
<<: *docker_defaults
docker:
- image: node:4
<<: *test_steps
test-macos-node8:
<<: *macos_defaults
steps:
- run:
name: Install Node 8
command: |
brew uninstall --ignore-dependencies node
HOMEBREW_NO_AUTO_UPDATE=1 brew install node@8
- *attach_workspace
- *test_build
- *test_run
test-macos-node6:
<<: *macos_defaults
steps:
- run:
name: Install Node 6
command: |
brew uninstall --ignore-dependencies node
HOMEBREW_NO_AUTO_UPDATE=1 brew install node@6
brew link --force node@6
- *attach_workspace
- *test_build
- *test_run
publish:
<<: *docker_defaults
steps:
- *attach_workspace
- run:
name: Publish
command: |
# Only NPM is handled here - All other release files are handled in a webhook.
if [ "${CIRCLE_PROJECT_USERNAME}" == "yarnpkg" ]; then
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
./scripts/update-npm.sh
fi
notify:
webhooks:
# Handles uploading stable/RC releases to GitHub
- url: https://nightly.yarnpkg.com/release_circleci
# Handles archiving all builds onto the nightly build site
- url: https://nightly.yarnpkg.com/archive_circleci
workflows:
version: 2
install-test-build-and-publish:
jobs:
- install:
filters: *default_filters
- lint:
filters: *default_filters
requires:
- install
- test-linux-node8:
filters: *default_filters
requires:
- install
- test-linux-node6:
filters: *default_filters
requires:
- install
- test-linux-node4:
filters: *default_filters
requires:
- install
- test-macos-node6:
filters: *default_filters
requires:
- install
- test-macos-node8:
filters: *default_filters
requires:
- install
- build:
filters: *default_filters
requires:
- install
- publish:
filters:
<<: *default_filters
branches:
ignore: /.*/
requires:
- test-linux-node8
- test-linux-node6
- test-linux-node4
- test-macos-node8
- test-macos-node6
- lint
- build