Skip to content

Commit a87dcaa

Browse files
liujupingJackLian
authored andcommitted
chore: create publish docs.yml
1 parent 28fdf9a commit a87dcaa

File tree

2 files changed

+52
-1
lines changed

2 files changed

+52
-1
lines changed

.github/workflows/publish docs.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Update and Publish Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
paths:
8+
- 'docs/**'
9+
10+
jobs:
11+
publish-docs:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v2
17+
with:
18+
node-version: '14'
19+
registry-url: 'https://registry.npmjs.org'
20+
- run: cd docs && npm install
21+
- run: |
22+
cd docs
23+
npm version patch
24+
git config --local user.email "[email protected]"
25+
git config --local user.name "GitHub Action"
26+
git add package.json
27+
git commit -m "Update package version"
28+
git push
29+
- run: cd docs && npm publish
30+
env:
31+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
32+
- name: Get version
33+
id: get_version
34+
run: echo "::set-output name=version::$(node -p "require('./docs/package.json').version")"
35+
36+
comment-pr:
37+
needs: publish-docs
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Comment on PR
41+
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
42+
uses: actions/github-script@v4
43+
with:
44+
github-token: ${{ secrets.GITHUB_TOKEN }}
45+
script: |
46+
github.issues.createComment({
47+
issue_number: context.issue.number,
48+
owner: context.repo.owner,
49+
repo: context.repo.repo,
50+
body: '🚀 New version has been released: ' + '${{ needs.publish-docs.outputs.version }}'
51+
})

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@alilc/lowcode-engine-docs",
3-
"version": "1.2.5",
3+
"version": "1.2.6",
44
"description": "低代码引擎版本化文档",
55
"license": "MIT",
66
"files": [

0 commit comments

Comments
 (0)