Skip to content

Create a new version #22

Create a new version

Create a new version #22

Workflow file for this run

name: Create a new version
on:
workflow_dispatch:
inputs:
version:
description: Type of version bump
required: true
type: choice
options:
- patch
- minor
- major
permissions:
contents: write
jobs:
version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: npm
- name: Configure git
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
- name: Bump version
id: npm-version
run: echo "version=`npm version ${{ github.event.inputs.version }}`" >> "$GITHUB_OUTPUT"
- name: Push commit and tag
run: git push --follow-tags
- name: Create release in GitHub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ steps.npm-version.outputs.version }}
run: |
gh release create "$TAG" --verify-tag --generate-notes