Skip to content

Deploy Version

Deploy Version #19

Workflow file for this run

name: Deploy Version
on:
workflow_dispatch:
inputs:
version:
description: 'Version to increment (major, minor or patch)'
required: true
default: 'patch'
jobs:
npm:
runs-on: ubuntu-latest
env:
VERSION: ${{ github.event.inputs.version }}
steps:
- run: |
if [[ "$VERSION" != "major" ]] && [[ "$VERSION" != "minor" ]] && [[ "$VERSION" != "patch" ]]; then
echo "Input should be either 'major', 'minor' or 'patch'"
exit 1
fi
- run: |
git config --global user.name "${{ secrets.GIT_USER_NAME }}"
git config --global user.email "${{ secrets.GIT_USER_EMAIL }}"
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4.2.0
with:
node-version: 14.x
- run: npm ci
- run: npm version $VERSION
- name: NPM Publish
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
- run: |
echo "TAG=$(npm run env | grep npm_package_version | cut -d '=' -f 2)" >> $GITHUB_ENV
- name: Create Github Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: refs/tags/${{ env.TAG }}
release_name: Version ${{ env.TAG }}
body: Version ${{ env.TAG }}