Version Bump #1
This file contains hidden or 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: Version Bump | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'New version (e.g., 1.0.1, 1.1.0, 2.0.0)' | |
| required: true | |
| type: string | |
| jobs: | |
| bump-version: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Update version in build.gradle | |
| run: | | |
| sed -i "s/^version = '.*'/version = '${{ github.event.inputs.version }}'/" build.gradle | |
| cat build.gradle | grep "^version = " | |
| - name: Commit version bump | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add build.gradle | |
| git commit -m "chore: bump version to ${{ github.event.inputs.version }}" | |
| git push | |
| - name: Trigger release workflow | |
| run: | | |
| echo "Version bumped to ${{ github.event.inputs.version }}" | |
| echo "The release workflow will be triggered automatically by the push event" | |