Reusable workflows powered by Magical Actions and magical_version_bump.
The available reusable workflows include:
- Bump version in project
This workflow bumps
the version, creates a tag
and commits
it to the repo that called it.
The required inputs include:
trigger_major
- Must be aboolean
. Acts as a trigger formajor
version.trigger_minor
- Must be aboolean
. Acts as a trigger forminor
version.trigger_patch
- Must be aboolean
. Acts as a trigger forpatch
version.bump_build
- Must be aboolean
. Whether to bump build version.create_tag
- Must be aboolean
. Whether to create a tag after committing changes made.rebuild_project
- Must be aboolean
. Whether to generate any build file and commit them too. Usesbuild_runner
package.
Optional inputs include:
tag_prefix
- Preferred prefix before tag version. Default value isv
.verify_build
- Must be aboolean
. Whether to run test verifying the generated files. Default value isfalse
path
- Path to your yaml/json file. Default value ispubspec.yaml
.
You also have to pass in some secrets
to give workflow access to change and commit them to your repo. These include:
ACCESS_TOKEN
- helps bypass repo restrictions on default branchBOT_GPG_KEY
- A GPG key to sign the commits & tags.
Read more on generating a GPG key here.
Read more on generating an access token here.
Read more on adding secrets to your workflow here.
This workflow can only be triggered as job and not a step. Learn more
The example below is triggered based on label present when PR is merged.
jobs:
update-version:
needs: verify-merge
uses: kekavc24/magical_workflows/.github/workflows/[email protected]
with:
trigger_major: ${{contains(github.event.pull_request.labels.*.name, 'major release')}}
trigger_minor: ${{contains(github.event.pull_request.labels.*.name, 'minor release')}}
trigger_patch: ${{contains(github.event.pull_request.labels.*.name, 'patch release')}}
bump_build: true
create_tag: true
tag_prefix: ''
secrets:
ACCESS_TOKEN: ${{ secrets.TOKEN }}
BOT_GPG_KEY: ${{ secrets.BOT_GPG_KEY }}
# Will bump the target that is true between major, minor & patch.
# Also bumps the build-number
# Creates a tag and pushes it to the repo
The commit in your repo will have :
- Name of Author linked to GPG key
- Commit message
The corresponding tag will look like 👇🏼 depending on the prefix: