11name : Version Bump
22
3+ permissions :
4+ contents : write
5+ pull-requests : write
6+
37on :
48 workflow_dispatch :
59 inputs :
1317 - minor
1418 - major
1519
20+
21+
1622jobs :
17- bump-version :
23+ bump :
1824 runs-on : ubuntu-latest
1925 steps :
20- - name : Checkout code
26+ - name : Checkout
2127 uses : actions/checkout@v5
2228 with :
23- token : ${{ secrets.GITHUB_TOKEN }}
2429 fetch-depth : 0
2530
26- - name : Setup pnpm
27- uses : pnpm/action-setup@v4
31+ - name : Universal Version Bump
32+ 2833 with :
29- version : 10.15.0
30- run_install : false
31-
32- - name : Set up Node
33- uses : actions/setup-node@v4
34- with :
35- node-version : 22
36-
37- - name : Install dependencies
38- run : pnpm install --frozen-lockfile
39-
40- - name : Generate new version
41- id : version
42- run : |
43- NEW_VERSION=$(pnpm version ${{ inputs.release_type }} --no-git-tag-version | awk '{print $NF}')
44- echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
45-
46- - name : Create new branch
47- run : |
48- git checkout -b release/${{ env.new_version }}
49-
50- - name : Commit & Push changes
51- run : |
52- git config user.name "github-actions[bot]"
53- git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
54- git add package.json pnpm-lock.yaml
55- git commit -m "chore(release): bump version to ${{ env.new_version }}"
56- git push origin release/${{ env.new_version }}
57-
58- - name : Create Pull Request
59- run : |
60- gh pr create \
61- --base main \
62- --head release/${{ env.new_version }} \
63- --title "Release: ${{ env.new_version }}" \
64- --body "Auto-generated release PR for version ${{ env.new_version }}"
34+ release_type : ${{ inputs.release_type }}
35+ git_tag : false
6536 env :
6637 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
67-
68- - name : Notify about Major Release (if major)
69- if : inputs.release_type == 'major'
70- run : |
71- echo "🚨 Major version update detected! Please review and merge manually."
0 commit comments