Skip to content

Commit

Permalink
feat: add forcePrerelease option
Browse files Browse the repository at this point in the history
  • Loading branch information
dackerman committed Jan 24, 2025
1 parent 2010d20 commit 456e845
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions schemas/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
"description": "Create the GitHub release as prerelease. Defaults to `false`.",
"type": "boolean"
},
"forcePrerelease": {
"description": "Always create a GitHub prerelease for every release. Defaults to `false`.",
"type": "boolean"
},
"draft-pull-request": {
"description": "Open the release pull request in draft mode. Defaults to `false`.",
"type": "boolean"
Expand Down
2 changes: 2 additions & 0 deletions src/bin/release-please.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ interface ManifestConfigArgs {
interface ReleaseArgs {
draft?: boolean;
prerelease?: boolean;
forcePrerelease?: boolean;
releaseLabel?: string;
prereleaseLabel?: string;
snapshotLabel?: string;
Expand Down Expand Up @@ -580,6 +581,7 @@ const createReleaseCommand: yargs.CommandModule<{}, CreateReleaseArgs> = {
packageName: argv.packageName,
draft: argv.draft,
prerelease: argv.prerelease,
forcePrerelease: argv.forcePrerelease,
includeComponentInTag: argv.monorepoTags,
includeVInTag: argv.includeVInTags,
},
Expand Down
5 changes: 5 additions & 0 deletions src/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export interface ReleaserConfig {
skipGithubRelease?: boolean; // Note this should be renamed to skipGitHubRelease in next major release
draft?: boolean;
prerelease?: boolean;
forcePrerelease?: boolean;
draftPullRequest?: boolean;
component?: string;
packageName?: string;
Expand Down Expand Up @@ -159,6 +160,7 @@ interface ReleaserConfigJson {
'skip-github-release'?: boolean;
draft?: boolean;
prerelease?: boolean;
forcePrerelease?: boolean;
'draft-pull-request'?: boolean;
label?: string;
'release-label'?: string;
Expand Down Expand Up @@ -200,6 +202,7 @@ export interface ManifestOptions {
sequentialCalls?: boolean;
draft?: boolean;
prerelease?: boolean;
forcePrerelease?: boolean;
draftPullRequest?: boolean;
groupPullRequestTitlePattern?: string;
releaseSearchDepth?: number;
Expand Down Expand Up @@ -1301,6 +1304,7 @@ export class Manifest {
draft: config.draft ?? this.draft,
prerelease:
hasPrereleaseLabel ||
config.forcePrerelease ||
(config.prerelease && !!release.tag.version.preRelease),
});
}
Expand Down Expand Up @@ -2136,6 +2140,7 @@ function mergeReleaserConfig(
pathConfig.skipGithubRelease ?? defaultConfig.skipGithubRelease,
draft: pathConfig.draft ?? defaultConfig.draft,
prerelease: pathConfig.prerelease ?? defaultConfig.prerelease,
forcePrerelease: pathConfig.forcePrerelease ?? defaultConfig.forcePrerelease,

Check failure on line 2143 in src/manifest.ts

View workflow job for this annotation

GitHub Actions / tests (20, windows-latest)

Insert `⏎·····`
component: pathConfig.component ?? defaultConfig.component,
packageName: pathConfig.packageName ?? defaultConfig.packageName,
versionFile: pathConfig.versionFile ?? defaultConfig.versionFile,
Expand Down

0 comments on commit 456e845

Please sign in to comment.