2021-04-16 22:28:36 +00:00
|
|
|
name: Release
|
2021-04-16 22:06:00 +00: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-16 22:12:22 +00:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2021-04-16 22:36:22 +00:00
|
|
|
- run: |
|
|
|
|
git config user.name github-actions
|
|
|
|
git config user.email github-actions@github.com
|
2021-04-16 22:12:22 +00:00
|
|
|
- name: Setup NodeJS and run build
|
|
|
|
uses: actions/setup-node@v1
|
2021-04-16 22:06:00 +00:00
|
|
|
with:
|
|
|
|
node-version: 12
|
|
|
|
- run: |
|
2021-04-16 22:39:39 +00:00
|
|
|
npm ci
|
2021-04-16 22:06:00 +00:00
|
|
|
npm run lint
|
|
|
|
npm run build
|
2021-04-16 22:28:36 +00:00
|
|
|
- name: Setup version
|
2021-04-16 22:06:00 +00:00
|
|
|
if: ${{ github.event.inputs.tag != '' }}
|
|
|
|
run: |
|
2021-04-16 22:24:54 +00:00
|
|
|
npm version ${{ github.event.inputs.tag }}
|
2021-04-16 22:28:36 +00:00
|
|
|
git push
|
|
|
|
- name: Add tag
|
|
|
|
run: git tag -a v${{ github.event.inputs.tag }} -m "v${{ github.event.inputs.tag }}"
|