GeezerVison is showing github.com — chore: create publish docs.yml · Gpia/lowcode-engine@a87dcaa
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboard +51Lines changed: 51 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 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 | + |
| 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 | + }) |
Collapse file
Copy file name to clipboardExpand all lines: docs/package.json +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | { |
2 | 2 | "name": "@alilc/lowcode-engine-docs", |
3 | | - "version": "1.2.5", |
| 3 | + "version": "1.2.6", |
4 | 4 | "description": "低代码引擎版本化文档", |
5 | 5 | "license": "MIT", |
6 | 6 | "files": [ |
|