-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (63 loc) · 1.71 KB
/
create-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
72
73
74
name: Create Release
on:
push:
tags:
- '*.*.*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Build Library
run: |
yarn install
yarn build
- name: Extract Changelog
id: extract_changelog
run: |
# Set the delimiter
delimiter="---"
# Read the file and extract the first part
while read -r line
do
if [[ $line == "$delimiter" ]]
then
break
fi
echo $line >> release_body.md
done < "CHANGELOG.md"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body_path: release_body.md
draft: false
prerelease: false
- name: Publish to NPM
run: |
yarn config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
yarn publish --no-git-checks --access=public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Install Vuepress and Build Docs
run: |
cd docs
yarn install
yarn docs:build
- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: docs/docs/.vuepress/dist
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}