-
-
Notifications
You must be signed in to change notification settings - Fork 194
84 lines (72 loc) · 2.16 KB
/
eb-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
75
76
77
78
79
80
81
82
83
84
name: Release
on:
push:
tags:
- v*.*.*
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16'
registry-url: https://registry.npmjs.org
- name: Determine npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: Restore npm cache
uses: actions/cache@v3
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Npm Install
run: |
npm install [email protected] -g
pnpm install
- name: Version
id: version
run: |
tag=${GITHUB_REF/refs\/tags\//}
version=${tag#v}
echo "::set-output name=version::${version}"
- name: Build # build npm
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
npm run build -- ${{ steps.version.outputs.version }}
git config --global user.email "[email protected]"
git config --global user.name "theajack"
git checkout master
git add .
git commit -m "CI: push v${{ steps.version.outputs.version }}"
git push
- name: Build Docs
run: npm run build:docs -- ${{ steps.version.outputs.version }}
- name: Pages # github pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: docs
- name: Release # release
uses: release-drafter/release-drafter@v5
with:
version: ${{ steps.version.outputs.version }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
- name: Publish # npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}
run: |
cd npm
npm publish
- name: Purge # purge cdn
run: npm run purge