Class Release.Builder

  • All Implemented Interfaces:
    software.amazon.jsii.Builder<Release>
    Enclosing class:
    Release

    @Stability(Experimental)
    public static final class Release.Builder
    extends Object
    implements software.amazon.jsii.Builder<Release>
    (experimental) A fluent builder for Release.
    • Method Detail

      • create

        @Stability(Experimental)
        public static Release.Builder create​(software.constructs.IConstruct scope)
        Parameters:
        scope - should be part of the project the Release belongs to. This parameter is required.
        Returns:
        a new instance of Release.Builder.
      • jsiiReleaseVersion

        @Stability(Experimental)
        public Release.Builder jsiiReleaseVersion​(String jsiiReleaseVersion)
        (experimental) Version requirement of publib which is used to publish modules to npm.

        Default: "latest"

        Parameters:
        jsiiReleaseVersion - Version requirement of publib which is used to publish modules to npm. This parameter is required.
        Returns:
        this
      • majorVersion

        @Stability(Experimental)
        public Release.Builder majorVersion​(Number majorVersion)
        (experimental) 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.

        Default: - Major version is not enforced.

        Parameters:
        majorVersion - Major version to release from the default branch. This parameter is required.
        Returns:
        this
      • minMajorVersion

        @Stability(Experimental)
        public Release.Builder minMajorVersion​(Number minMajorVersion)
        (experimental) 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.

        Default: - No minimum version is being enforced

        Parameters:
        minMajorVersion - Minimal Major version to release. This parameter is required.
        Returns:
        this
      • npmDistTag

        @Stability(Experimental)
        public Release.Builder npmDistTag​(String npmDistTag)
        (experimental) The npmDistTag to use when publishing from the default branch.

        To set the npm dist-tag for release branches, set the npmDistTag property for each branch.

        Default: "latest"

        Parameters:
        npmDistTag - The npmDistTag to use when publishing from the default branch. This parameter is required.
        Returns:
        this
      • postBuildSteps

        @Stability(Experimental)
        public Release.Builder postBuildSteps​(List<? extends JobStep> postBuildSteps)
        (experimental) Steps to execute after build as part of the release workflow.

        Default: []

        Parameters:
        postBuildSteps - Steps to execute after build as part of the release workflow. This parameter is required.
        Returns:
        this
      • prerelease

        @Stability(Experimental)
        public Release.Builder prerelease​(String prerelease)
        (experimental) Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").

        Default: - normal semantic versions

        Parameters:
        prerelease - Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre"). This parameter is required.
        Returns:
        this
      • publishDryRun

        @Stability(Experimental)
        public Release.Builder publishDryRun​(Boolean publishDryRun)
        (experimental) Instead of actually publishing to package managers, just print the publishing command.

        Default: false

        Parameters:
        publishDryRun - Instead of actually publishing to package managers, just print the publishing command. This parameter is required.
        Returns:
        this
      • publishTasks

        @Stability(Experimental)
        public Release.Builder publishTasks​(Boolean publishTasks)
        (experimental) 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.

        Default: false

        Parameters:
        publishTasks - Define publishing tasks that can be executed manually as well as workflows. This parameter is required.
        Returns:
        this
      • releasableCommits

        @Stability(Experimental)
        public Release.Builder releasableCommits​(ReleasableCommits releasableCommits)
        (experimental) Find commits that should be considered releasable Used to decide if a release is required.

        Default: ReleasableCommits.everyCommit()

        Parameters:
        releasableCommits - Find commits that should be considered releasable Used to decide if a release is required. This parameter is required.
        Returns:
        this
      • releaseBranches

        @Stability(Experimental)
        public Release.Builder releaseBranches​(Map<String,​? extends BranchOptions> releaseBranches)
        (experimental) 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, the majorVersion field must also be provided for the default branch.

        Default: - no additional branches are used for release. you can use `addBranch()` to add additional branches.

        Parameters:
        releaseBranches - Defines additional release branches. This parameter is required.
        Returns:
        this
      • releaseEveryCommit

        @Stability(Deprecated)
        @Deprecated
        public Release.Builder releaseEveryCommit​(Boolean releaseEveryCommit)
        Deprecated.
        Use releaseTrigger: ReleaseTrigger.continuous() instead
        (deprecated) Automatically release new versions every commit to one of branches in releaseBranches.

        Default: true

        Parameters:
        releaseEveryCommit - Automatically release new versions every commit to one of branches in releaseBranches. This parameter is required.
        Returns:
        this
      • releaseFailureIssue

        @Stability(Experimental)
        public Release.Builder releaseFailureIssue​(Boolean releaseFailureIssue)
        (experimental) Create a github issue on every failed publishing task.

        Default: false

        Parameters:
        releaseFailureIssue - Create a github issue on every failed publishing task. This parameter is required.
        Returns:
        this
      • releaseFailureIssueLabel

        @Stability(Experimental)
        public Release.Builder releaseFailureIssueLabel​(String releaseFailureIssueLabel)
        (experimental) The label to apply to issues indicating publish failures.

        Only applies if releaseFailureIssue is true.

        Default: "failed-release"

        Parameters:
        releaseFailureIssueLabel - The label to apply to issues indicating publish failures. This parameter is required.
        Returns:
        this
      • releaseSchedule

        @Stability(Deprecated)
        @Deprecated
        public Release.Builder releaseSchedule​(String releaseSchedule)
        Deprecated.
        Use releaseTrigger: ReleaseTrigger.scheduled() instead
        (deprecated) CRON schedule to trigger new releases.

        Default: - no scheduled releases

        Parameters:
        releaseSchedule - CRON schedule to trigger new releases. This parameter is required.
        Returns:
        this
      • releaseTagPrefix

        @Stability(Experimental)
        public Release.Builder releaseTagPrefix​(String releaseTagPrefix)
        (experimental) 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.

        Default: "v"

        Parameters:
        releaseTagPrefix - Automatically add the given prefix to release tags. Useful if you are releasing on multiple branches with overlapping version numbers. This parameter is required.
        Returns:
        this
      • releaseTrigger

        @Stability(Experimental)
        public Release.Builder releaseTrigger​(ReleaseTrigger releaseTrigger)
        (experimental) The release trigger to use.

        Default: - Continuous releases (`ReleaseTrigger.continuous()`)

        Parameters:
        releaseTrigger - The release trigger to use. This parameter is required.
        Returns:
        this
      • releaseWorkflowName

        @Stability(Experimental)
        public Release.Builder releaseWorkflowName​(String releaseWorkflowName)
        (experimental) The name of the default release workflow.

        Default: "release"

        Parameters:
        releaseWorkflowName - The name of the default release workflow. This parameter is required.
        Returns:
        this
      • releaseWorkflowSetupSteps

        @Stability(Experimental)
        public Release.Builder releaseWorkflowSetupSteps​(List<? extends JobStep> releaseWorkflowSetupSteps)
        (experimental) A set of workflow steps to execute in order to setup the workflow container.

        Parameters:
        releaseWorkflowSetupSteps - A set of workflow steps to execute in order to setup the workflow container. This parameter is required.
        Returns:
        this
      • versionrcOptions

        @Stability(Experimental)
        public Release.Builder versionrcOptions​(Map<String,​? extends Object> versionrcOptions)
        (experimental) Custom configuration used when creating changelog with standard-version package.

        Given values either append to default configuration or overwrite values in it.

        Default: - standard configuration applicable for GitHub repositories

        Parameters:
        versionrcOptions - Custom configuration used when creating changelog with standard-version package. This parameter is required.
        Returns:
        this
      • workflowContainerImage

        @Stability(Experimental)
        public Release.Builder workflowContainerImage​(String workflowContainerImage)
        (experimental) Container image to use for GitHub workflows.

        Default: - default image

        Parameters:
        workflowContainerImage - Container image to use for GitHub workflows. This parameter is required.
        Returns:
        this
      • workflowRunsOn

        @Stability(Experimental)
        public Release.Builder workflowRunsOn​(List<String> workflowRunsOn)
        (experimental) Github Runner selection labels.

        Default: ["ubuntu-latest"]

        Parameters:
        workflowRunsOn - Github Runner selection labels. This parameter is required.
        Returns:
        this
      • workflowRunsOnGroup

        @Stability(Experimental)
        public Release.Builder workflowRunsOnGroup​(GroupRunnerOptions workflowRunsOnGroup)
        (experimental) Github Runner Group selection options.

        Parameters:
        workflowRunsOnGroup - Github Runner Group selection options. This parameter is required.
        Returns:
        this
      • artifactsDirectory

        @Stability(Experimental)
        public Release.Builder artifactsDirectory​(String artifactsDirectory)
        (experimental) A directory which will contain build artifacts.

        Default: "dist"

        Parameters:
        artifactsDirectory - A directory which will contain build artifacts. This parameter is required.
        Returns:
        this
      • branch

        @Stability(Experimental)
        public Release.Builder branch​(String branch)
        (experimental) The default branch name to release from.

        Use majorVersion to restrict this branch to only publish releases with a specific major version.

        You can add additional branches using addBranch().

        Parameters:
        branch - The default branch name to release from. This parameter is required.
        Returns:
        this
      • task

        @Stability(Experimental)
        public Release.Builder task​(Task task)
        (experimental) The task to execute in order to create the release artifacts.

        Artifacts are expected to reside under artifactsDirectory (defaults to dist/) once build is complete.

        Parameters:
        task - The task to execute in order to create the release artifacts. This parameter is required.
        Returns:
        this
      • versionFile

        @Stability(Experimental)
        public Release.Builder versionFile​(String versionFile)
        (experimental) A name of a .json file to set the version field in after a bump.

        Example:

         "package.json"
         

        Parameters:
        versionFile - A name of a .json file to set the version field in after a bump. This parameter is required.
        Returns:
        this
      • githubRelease

        @Stability(Experimental)
        public Release.Builder githubRelease​(Boolean githubRelease)
        (experimental) Create a GitHub release for each release.

        Default: true

        Parameters:
        githubRelease - Create a GitHub release for each release. This parameter is required.
        Returns:
        this
      • workflowNodeVersion

        @Stability(Experimental)
        public Release.Builder workflowNodeVersion​(String workflowNodeVersion)
        (experimental) Node version to setup in GitHub workflows if any node-based CLI utilities are needed.

        For example publib, the CLI projen uses to publish releases, is an npm library.

        Default: 18.x

        Parameters:
        workflowNodeVersion - Node version to setup in GitHub workflows if any node-based CLI utilities are needed. This parameter is required.
        Returns:
        this
      • workflowPermissions

        @Stability(Experimental)
        public Release.Builder workflowPermissions​(JobPermissions workflowPermissions)
        (experimental) Permissions granted to the release workflow job.

        Default: `{ contents: JobPermission.WRITE }`

        Parameters:
        workflowPermissions - Permissions granted to the release workflow job. This parameter is required.
        Returns:
        this
      • build

        @Stability(Experimental)
        public Release build()
        Specified by:
        build in interface software.amazon.jsii.Builder<Release>
        Returns:
        a newly built instance of Release.