Yargs command handler for staging a release.
(flags: Arguments<ReleasePublishOptions>)
| 35 | type: 'boolean', |
| 36 | default: false, |
| 37 | description: |
| 38 | 'Only stage the release (bump version, generate changelog, build, precheck, create PR) and exit.', |
| 39 | }); |
| 40 | } |
| 41 | |
| 42 | /** Yargs command handler for staging a release. */ |
| 43 | async function handler(flags: Arguments<ReleasePublishOptions>) { |
| 44 | const git = await AuthenticatedGitClient.get(); |
| 45 | const config = await getConfig(); |
| 46 | assertValidReleaseConfig(config); |
| 47 | assertValidGithubConfig(config); |
| 48 | |
| 49 | const task = new ReleaseTool(git, config.release, config.github, git.baseDir, flags); |
| 50 | const result = await task.run(); |
| 51 | |
| 52 | switch (result) { |
| 53 | case CompletionState.FATAL_ERROR: |
| 54 | Log.error(`Release action has been aborted due to fatal errors. See above.`); |
| 55 | process.exitCode = 2; |
| 56 | break; |
| 57 | case CompletionState.MANUALLY_ABORTED: |
| 58 | Log.info(yellow(`Release action has been manually aborted.`)); |
| 59 | process.exitCode = 1; |
| 60 | break; |
| 61 | case CompletionState.SUCCESS: |
| 62 | Log.info(green(`Release action has completed successfully.`)); |
nothing calls this directly
no test coverage detected