-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (73 loc) · 2.13 KB
/
publish_npm.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
85
name: Publish
on:
workflow_dispatch:
inputs:
version-type:
type: choice
description: Which version type to bump
options:
- patch
- minor
- major
jobs:
publish:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Setup Node.js environment
uses: actions/setup-node@v4.2.0
with:
node-version: '22'
- name: Checkout
uses: actions/checkout@v4
- name: Test & Build
run: |
npm install
npm run test-ci
npm run build
- name: Version Bump
id: version-bump
uses: phips28/gh-action-bump-version@v11.0.7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PACKAGEJSON_DIR: projects/ngx-kel-agent/
with:
tag-prefix: 'v'
# Can't use commit wording because manually dispatched workflows don't contain the commits
version-type: ${{ github.event.inputs.version-type }}
- name: Rebuild
run: |
npm install
npm run build
- name: Publish
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: dist/ngx-kel-agent/package.json
- name: Create Release
uses: actions/create-release@v1
with:
tag_name: ${{ steps.version-bump.outputs.newTag }}
release_name: ${{ steps.version-bump.outputs.newTag }}
- name: Setup git user/email
run: |
git config --global user.name github-actions
git config --global user.email github-actions@github.com
- name: Checkout documentation
uses: actions/checkout@v4
with:
ref: doc
path: doc
- name: Generate documentation
run: |
mv doc/.git .docgit
npm run typedoc
mv .docgit doc/.git
- name: Publish documentation
run: |
COMMIT=`git rev-parse --short HEAD`
cd doc
git add -A
git commit -m "Generated documentation at $COMMIT"
git push origin doc