-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (54 loc) · 1.33 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
name: Release & Publish Package
on:
push:
branches:
- main
paths:
- CHANGELOG.md
jobs:
release:
name: Create release package
runs-on: ubuntu-latest
steps:
- name: Checkout to code
uses: actions/checkout@v4
- name: install Node js Version 20.x
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Retrieve Release Version
run: echo "PV=$(node version.js)" >> $GITHUB_ENV
- run: cat change-log
- name: Retrieve Release Body
run: |
{
echo 'PB<<EOF'
cat change-log
echo EOF
} >> $GITHUB_ENV
- run: echo ${{env.PV}}
- name: Create Github Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{env.PV}}
release_name: Release v${{env.PV}}
body: ${{env.PB}}
publish:
name: Publish to NPM
needs: release
runs-on: ubuntu-latest
steps:
- name: Checkout to code
uses: actions/checkout@v4
- name: install Node js Version 20.x
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- name: publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}