-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
54 lines (47 loc) · 1.25 KB
/
.travis.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
language: node_js
node_js:
- '12'
install:
- npm ci
cache:
npm: false
git:
depth: false
branches:
only:
- main
stages:
# Pull request
- name: lint
if: type = pull_request
- name: test (unit)
if: type = pull_request
# Merge on main
- name: publish
if: type = push AND branch = main
jobs:
include:
# Pull request
- stage: lint
script:
npx lerna exec -- npm ci &&
npx lerna bootstrap &&
npx lerna run lint
- stage: test (unit)
script:
npx lerna exec -- npm ci &&
npx lerna bootstrap &&
npx lerna run test:unit
# Merge on main
- stage: publish
script: >-
git remote set-url origin "https://$GH_USER:[email protected]/$TRAVIS_REPO_SLUG.git" &&
git checkout main &&
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc &&
npm whoami
npx lerna exec -- npm ci &&
npx lerna publish --contents dist --yes --no-verify-access &&
lerna clean --yes && lerna exec "npm install --ignore-scripts --package-lock-only --no-audit" &&
git add packages/*/package-lock.json &&
git commit -m "[skip ci] chore(build): update package-lock files" &&
git push origin HEAD:main