release.yml

1name: Release
2
3on:
4  push:
5    tags:
6      - 'v*'
7
8jobs:
9  release:
10    runs-on: ubuntu-latest
11    steps:
12      - uses: actions/checkout@v3
13        with:
14          fetch-depth: 0
15
16      - name: Setup Node.js
17        uses: actions/setup-node@v3
18        with:
19          node-version: '20.x'
20          cache: 'npm'
21
22      - name: Install dependencies
23        run: npm i
24
25      - name: Build
26        run: npm run build
27
28      - name: Generate changelog
29        id: changelog
30        uses: metcalfc/changelog-generator@v4.0.1
31        with:
32          myToken: ${{ secrets.GITHUB_TOKEN }}
33
34      - name: Create Release
35        uses: softprops/action-gh-release@v1
36        with:
37          body: ${{ steps.changelog.outputs.changelog }}
38          files: |
39            dist/**
40            LICENSE
41            README.md
42        env:
43          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}