|
1 | 1 | name: Version Bump |
2 | 2 |
|
| 3 | +permissions: |
| 4 | + contents: write |
| 5 | + pull-requests: write |
| 6 | + |
3 | 7 | on: |
4 | 8 | workflow_dispatch: |
5 | 9 | inputs: |
|
13 | 17 | - minor |
14 | 18 | - major |
15 | 19 |
|
| 20 | + |
| 21 | + |
16 | 22 | jobs: |
17 | | - bump-version: |
| 23 | + bump: |
18 | 24 | runs-on: ubuntu-latest |
19 | 25 | steps: |
20 | | - - name: Checkout code |
| 26 | + - name: Checkout |
21 | 27 | uses: actions/checkout@v5 |
22 | 28 | with: |
23 | | - token: ${{ secrets.GITHUB_TOKEN }} |
24 | 29 | fetch-depth: 0 |
25 | 30 |
|
26 | | - - name: Setup pnpm |
27 | | - uses: pnpm/action-setup@v4 |
| 31 | + - name: Universal Version Bump |
| 32 | + |
28 | 33 | with: |
29 | | - version: 10.13.1 |
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 |
65 | 36 | env: |
66 | 37 | 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