1.1.0 • Published 1 year ago

semantic-release-git-publish v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

semantic-release-git-publish

NPM Version Run tests

A semantic-release plugin that publishes by syncing the contents of the working directory to another Git repository and tagging that repository with the release version.

Use cases

This plugin was developed to facilitate publishing a Swift package inside of a monorepo. Along with the semantic-release-monorepo plugin, the Swift subpackage of the monorepo can be be "published" to it's own standalone repo for public consumption.

There may be other use cases where this plugin is useful, such as creating a public copy of a private repository.

Plugin steps

StepDescription
verifyConditionsVerifies that the destinationRepositoryUrl option is set to a valid Git repository.
publishClones the destination repository, updates the content to match the current working directory, commits the changes, and tags the commit with the release version.

Install

Install the plugin as a development dependency with

npm install semantic-release-git-publish --save-dev

Usage

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

{
  "plugins": [
    "@semantic-release/git",
    [
      "semantic-release-git-publish",
      {
        "destinationRepositoryUrl": "git@gitlab.com:destination-repository.git",
        "ignorePaths": [
          "secret.txt",
          "**/*.secret"
        ]
      }
    ]
  ]
}

Configuration

Options

OptionsDescriptionDefault
destinationRepositoryUrlThe path to the destination repository
ignorePaths(Optional) An array of glob patterns to exclude from file syncing. Matching files in the working directory will not get synced to the destination repo or be modified in the destination repo if they already exist. Globs are minimatch patterns.

Known limitations

This plugin does not currently handle symlinks and possibly some other cases. It handles all scenarios involving changing files and directories. Anything not supported will log an error and cause the publish step to fail. For more details, see /src/utils/syncFiles.ts.

1.1.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago