-
Notifications
You must be signed in to change notification settings - Fork 38
67 lines (67 loc) · 2.32 KB
/
ci.yaml
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
name: ci
on: push
env:
CI: true
jobs:
build:
if: "!contains(github.event.head_commit.message, 'ci skip')"
name: build
runs-on: ubuntu-22.04
steps:
# https://github.com/actions/checkout
- name: Checkout
uses: actions/checkout@v2
with:
# https://github.com/actions/checkout/issues/217
fetch-depth: 0
# do not overwrite github auth in release step
# https://github.com/lerna/lerna/issues/1957#issuecomment-702396095
persist-credentials: false
# https://github.com/actions/checkout/issues/217 pulls all tags (needed for lerna to correctly version)
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
# https://github.com/actions/setup-node
- name: Setup Node 20
uses: actions/setup-node@v2
with:
node-version: 20
- name: Install
run: yarn install --immutable
- name: Lint
run: yarn run lint
- name: Build Packages
run: yarn run build:pkgs
- name: Build Apps
run: yarn run build:apps
- name: Test
run: yarn run test
- name: Archive test artifacts
uses: actions/upload-artifact@v2
if: failure()
with:
name: cypress
path: |
examples/discovery-search-app/cypress/screenshots
- name: NPM Identity
if: github.ref == 'refs/heads/master'
run: |
echo "npmRegistries:" >> ~/.yarnrc.yml
echo " //registry.npmjs.org:" >> ~/.yarnrc.yml
echo " npmAuthToken: $NPM_TOKEN" >> ~/.yarnrc.yml
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
npm whoami
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Github Identity
if: github.ref == 'refs/heads/master'
run: |
git config --global push.default simple
git config --global user.email "[email protected]"
git config --global user.name "Watson Github Bot"
git config remote.origin.url https://x-access-token:[email protected]/$GITHUB_REPOSITORY
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Publish
if: github.ref == 'refs/heads/master'
run: yarn run lerna publish -y --create-release github
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}