2021-04-17 06:17:27 +08:00
|
|
|
name: Manage version
|
2021-04-17 06:06:00 +08:00
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
tag:
|
|
|
|
description: '<newversion> | major | minor | patch'
|
|
|
|
required: true
|
|
|
|
default: 'patch'
|
|
|
|
jobs:
|
|
|
|
checkout:
|
|
|
|
name: checkout
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-04-17 06:12:22 +08:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup NodeJS and run build
|
|
|
|
uses: actions/setup-node@v1
|
2021-04-17 06:06:00 +08:00
|
|
|
with:
|
|
|
|
node-version: 12
|
|
|
|
- run: |
|
|
|
|
npm install
|
|
|
|
npm run lint
|
|
|
|
npm run build
|
2021-04-17 06:12:22 +08:00
|
|
|
- name: Setup version and git tag
|
2021-04-17 06:06:00 +08:00
|
|
|
if: ${{ github.event.inputs.tag != '' }}
|
|
|
|
run: |
|
2021-04-17 06:22:34 +08:00
|
|
|
npm version ${{ github.event.inputs.tag }
|
2021-04-17 06:08:19 +08:00
|
|
|
git tag -a v${{ github.event.inputs.tag }} -m "v${{ github.event.inputs.tag }}"
|
2021-04-17 06:22:34 +08:00
|
|
|
- name: Push changes
|
|
|
|
run: git push
|