Skip to content

Latest commit

 

History

History
86 lines (58 loc) · 3.35 KB

WORKFLOWS.md

File metadata and controls

86 lines (58 loc) · 3.35 KB

Magical Workflows

Reusable workflows powered by Magical Actions and magical_version_bump.

Overview

The available reusable workflows include:

  • Bump version in project

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 a boolean. Acts as a trigger for major version.
  • trigger_minor - Must be a boolean. Acts as a trigger for minor version.
  • trigger_patch - Must be a boolean. Acts as a trigger for patch version.
  • bump_build - Must be a boolean. Whether to bump build version.
  • create_tag - Must be a boolean. Whether to create a tag after committing changes made.
  • rebuild_project - Must be a boolean. Whether to generate any build file and commit them too. Uses build_runner package.

Optional inputs include:

  • tag_prefix - Preferred prefix before tag version. Default value is v.
  • verify_build - Must be a boolean. Whether to run test verifying the generated files. Default value is false
  • path - Path to your yaml/json file. Default value is pubspec.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 branch
  • BOT_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.

Usage

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/bump_version.yaml@v2.1.1
        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 :

  1. Name of Author linked to GPG key
  2. Commit message

image

The corresponding tag will look like 👇🏼 depending on the prefix:

image