Generate tag version #40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate tag version | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: New version | |
required: true | |
default: 'prerelease' | |
type: choice | |
options: | |
- patch | |
- minor | |
- major | |
- prerelease | |
jobs: | |
version: | |
name: Create new version ${{ github.event.inputs.version }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 18.x | |
- name: Generate new version | |
run: | | |
if [ "${{ github.event.inputs.version }}" == "prerelease" ]; then | |
npm version prerelease --preid=beta | |
else | |
npm version ${{ github.event.inputs.version }} | |
fi | |
- name: Push new version tag to repository | |
run: git push origin main --tags |