Skip to content

Bump Version and Create Release #10

Bump Version and Create Release

Bump Version and Create Release #10

Workflow file for this run

name: Bump Version and Create Release
on:
workflow_dispatch:
inputs:
type:
required: true
default: 'patch'
description: 'Bump type'
type: choice
options:
- patch
- minor
- major
permissions:
packages: write
contents: write
jobs:
bump-version:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/[email protected]
- uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 23.x
cache: pnpm
- name: Bump version
id: bump_version
run: |
pnpm version ${{ github.event.inputs.type }} -m "ci: bump version to %s"
echo "VERSION=$(node -p "require('./package.json').version")" >> "$GITHUB_ENV"
- name: Push changes
run: |
git config --global user.name 'Jonah'
git config --global user.email '[email protected]'
git push origin main --follow-tags
- name: Create a Release
uses: elgohr/Github-Release-Action@v5
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
title: Release ${{ env.VERSION }}
tag: ${{ env.VERSION }}
# - name: Create Release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: v${{ env.VERSION }}
# release_name: Release v${{ env.VERSION }}
# body: 'Automated release based on version bump to v${{ env.VERSION }}.'
# draft: false
# prerelease: false