-
Notifications
You must be signed in to change notification settings - Fork 7
94 lines (81 loc) · 2.55 KB
/
dist.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
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
name: CI (distribution branch)
on:
push:
branches:
- main
- beta
jobs:
runTests:
name: Run tests suites, and upload coverage reports
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- run: npm ci
- name: Jest, ESLint
run: npm run ci:test
- name: Upload test reports
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Tests
path: reports/tests-junit.xml
reporter: jest-junit
- name: Storybook CI
id: chromatic
uses: chromaui/action@v11
with:
buildScriptName: "build-storybook"
exitOnceUploaded: true
onlyChanged: true
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
autoAcceptChanges: true
exitZeroOnChanges: true
- name: Storybook tests
run: npm run ci:test-storybook
env:
TARGET_URL: "${{ steps.chromatic.outputs.storybookUrl }}"
JEST_JUNIT_OUTPUT_DIR: "reports"
JEST_JUNIT_OUTPUT_NAME: "storybook-junit.xml"
- name: Upload test reports
uses: dorny/test-reporter@v1
with:
name: Storybook
path: reports/storybook-junit.xml
reporter: jest-junit
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
directory: ./coverage/
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
makeRelease:
if: contains(github.event.head_commit.message, 'chore(release):')
name: Make release
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- run: npm ci
- run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
- run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Publish release @beta
if: ${{ github.ref_name == 'beta' && contains(github.event.head_commit.message, '-beta.') }}
run: |
npm run publish-release:beta
- name: Publish release @latest
if: ${{ github.ref_name == 'main' && !contains(github.event.head_commit.message, '-beta.') }}
run: |
npm run publish-release:latest