Opinionated action to manage releases tag life-cycle in a mono-repo with multiple components
This action helps to manage the release lifecycle and workflow in a monorepo. The action is able to tag individual components and the product itself.
The action was created to support a specific git workflow but might be used in other ways.
The workflow proposed is based on Trunk Based Development with release branches
You can find a repository using this action here: https://github.com/intelygenz/monorepo-ci-cd-poc/
A component is part of a product but its lifecycle is managed independently. You can create component releases (major/minor)
by merging a component change in main
or you can create a component fix by merging component changes in a release
branch.
You can work in a component making direct commits to main
or a release
branch or by working in feature branches and
merging them back (to main
or release
branch)
The product release lifecycle is tied to the components. Each time a new component version is created an automatic product
version is created. If you are merging a component into main
, then a product pre-release is generated. When the product
is ready for the next release, then a new release
branch is created and a new product version generated in that release
branch.
The release
branch can be deleted, or it can live for as long as you need to give support to that release. If you delete
the branch you can restore it from the release tag created.
The action has two outputs:
- TAG: the tag is the tag that was created (eg. component-v1.0.1)
- VERSION: the version is the number in the tag (eg. 1.0.1)
When creating a new tag in the repository you can update version files with the new version being released. Only yaml
files are supported.
To update a version file when creating a new tag you can specify it in the input parameters:
- name: Generate a release tag for Component1
uses: intelygenz/[email protected]
with:
mode: 'component'
type: 'final'
component-prefix: "comp1-"
update-versions-in: '[{"file": "metaapp/values.yaml", "property": "helloWorld.tag"}]'
commit-message: 'My custom commit message'
commit-author: 'Me'
commit-author-email: '[email protected]'
Action inputs are documented in action.yml file
- name: Generate a release tag for Component1
uses: intelygenz/[email protected]
with:
mode: 'component'
type: 'final'
component-prefix: "comp1-"
- name: Generate a fix tag for Component1
uses: intelygenz/[email protected]
with:
mode: 'component'
type: 'fix'
component-prefix: 'comp1-'
current-tag: ${{ steps.component_version.outputs.TAG }}
- name: Generate a pre-release product tag
uses: intelygenz/[email protected]
with:
mode: 'product'
type: 'pre-release'
current-major: 0
release-branch-prefix: 'release/v'
pre-release-name: 'rc'
- name: Create a new release branch
uses: intelygenz/[email protected]
with:
mode: 'product'
type: 'new-release-branch'
release-branch-prefix: 'release/v'
- name: Generate a final product tag
uses: intelygenz/[email protected]
with:
mode: 'product'
type: 'final'
- name: Generate a fix product tag
uses: intelygenz/[email protected]
with:
mode: 'product'
type: 'fix'
release-branch-prefix: "release/v"