-
Notifications
You must be signed in to change notification settings - Fork 10
65 lines (50 loc) · 1.55 KB
/
release-new-version.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
name: Release new version
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 'Use Node.js'
uses: actions/setup-node@v1
with:
node-version: 18
- name: 'Setup cache for node_modules'
id: cache-node-modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- name: 'Prepare git'
run: |
git config --global user.email "[email protected]"
git config --global user.name "github version update"
git branch -u origin/master master
- name: 'Install project'
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install
- name: 'Check code style'
run: yarn lint
- name: 'Run unit tests'
run: yarn test:coverage
- name: 'Upload code coverage'
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: 'Build project'
run: yarn build
- name: 'Increase version and push to git'
run: |
yarn release
yarn release:push
- name: 'Copy required files to release'
run: |
cp ./package.json ./dist/package.json
cp ./README.md ./dist/README.md
- name: 'Publish release to npm'
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./dist/package.json