-
Notifications
You must be signed in to change notification settings - Fork 26
57 lines (47 loc) · 1.35 KB
/
tag.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
name: Publish version to NPM
on:
push:
tags:
- '*.*.*'
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Get version from tag
id: lasttag
run: echo ::set-output name=version::${GITHUB_REF#refs/tags/v}
- name: Checkout Repo
uses: actions/checkout@v4
- name: Parse Changelog Entry
id: changelog
uses: mindsers/changelog-reader-action@v2
with:
version: v${{ steps.lasttag.outputs.version }}
- uses: actions/setup-node@v4
with:
node-version: '16'
- name: Cache NPM modules
id: npm-cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install dependencies
run: npm ci
- name: Build Component
run: npm run package
- name: Publish Package
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./package.json
- name: Create GitHub Release
id: create_release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body: ${{ steps.changelog.outputs.changes }}