-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (70 loc) · 2.06 KB
/
auto-publish.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
name: Publish new version
on:
push:
branches:
- main
- next
pull_request:
branches:
- main
- next
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Prepare
uses: ./.github/actions/checkout-install
- name: Test (unit)
run: pnpm test:unit
- name: Test Chromatic + Storybook
if: ${{ github.ref == 'refs/heads/main' || contains(github.event.head_commit.message, 'chromatic') }}
env:
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
run: pnpm chromatic
test-cli:
name: Test CLI
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Prepare
uses: ./.github/actions/checkout-install
- name: Build (CLI)
run: pnpm cli:build
- name: Test (CLI)
run: pnpm test:cli
npm-publish:
name: npm-publish
runs-on: ubuntu-latest
if: |
${{ github.event.head_commit.message == 'chore: publish'
&& github.ref == 'refs/heads/main' }}
needs:
- test
- test-cli
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Prepare
uses: ./.github/actions/checkout-install
- name: Publish with Lerna
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
DOCS_NPM_TOKEN: ${{ secrets.DOCS_NPM_TOKEN }}
run: |
pnpm -C packages/cli build
pnpm config set //registry.npmjs.org/:_authToken ${NPM_AUTH_TOKEN}
pnpm publish --access public
pnpm config set //registry.npmjs.org/:_authToken ${DOCS_NPM_TOKEN}
pnpm publish packages/cli --access public
pnpm publish packages/storybook --access public
pnpm publish packages/vitepress --access public
pnpm publish packages/vitest --access public
#npx lerna publish -y from-git