| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- name: Version Bump
- on:
- workflow_dispatch:
- inputs:
- bump:
- description: 'Type of version bump'
- required: true
- type: choice
- options:
- - patch
- - minor
- - major
- permissions:
- contents: write
- pull-requests: write
- jobs:
- bump-version:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- with:
- token: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Use Node.js 20.x
- uses: actions/setup-node@v4
- with:
- node-version: '20.x'
- cache: 'npm'
-
- - name: Configure Git
- run: |
- git config --global user.name 'github-actions[bot]'
- git config --global user.email 'github-actions[bot]@users.noreply.github.com'
-
- - name: Install dependencies
- run: npm ci
-
- - name: Bump version
- run: |
- npm version ${{ github.event.inputs.bump }} -m "chore: bump version to %s"
- echo "NEW_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
-
- - name: Push changes
- run: |
- git push origin HEAD:refs/heads/version-bump-${{ env.NEW_VERSION }}
- git push origin --tags
-
- - name: Create Pull Request
- uses: peter-evans/create-pull-request@v6
- with:
- token: ${{ secrets.GITHUB_TOKEN }}
- branch: version-bump-${{ env.NEW_VERSION }}
- title: 'chore: bump version to ${{ env.NEW_VERSION }}'
- body: |
- This PR bumps the version to ${{ env.NEW_VERSION }}.
-
- After merging, a new release will be created automatically.
- labels: |
- version-bump
- automated
|