GitHub Action
Flutter Bump Version
v0.0.02
Latest version
It automatically increases the version property of your project's pubspec.yaml on every merged Pull Request.
- When a Pull Request is merged, it triggers the action. It won't triggered on closed Pull Requests.
- It will read the pubspec.yaml file and fetch your build number (the one after the '+').
- It will increase the build number by 1.
- It will update your version text (the one before the '+'), based on the new build number.
- It will commit and push the changes to the specified branch.
- If your version number is
1
, your version property will be updated to0.0.02+2
. - If your version number is
9
, your version property will be updated to0.0.10+10
. - If your version number is
10
, your version property will be updated to0.0.11+11
. - If your version number is
99
, your version property will be updated to0.1.00+100
. - If your version number is
100
, your version property will be updated to0.1.01+101
. - If your version number is
999
, your version property will be updated to1.0.00+1000
. - If your version number is
1000
, your version property will be updated to1.0.01+1001
. - If your version number is
9999
, your version property will be updated to10.0.01+10001
.
In your workflow file, add the following step:
- name: Bump Version
uses: RodXander/flutter-bump-version@v1
branch
: The branch where the changes will be pushed. Default:main
.token
: The GitHub token used to checkout and push. Default:${{ secrets.GITHUB_TOKEN }}
. On protected branches, you may need to create a Personal Access Token as shown here, set that token as a secret in your repository and pass it as input.