-
Notifications
You must be signed in to change notification settings - Fork 3
71 lines (58 loc) · 1.7 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
name: Release
on:
push:
tags:
- v*
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js to publish to npm
uses: actions/setup-node@v4
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.com'
- name: Cache node modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-cache-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn
- name: Run tests
run: |
yarn lint
yarn test
- name: Get package version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
- name: Get changelog
id: changelog
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ steps.package-version.outputs.current-version }}
- name: Publish npm package
run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Setup Node.js to publish to GitHub Packages
uses: actions/setup-node@v4
with:
node-version: '16.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@smartbear'
- name: Create GitHub release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.package-version.outputs.current-version }}
release_name: v${{ steps.package-version.outputs.current-version }}
body: ${{ steps.changelog.outputs.changes }}
- name: Publish GitHub package
run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}