Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 12 additions & 46 deletions .github/workflows/version-bump.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Version Bump

permissions:
contents: write
pull-requests: write

on:
workflow_dispatch:
inputs:
Expand All @@ -13,59 +17,21 @@ on:
- minor
- major



jobs:
bump-version:
bump:
runs-on: ubuntu-latest
steps:
- name: Checkout code
- name: Checkout
uses: actions/checkout@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Universal Version Bump
uses: taj54/universal-version-bump@v0.9.0
with:
version: 10.15.0
run_install: false

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Generate new version
id: version
run: |
NEW_VERSION=$(pnpm version ${{ inputs.release_type }} --no-git-tag-version | awk '{print $NF}')
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV

- name: Create new branch
run: |
git checkout -b release/${{ env.new_version }}

- name: Commit & Push changes
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add package.json pnpm-lock.yaml
git commit -m "chore(release): bump version to ${{ env.new_version }}"
git push origin release/${{ env.new_version }}

- name: Create Pull Request
run: |
gh pr create \
--base main \
--head release/${{ env.new_version }} \
--title "Release: ${{ env.new_version }}" \
--body "Auto-generated release PR for version ${{ env.new_version }}"
release_type: ${{ inputs.release_type }}
git_tag: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Notify about Major Release (if major)
if: inputs.release_type == 'major'
run: |
echo "🚨 Major version update detected! Please review and merge manually."