linux-command/.github/workflows/ci.yml

84 lines
2.8 KiB
YAML

name: CI
on:
push:
branches:
- master
jobs:
build-deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- name: Generate Contributors Images
uses: jaywcjlove/github-action-contributors@main
with:
filter-author: (renovate\[bot\]|renovate-bot|dependabot\[bot\])
avatarSize: 42
- run: npm install
- run: npm run build
- run: node build/dash.js
- name: Compress linux-command.docset.
run: zip -r -y linux-command.docset.zip . -x "node_modules/*"
working-directory: .deploy/linux-command.docset
- run: cp -rp .deploy/linux-command.docset/linux-command.docset.zip ../../
- run: rm -rf .deploy/linux-command.docset
- run: cp CONTRIBUTORS.svg .deploy
- name: Create Tag
id: create_tag
uses: jaywcjlove/create-tag-action@v1.3.6
with:
package-path: ./package.json
- name: get tag version
id: tag_version
uses: jaywcjlove/changelog-generator@v1.5.3
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
commit_message: '[${{steps.tag_version.outputs.tag}}] ${{ github.event.head_commit.message }}'
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./.deploy
user_name: github-actions[bot]
user_email: github-actions[bot]@users.noreply.github.com
- name: Generate Changelog
id: changelog
uses: jaywcjlove/changelog-generator@v1.5.3
with:
filter-author: (小弟调调™)
filter: (^[\s]+?[R|r]elease)|(^[R|r]elease)
- name: Create Release
uses: ncipollo/release-action@v1
if: steps.create_tag.outputs.successful
with:
artifacts: 'linux-command.docset.zip'
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ steps.create_tag.outputs.version }}
tag: ${{ steps.create_tag.outputs.version }}
body: |
[![](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/linux-command@${{steps.create_tag.outputs.versionNumber}}/file/README.md) [![npm bundle size](https://img.shields.io/bundlephobia/minzip/linux-command)](https://bundlephobia.com/result?p=linux-command@${{steps.create_tag.outputs.versionNumber}})
```bash
npm i linux-command@${{steps.create_tag.outputs.versionNumber}}
```
${{ steps.changelog.outputs.compareurl }}
${{ steps.changelog.outputs.changelog }}
Document linux-command@${{ steps.changelog.outputs.tag }}:
https://raw.githack.com/jaywcjlove/linux-command/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html
- run: npm install @jsdevtools/npm-publish -g
- run: npm-publish --token="${{ secrets.NPM_TOKEN }}" ./package.json