7.1.1 ā€¢ Published 6 months ago

@qiwi/multi-semantic-release v7.1.1

Weekly downloads
1,114
License
0BSD
Repository
github
Last release
6 months ago

@qiwi/multi-semantic-release

hacky semantic-release for monorepos

Travis CI Maintainability Test Coverage npm (scoped)

This fork of dhoub/multi-semantic-release replaces setImmediate loops and execa.sync hooks with event-driven flow and finally makes possible to run the most release operations in parallel.
šŸŽ‰ šŸŽ‰ šŸŽ‰

Status

We're still using this lib as a part of our release infra, but we're gradually migrating to bulk-release. This means that we do not have many resources to develop this implementation actively, but we will continue to do it on a leftover basis.

Install

yarn add @qiwi/multi-semantic-release --dev

Usage

multi-semantic-release

Configuring Multi-Semantic-Release

multi-semantic-release can be configured a number of ways:

  • A .multi-releaserc file, written in YAML or JSON, with optional extensions: .yaml/ .yml/ .json/ .js
  • A multi-release.config.js file that exports an object
  • A multi-release key in the workspace root package.json

Alternatively some options may be set via CLI flags.

Note: CLI arguments take precedence over options configured in the configuration file.

Options

OptionTypeCLI FlagDescription
dryRunboolean--dry-runDry run mode.
logLevelString--log-levelSets the internal logger verbosity level: error, warn, info, debug, trace. Defaults to info.
debugboolean--debugOutput debugging information. Shortcut for --logLevel=debug.
silentboolean--silentTurns off any log outputs.
extendsString \| ArrayN/AList of modules or file paths containing a shareable configuration. If multiple shareable configurations are set, they will be imported in the order defined with each configuration option taking precedence over the options defined in the previous.
sequentialInitboolean--sequential-initAvoid hypothetical concurrent initialization collisions.
sequentialPrepareboolean--sequential-prepareAvoid hypothetical concurrent preparation collisions. True by default.
firstParentboolean--first-parentApply commit filtering to current branch only.
ignorePrivateboolean--ignore-privateExclude private packages. True by default.
ignorePackagesString \| Array--ignore-packagesPackages list to be ignored on bumping process (appended to the ones that already exist at package.json workspaces). If using the CLI flag, supply a comma seperated list of strings.
tagFormatString--tag-formatFormat to use when creating tag names. Should include "name" and "version" vars. Default: "${name}@${version}" which generates "package-name@1.0.0"
depsObjectN/ADependency handling, see below for possible values.

deps Options

OptionTypeCLI FlagDescription
bumpoverride \| satisfy \| inherit--deps.bumpDefine deps version updating rule. Allowed: override, satisfy, inherit. override by default.
releasepatch \| minor \| major \| inherit--deps.releaseDefine release type for dependent package if any of its deps changes. Supported values: patch, minor, major, inherit. patch by default
prefix'^' \| '~' \| ''--deps.prefixOptional prefix to be attached to the next version if bump is set to override. '' by default.
pullTagsForPrereleaseboolean--deps.pullTagsForPrereleaseOptional flag to use release tags for evaluating prerelease version bumping. Normally, this option will lead to dumping dependencies to a version past what was just released and tagged by semantic release. Only set this option to true if you previously had a workflow that compensated for the previous bug behavior. 'false' by default.

Examples

  • Via multi-release key in the project's package.json file:
{
	"multi-release": {
		"ignorePackages": [
			"!packages/b/**",
			"!packages/c/**"
		],
		"deps": {
			"bump": "inherit"
		}
	}
}
  • Via .multi-releaserc file:
{
	"ignorePackages": [
		"!packages/b/**",
		"!packages/c/**"
	],
	"deps": {
		"bump": "inherit"
	}
}
  • Via CLI:
