Skip to content

build: add workflow to auto bump version #4

build: add workflow to auto bump version

build: add workflow to auto bump version #4

Workflow file for this run

name: Bump
on:
pull_request:
# workflow_dispatch:
# inputs:
# releaseType:
# description: 'Release type'
# type: choice
# required: true
# default: patch
# options:
# - patch
# - minor
# - major
jobs:
bump:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get tags
run: git fetch --tags
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: v20
- name: Get latest version
id: latest
run: |
LATEST=$(git describe --tags)
echo "version=$LATEST" >> "$GITHUB_OUTPUT"
- name: Get next version
id: next
run: |
NEXT=$(npx --yes semver -i ${{ github.event.inputs.releaseType }} ${{ steps.latest.outputs.version }})
echo "version=$NEXT" >> "$GITHUB_OUTPUT"
- name: Generate release
run: echo "gh release create v${{ steps.next.outputs.version }} --generate-notes"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}