-
Notifications
You must be signed in to change notification settings - Fork 3
79 lines (67 loc) · 2.3 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
name: Publish Package to npmjs
on:
pull_request:
branches:
- master
types:
- closed
jobs:
release:
name: Build and release
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install Node, NPM and Yarn
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Install modules
run: |
yarn install --frozen-lockfile
- name: Build
run: |
yarn build
- name: Lint
run: |
yarn lint
- name: Test
run: |
yarn test
- name: Git config
run: |
git config --global user.email "[email protected]" && git config --global user.name "bot"
password=${{ secrets.GITHUB_TOKEN }}
- name: Apply version major
if: contains(github.event.pull_request.labels.*.name, 'major')
run: npm version major
- name: Apply version minor
if: contains(github.event.pull_request.labels.*.name, 'minor')
run: npm version minor
- name: Apply version patch
if: contains(github.event.pull_request.labels.*.name, 'patch')
run: npm version patch
- name: Publish npm version
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Generate docs
run: |
yarn docs
- name: Upload docs
uses: actions/upload-artifact@v3
with:
name: docs-files
path: ./docs
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: docs-files
path: ./docs
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs