Bump Version and Create Release #8
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: 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 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 |