-
Notifications
You must be signed in to change notification settings - Fork 483
116 lines (111 loc) · 3.17 KB
/
release.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
name: Clay Release
on:
workflow_dispatch:
inputs:
version:
required: false
description: 'Defines a specific version (e.g 3.70.0)'
type: string
jobs:
test:
name: Unit tests and lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.x'
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
run: yarn install
- name: Lint
run: yarn lint
- name: Format
run: yarn format:check
- name: Verify Dependencies
run: yarn checkDeps
- name: Run Jest
env:
BROWSERSLIST_CONFIG: './packages/browserslist-config-clay/config'
BROWSERSLIST_DISABLE_CACHE: 1
CI: true
run: yarn test
uiTest:
name: Visual Testing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
run: yarn install
- name: Build
run: yarn build
- name: UI Tests
env:
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
run: yarn chromatic
version:
name: Cut version
needs: [test, uiTest]
runs-on: ubuntu-latest
outputs:
new_sha: ${{ steps.sha.outputs.SHA }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: '16.x'
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn
- run: |
git config user.name github-actions
git config user.email [email protected]
- name: Version
run: yarn lerna:version ${{ github.event.inputs.version }} --no-push --yes
- run: git push origin master --follow-tags
- name: Get SHA
id: sha
run: |
sha_new=$(git rev-parse HEAD)
echo $sha_new
echo "::set-output name=SHA::$sha_new"
- run:
echo ${{ steps.sha.outputs.SHA }}
publish:
name: Publish
needs: version
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
ref: ${{ needs.version.outputs.new_sha }}
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
scope: '@clayui'
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: NPM Identity
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
- name: Publish
run: yarn lerna:publish