-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (56 loc) · 1.64 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
name: Release
on:
workflow_dispatch:
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache node modules
id: cache
uses: actions/cache@v3
with:
path: |
~/.cache
**/node_modules
key: cache-node-modules-${{ hashFiles('yarn.lock') }}
restore-keys: |
cache-node-modules-
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: yarn install
if: steps.cache.outputs.cache-hit != 'true'
shell: bash
run: yarn install --immutable
- name: Build
shell: bash
run: yarn build
- name: Conventional Changelog Action
id: changelog
uses: TriPSs/conventional-changelog-action@v4
with:
github-token: ${{ secrets.github_token }}
skip-on-empty: false
skip-commit: true
pre-changelog-generation: './update-package-json.js'
- name: GIT/NPM config
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish
shell: bash
run: npm publish --access public
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
with:
tag_name: ${{ steps.changelog.outputs.tag }}
release_name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}