$ multi-semantic-release --ignore-packages=packages/a/**,packages/b/** --deps.bump=inherit

Configuring Semantic-Release

MSR requires semrel config to be added in any supported format for each package or/and declared in repo root (globalConfig is extremely useful if all the modules have the same strategy of release).
NOTE config resolver joins globalConfig and packageConfig during execution.

// Load the package-specific options.
const { options: pkgOptions } = await getConfig(dir);

// The 'final options' are the global options merged with package-specific options.
// We merge this ourselves because package-specific options can override global options.
const finalOptions = Object.assign({}, globalOptions, pkgOptions);

Make sure to have a workspaces attribute inside your package.json project file. In there, you can set a list of packages that you might want to process in the msr process, as well as ignore others. For example, let's say your project has 4 packages (i.e. a, b, c and d) and you want to process only a and d (ignore b and c). You can set the following structure in your package.json file:

{
	"name": "msr-test-yarn",
	"author": "Dave Houlbrooke <dave@shax.com",
	"version": "0.0.0-semantically-released",
	"private": true,
	"license": "0BSD",
	"engines": {
		"node": ">=8.3"
	},
	"workspaces": [
      "packages/*",
      "!packages/b/**",
      "!packages/c/**"
	],
	"release": {
		"plugins": [
			"@semantic-release/commit-analyzer",
			"@semantic-release/release-notes-generator"
		],
		"noCi": true
	}
}

You can also ignore it with the CLI:

$ multi-semantic-release --ignore-packages=packages/b/**,packages/c/**

You can also combine the CLI ignore options with the ! operator at each package inside workspaces attribute. Even though you can use the CLI to ignore options, you can't use it to set which packages to be released ā€“ i.e. you still need to set the workspaces attribute inside the package.json.

Verified usage examples

We use this tool to release our JS platform code inhouse (GitHub Enterprise + JB TeamCity) and for our OSS (GitHub + Travis CI). Guaranteed working configurations available in projects.

License

0BSD

7.1.1

6 months ago

7.1.0

7 months ago

6.6.1

12 months ago

6.6.0

12 months ago

7.0.0

11 months ago

6.7.0

12 months ago

6.5.1

2 years ago

6.5.0

2 years ago

6.2.0

2 years ago

6.3.0

2 years ago

6.4.0

2 years ago

6.1.0

2 years ago

6.1.1

2 years ago

5.0.3

2 years ago

5.0.2

2 years ago

5.0.1

2 years ago

6.0.1

2 years ago

6.0.0

2 years ago

6.0.2

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

4.0.3

2 years ago

4.0.2

2 years ago

5.0.0

2 years ago

3.17.0

2 years ago

3.17.1

2 years ago

3.16.0

3 years ago

3.15.0

3 years ago

3.14.2

3 years ago

3.14.1

3 years ago

3.14.0

3 years ago

3.13.2

3 years ago

3.13.1

3 years ago

3.13.0

3 years ago

3.12.6

3 years ago

3.12.5

3 years ago

3.12.4

3 years ago

3.12.3

3 years ago

3.12.2

3 years ago

3.12.1

3 years ago

3.12.0

3 years ago

3.11.2

3 years ago

3.11.1

3 years ago

3.11.0

3 years ago

3.10.0

3 years ago

3.9.3

3 years ago

3.9.5

3 years ago

3.9.4

3 years ago

3.9.2

3 years ago

3.9.1

3 years ago

3.9.0

3 years ago

3.9.0-beta.1

3 years ago

3.9.0-beta.0

3 years ago

3.8.5

4 years ago

3.8.4

4 years ago

3.8.3

4 years ago

3.8.2

4 years ago

3.8.1

4 years ago

3.8.1-beta

4 years ago

3.8.0

4 years ago

3.7.0

4 years ago

3.6.0

4 years ago

3.5.1

4 years ago

3.5.0

4 years ago

3.4.0

4 years ago

3.3.0

4 years ago

3.2.0

4 years ago

3.2.0-beta

4 years ago

3.1.1

4 years ago

3.1.0

4 years ago

3.0.4-beta

4 years ago

3.0.3

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.6.5-beta.0

4 years ago

2.6.4

4 years ago

2.6.3

4 years ago

2.6.3-beta.8

4 years ago

2.6.3-beta.7

4 years ago

2.6.3-beta.6

4 years ago

2.6.3-beta.5

4 years ago

2.6.3-beta.4

4 years ago

2.6.3-beta.3

4 years ago

2.6.3-beta.2

4 years ago

2.6.3-beta.1

4 years ago

2.6.3-beta.0

4 years ago

2.6.2

4 years ago

2.6.1

4 years ago

2.6.1-beta.0

4 years ago

2.5.1-beta.0

4 years ago

2.6.0

4 years ago

2.6.0-beta.0

4 years ago

2.6.0-beta.1

4 years ago

2.6.0-beta.2

4 years ago

2.5.0

4 years ago

2.4.4-beta.46

4 years ago

2.4.4-beta.45

4 years ago

2.4.4-beta.44

4 years ago

2.4.4-beta.43

4 years ago

2.4.4-beta.42

4 years ago

2.4.4-beta.41

4 years ago

2.4.4-beta.40

4 years ago

2.4.4-beta.39

4 years ago

2.4.4-beta.38

4 years ago

2.4.4-beta.37

4 years ago

2.4.4-beta.33

4 years ago

2.4.4-beta.36

4 years ago

2.4.4-beta.35

4 years ago

2.4.4-beta.34

4 years ago

2.4.4-beta.32

4 years ago

2.4.4-beta.31

4 years ago

2.4.4-beta.30

4 years ago

2.4.4-beta.29

4 years ago

2.4.4-beta.28

4 years ago

2.4.4-beta.27

4 years ago

2.4.4-beta.26

4 years ago

2.4.4-beta.25

4 years ago

2.4.4-beta.24

4 years ago

2.4.4-beta.23

4 years ago

2.4.4-beta.22

4 years ago

2.4.4-beta.20

4 years ago

2.4.4-beta.19

4 years ago

2.4.4-beta.17

4 years ago

2.4.4-beta.16

4 years ago

2.4.4-beta.15

4 years ago

2.4.4-beta.14

4 years ago

2.4.4-beta.13

4 years ago

2.4.4-beta.12

4 years ago

2.4.4-beta.11

4 years ago

2.4.4-beta.10

4 years ago

2.4.4-beta.8

4 years ago

2.4.4-beta.9

4 years ago

2.4.4-beta.7

4 years ago

2.4.4-beta.4

4 years ago

2.4.4-beta.5

4 years ago

2.4.4-beta.6

4 years ago

2.4.4-beta.3

4 years ago

2.4.4-beta.2

4 years ago

2.4.4-beta.1

4 years ago

2.4.4-beta.0

4 years ago

2.4.3

4 years ago

2.4.2

4 years ago

2.4.1

4 years ago

2.4.0

4 years ago

2.3.3

4 years ago

2.3.2

4 years ago

2.3.1

4 years ago

2.3.0

4 years ago

2.2.0

4 years ago

2.1.3

4 years ago

2.1.2

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.2.0

5 years ago

1.1.0

5 years ago