Nightly Perpetrated Mischief

    @google/semantic-release-replace-plugin
    TypeScript icon, indicating that this package has built-in type declarations

    1.1.0 • Public • Published

    Semantic Release Replace Plugin

    npm Build Release codecov GitHub contributors semantic-release

    The @google/semantic-release-replace-plugin plugin provides functionality to update version strings througout a project allowing semantic release to be used in many different languages and build processes.

    Read more about Semantic Release.

    Install

    $ npm install @google/semantic-release-replace-plugin -D

    Usage

    The following example uses this plugin to demonstrate using semantic-release in a Python package where __VERSION__ is defined in the root __init__.py file.

    {
      "plugins": [
        "@semantic-release/commit-analyzer",
        [
          "@google/semantic-release-replace-plugin",
          {
            "replacements": [
              {
                "files": ["foo/__init__.py"],
                "from": "__VERSION__ = \".*\"",
                "to": "__VERSION__ = \"${nextRelease.version}\"",
                "results": [
                  {
                    "file": "foo/__init__.py",
                    "hasChanged": true,
                    "numMatches": 1,
                    "numReplacements": 1
                  }
                ],
                "countMatches": true
              }
            ]
          }
        ],
        [
          "@semantic-release/git",
          {
            "assets": ["foo/*.py"]
          }
        ]
      ]
    }

    Warning

    This plugin will not commit changes unless you specify assets for the @semantic-release/git plugin! This is highlighted below.

    [
      "@semantic-release/git",
      {
        "assets": ["foo/*.py"]
      }
    ]
    

    Options

    Please refer to the documentation for more options.

    Install

    npm i @google/semantic-release-replace-plugin

    DownloadsWeekly Downloads

    18,592

    Version

    1.1.0

    License

    Apache-2.0

    Unpacked Size

    24 kB

    Total Files

    5

    Last publish

    Collaborators

    • google-wombot
    • ofrobots
    • mrdoob