Skip to content

Commit

Permalink
feat: Support latest lerne options for creating github and gitlab rel…
Browse files Browse the repository at this point in the history
…eases

BREAKING CHANGE: This removes the `githubRelease: true` option. To migrate change the option to `createRelease: "github"`
  • Loading branch information
danez authored and sbekrin committed Sep 12, 2019
1 parent 1c29783 commit 614570f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
4 changes: 3 additions & 1 deletion packages/spire-plugin-lerna-release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ yarn add --dev spire-plugin-lerna-release
`undefined`, which falls back to default value of [lerna].
- `allowBranch` \<[string]\> Allowed branch to be released. Defaults to
`master`.
- `githubRelease` \<[boolean]\> Whether to create a GitHub release or not.
- `createRelease` \<[false]|"github"|"gitlab"\> Whether to create a GitHub or GitLab release or not.
- `extraArgs` \<[Array]\<[string]\>\> Array of extra argumnets to pass to
`lerna publish`. Defaults to `[]`.

Expand All @@ -60,6 +60,8 @@ yarn add --dev spire-plugin-lerna-release
MIT &copy; [ResearchGate](https://github.com/researchgate)

[lerna]: https://github.com/lerna/lerna
[false]:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type
[boolean]:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type
[string]:
Expand Down
21 changes: 12 additions & 9 deletions packages/spire-plugin-lerna-release/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function lernaRelease(
gitAuthorName = undefined,
gitAuthorEmail = undefined,
allowBranch = 'master',
githubRelease = false,
createRelease = false,
extraArgs = [],
}
) {
Expand All @@ -16,15 +16,18 @@ function lernaRelease(
command,
description: 'run lerna publish',
async setup() {
const publishArgs = [
'--conventional-commits',
'--allow-branch',
allowBranch,
];

if (createRelease !== false) {
publishArgs.push('--create-release', createRelease);
}

setState({
lernaPublishArgs: [
'--conventional-commits',
'--allow-branch',
allowBranch,
'--github-release',
githubRelease,
...extraArgs,
],
lernaPublishArgs: publishArgs.concat(extraArgs),
});
},
async run({ options, cwd, logger }) {
Expand Down

0 comments on commit 614570f

Please sign in to comment.