1.0.1 • Published 2 years ago

semantic-release-yaml-file-on-change v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

semantic-release-yaml-file-on-change

This is a plugin for semantic-release. It updates version attribute of any yaml file *.yaml, if and only if the file is included in the modified files within a commit.

The version is increased according to nextRelease.type, which can be one of

  • major
  • premajor
  • minor
  • preminor
  • patch
  • prepatch
  • prerelease

or null if it's not valid.

Examples

version 0.1.0
  1. patch (1.16.0 -> 1.16.1)
    New version is 0.1.1

  2. minor (1.16.0 -> 1.17.0)
    New version is 0.2.0

  3. major (1.16.0 -> 2.0.0)
    New version is 1.0.0

Configuration

  • yamlFilePath (required) - string
    path of the yaml file

  • selector (required) - string Version attribute name, it can be version, appVersion, serviceVersion or any other thing you like.

Example

This will update indexVersion in ./src/index.yaml semantically.

{
  "plugins": [
    [
      "semantic-release-yaml-file-on-change",
      {
        yamlFilePath: './src/index.yaml',
        selector: 'indexVersion'
      }
    ]
  ]
}

Then add to the release commit that will be pushed to the remote Git repository with:

{
  "plugins": [
    [
      "@semantic-release/git",
      {
        "assets": [
          "./src/index.yaml"
        ],
        "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
      }
    ]
  ]
}