-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (50 loc) · 1.4 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
name: Release & Publish
on:
push:
tags:
- 'release/v*'
jobs:
cd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- name: Cache npm modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Prettier
run: npm run prettier
- name: Lint
run: npm run lint
- name: Build
run: npm run build
- name: Test
run: npm test
- name: Get version
run: echo "::set-output name=NPM_VERSION::${GITHUB_REF#refs/*/v}"
id: npm-version
- name: Set version
run: npm version ${{steps.npm-version.outputs.NPM_VERSION}} --no-commit-hooks --no-git-tag-version
- name: NPM Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: GitHub release
uses: softprops/action-gh-release@v1
with:
name: ${{steps.npm-version.outputs.NPM_VERSION}}
files: |
README.md
LICENSE
package.json
dist/index.js
dist/index.d.ts