Package io.github.cdklabs.projen.release
Class ReleaseOptions.Builder
- java.lang.Object
-
- io.github.cdklabs.projen.release.ReleaseOptions.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<ReleaseOptions>
- Enclosing interface:
- ReleaseOptions
@Stability(Experimental) public static final class ReleaseOptions.Builder extends Object implements software.amazon.jsii.Builder<ReleaseOptions>
A builder forReleaseOptions
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
-
-
-
Method Detail
-
artifactsDirectory
@Stability(Experimental) public ReleaseOptions.Builder artifactsDirectory(String artifactsDirectory)
Sets the value ofReleaseOptions.getArtifactsDirectory()- Parameters:
artifactsDirectory- A directory which will contain build artifacts. This parameter is required.- Returns:
this
-
branch
@Stability(Experimental) public ReleaseOptions.Builder branch(String branch)
Sets the value ofReleaseOptions.getBranch()- Parameters:
branch- The default branch name to release from. This parameter is required. UsemajorVersionto restrict this branch to only publish releases with a specific major version.You can add additional branches using
addBranch().- Returns:
this
-
task
@Stability(Experimental) public ReleaseOptions.Builder task(Task task)
Sets the value ofReleaseOptions.getTask()- Parameters:
task- The task to execute in order to create the release artifacts. This parameter is required. Artifacts are expected to reside underartifactsDirectory(defaults todist/) once build is complete.- Returns:
this
-
versionFile
@Stability(Experimental) public ReleaseOptions.Builder versionFile(String versionFile)
Sets the value ofReleaseOptions.getVersionFile()- Parameters:
versionFile- A name of a .json file to set theversionfield in after a bump. This parameter is required.- Returns:
this
-
githubRelease
@Stability(Experimental) public ReleaseOptions.Builder githubRelease(Boolean githubRelease)
Sets the value ofReleaseOptions.getGithubRelease()- Parameters:
githubRelease- Create a GitHub release for each release.- Returns:
this
-
workflowNodeVersion
@Stability(Experimental) public ReleaseOptions.Builder workflowNodeVersion(String workflowNodeVersion)
Sets the value ofReleaseOptions.getWorkflowNodeVersion()- Parameters:
workflowNodeVersion- Node version to setup in GitHub workflows if any node-based CLI utilities are needed. For examplepublib, the CLI projen uses to publish releases, is an npm library.- Returns:
this
-
workflowPermissions
@Stability(Experimental) public ReleaseOptions.Builder workflowPermissions(JobPermissions workflowPermissions)
Sets the value ofReleaseOptions.getWorkflowPermissions()- Parameters:
workflowPermissions- Permissions granted to the release workflow job.- Returns:
this
-
jsiiReleaseVersion
@Stability(Experimental) public ReleaseOptions.Builder jsiiReleaseVersion(String jsiiReleaseVersion)
Sets the value ofReleaseProjectOptions.getJsiiReleaseVersion()- Parameters:
jsiiReleaseVersion- Version requirement ofpublibwhich is used to publish modules to npm.- Returns:
this
-
majorVersion
@Stability(Experimental) public ReleaseOptions.Builder majorVersion(Number majorVersion)
Sets the value ofReleaseProjectOptions.getMajorVersion()- Parameters:
majorVersion- Major version to release from the default branch. If this is specified, we bump the latest version of this major version line. If not specified, we bump the global latest version.- Returns:
this
-
minMajorVersion
@Stability(Experimental) public ReleaseOptions.Builder minMajorVersion(Number minMajorVersion)
Sets the value ofReleaseProjectOptions.getMinMajorVersion()- Parameters:
minMajorVersion- Minimal Major version to release. This can be useful to set to 1, as breaking changes before the 1.x major release are not incrementing the major version number.Can not be set together with
majorVersion.- Returns:
this
-
npmDistTag
@Stability(Experimental) public ReleaseOptions.Builder npmDistTag(String npmDistTag)
Sets the value ofReleaseProjectOptions.getNpmDistTag()- Parameters:
npmDistTag- The npmDistTag to use when publishing from the default branch. To set the npm dist-tag for release branches, set thenpmDistTagproperty for each branch.- Returns:
this
-
postBuildSteps
@Stability(Experimental) public ReleaseOptions.Builder postBuildSteps(List<? extends JobStep> postBuildSteps)
Sets the value ofReleaseProjectOptions.getPostBuildSteps()- Parameters:
postBuildSteps- Steps to execute after build as part of the release workflow.- Returns:
this
-
prerelease
@Stability(Experimental) public ReleaseOptions.Builder prerelease(String prerelease)
Sets the value ofReleaseProjectOptions.getPrerelease()- Parameters:
prerelease- Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").- Returns:
this
-
publishDryRun
@Stability(Experimental) public ReleaseOptions.Builder publishDryRun(Boolean publishDryRun)
Sets the value ofReleaseProjectOptions.getPublishDryRun()- Parameters:
publishDryRun- Instead of actually publishing to package managers, just print the publishing command.- Returns:
this
-
publishTasks
@Stability(Experimental) public ReleaseOptions.Builder publishTasks(Boolean publishTasks)
Sets the value ofReleaseProjectOptions.getPublishTasks()- Parameters:
publishTasks- Define publishing tasks that can be executed manually as well as workflows. Normally, publishing only happens within automated workflows. Enable this in order to create a publishing task for each publishing activity.- Returns:
this
-
releasableCommits
@Stability(Experimental) public ReleaseOptions.Builder releasableCommits(ReleasableCommits releasableCommits)
Sets the value ofReleaseProjectOptions.getReleasableCommits()- Parameters:
releasableCommits- Find commits that should be considered releasable Used to decide if a release is required.- Returns:
this
-
releaseBranches
@Stability(Experimental) public ReleaseOptions.Builder releaseBranches(Map<String,? extends BranchOptions> releaseBranches)
Sets the value ofReleaseProjectOptions.getReleaseBranches()- Parameters:
releaseBranches- Defines additional release branches. A workflow will be created for each release branch which will publish releases from commits in this branch. Each release branch must be assigned a major version number which is used to enforce that versions published from that branch always use that major version. If multiple branches are used, themajorVersionfield must also be provided for the default branch.- Returns:
this
-
releaseEveryCommit
@Stability(Deprecated) @Deprecated public ReleaseOptions.Builder releaseEveryCommit(Boolean releaseEveryCommit)
Deprecated.Use `releaseTrigger: ReleaseTrigger.continuous()` insteadSets the value ofReleaseProjectOptions.getReleaseEveryCommit()- Parameters:
releaseEveryCommit- Automatically release new versions every commit to one of branches inreleaseBranches.- Returns:
this
-
releaseFailureIssue
@Stability(Experimental) public ReleaseOptions.Builder releaseFailureIssue(Boolean releaseFailureIssue)
Sets the value ofReleaseProjectOptions.getReleaseFailureIssue()- Parameters:
releaseFailureIssue- Create a github issue on every failed publishing task.- Returns:
this
-
releaseFailureIssueLabel
@Stability(Experimental) public ReleaseOptions.Builder releaseFailureIssueLabel(String releaseFailureIssueLabel)
Sets the value ofReleaseProjectOptions.getReleaseFailureIssueLabel()- Parameters:
releaseFailureIssueLabel- The label to apply to issues indicating publish failures. Only applies ifreleaseFailureIssueis true.- Returns:
this
-
releaseSchedule
@Stability(Deprecated) @Deprecated public ReleaseOptions.Builder releaseSchedule(String releaseSchedule)
Deprecated.Use `releaseTrigger: ReleaseTrigger.scheduled()` insteadSets the value ofReleaseProjectOptions.getReleaseSchedule()- Parameters:
releaseSchedule- CRON schedule to trigger new releases.- Returns:
this
-
releaseTagPrefix
@Stability(Experimental) public ReleaseOptions.Builder releaseTagPrefix(String releaseTagPrefix)
Sets the value ofReleaseProjectOptions.getReleaseTagPrefix()- Parameters:
releaseTagPrefix- Automatically add the given prefix to release tags. Useful if you are releasing on multiple branches with overlapping version numbers. Note: this prefix is used to detect the latest tagged version when bumping, so if you change this on a project with an existing version history, you may need to manually tag your latest release with the new prefix.- Returns:
this
-
releaseTrigger
@Stability(Experimental) public ReleaseOptions.Builder releaseTrigger(ReleaseTrigger releaseTrigger)
Sets the value ofReleaseProjectOptions.getReleaseTrigger()- Parameters:
releaseTrigger- The release trigger to use.- Returns:
this
-
releaseWorkflowName
@Stability(Experimental) public ReleaseOptions.Builder releaseWorkflowName(String releaseWorkflowName)
Sets the value ofReleaseProjectOptions.getReleaseWorkflowName()- Parameters:
releaseWorkflowName- The name of the default release workflow.- Returns:
this
-
releaseWorkflowSetupSteps
@Stability(Experimental) public ReleaseOptions.Builder releaseWorkflowSetupSteps(List<? extends JobStep> releaseWorkflowSetupSteps)
Sets the value ofReleaseProjectOptions.getReleaseWorkflowSetupSteps()- Parameters:
releaseWorkflowSetupSteps- A set of workflow steps to execute in order to setup the workflow container.- Returns:
this
-
versionrcOptions
@Stability(Experimental) public ReleaseOptions.Builder versionrcOptions(Map<String,? extends Object> versionrcOptions)
Sets the value ofReleaseProjectOptions.getVersionrcOptions()- Parameters:
versionrcOptions- Custom configuration used when creating changelog with standard-version package. Given values either append to default configuration or overwrite values in it.- Returns:
this
-
workflowContainerImage
@Stability(Experimental) public ReleaseOptions.Builder workflowContainerImage(String workflowContainerImage)
Sets the value ofReleaseProjectOptions.getWorkflowContainerImage()- Parameters:
workflowContainerImage- Container image to use for GitHub workflows.- Returns:
this
-
workflowRunsOn
@Stability(Experimental) public ReleaseOptions.Builder workflowRunsOn(List<String> workflowRunsOn)
Sets the value ofReleaseProjectOptions.getWorkflowRunsOn()- Parameters:
workflowRunsOn- Github Runner selection labels.- Returns:
this
-
workflowRunsOnGroup
@Stability(Experimental) public ReleaseOptions.Builder workflowRunsOnGroup(GroupRunnerOptions workflowRunsOnGroup)
Sets the value ofReleaseProjectOptions.getWorkflowRunsOnGroup()- Parameters:
workflowRunsOnGroup- Github Runner Group selection options.- Returns:
this
-
build
@Stability(Experimental) public ReleaseOptions build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<ReleaseOptions>- Returns:
- a new instance of
ReleaseOptions - Throws:
NullPointerException- if any required attribute was not provided
-
-