@cohandv/semantic-release-update-versions

Semantic-release plugin to create a file of versions to publish


Keywords
release, semantic-release
License
MIT
Install
npm install @cohandv/semantic-release-update-versions@1.0.5

Documentation

@cohandv/semantic-release-update-versions

semantic-release plugin to create major, release, fix tags into a file for other CI to pick it up

Commitizen friendly Conventional Changelog semantic-release: angular Formatted with Biome

Step Description
prepare Prepares and writes the file with the atgs
verifyConditions Verifies that suffix are provided when multiple configurations are provided

Install

# For npm users
$ npm install --save-dev @cohandv/semantic-release-update-versions

# For yarn users
$ yarn add --dev @cohandv/semantic-release-update-versions

Usage

The plugin can be configured in the semantic-release configuration file:

Produce versions

{
    "plugins": [
        "@semantic-release/commit-analyzer",
        "@semantic-release/release-notes-generator",
        "@semantic-release/npm",
        [
            "@cohandv/semantic-release-update-versions"
        ]
    ]
}

Options

Options Description Default Required
filePath The directory where the file will be created. .
fileName The file name. semantic-release-versions.json
tags Array of string which can be static values like latest or environment variables like $NODE_ENV nextRelease.version
bumpParents Flag to bump related tags along with the specific release version (E.G: if set to true when publishing the 1.5.0 version it will also publish 1 and 1.5) false
suffix Suffix to add on the buildign image step 5. If multiple versions are provided this is mandatory

Example

Build and push single component

{
    "plugins": [
        "@semantic-release/commit-analyzer",
        "@semantic-release/release-notes-generator",
        "@semantic-release/npm",
        [
            "@cohandv/semantic-release-update-versions",
            {
              "config": [
                {
                  "tags": [
                    "latest",
                    "$NODE_ENV"
                  ],
                  "bumpParents": false,
                  "suffix": "sufix"
                }
              ]
            }
        ]
    ]
}

Build and push multiple components

{
    "plugins": [
        "@semantic-release/commit-analyzer",
        "@semantic-release/release-notes-generator",
        "@semantic-release/npm",
        [
            "@cohandv/semantic-release-update-versions",
            { 
                "config": [
                    {
                        "tags": ["latest", "$NODE_ENV", "component-1"],
                        "bumpParents": false,
                        "suffix": "component-1"
                    },
                    {
                        "tags": ["latest", "$NODE_ENV", "component-2"],
                        "bumpParents": false,
                        "suffix": "component-2"
                    }
                ]
            }
        ]
    ]
}

Run locally

npm install -g tsx
npx tsx src/localRun.ts