import { github, ReleasableCommits, release, GroupRunnerOptions } from 'projen'; /** * MonorepoReleaseOptions */ export interface MonorepoReleaseOptions { /** * Branch name to release from * @default "main" */ readonly branchName?: string; /** * Build the monorepo using Nx during the release. * Will build projects in parallel and can improve build performance * @default false */ readonly buildWithNx?: boolean; /** * The `commit-and-tag-version` compatible package used to bump the package version, as a dependency string. * This can be any compatible package version, including the deprecated `standard-version@9`. * @default - A recent version of "commit-and-tag-version" */ readonly bumpPackage?: string; /** * Version requirement of `publib` which is used to publish modules to npm. * @default "latest" */ readonly jsiiReleaseVersion?: string; /** * 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. */ readonly majorVersion?: number; /** * 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 */ readonly minMajorVersion?: number; /** * A shell command to control the next version to release. * If present, this shell command will be run before the bump is executed, and * it determines what version to release. It will be executed in the following * environment: * * - Working directory: the project directory. * - `$VERSION`: the current version. Looks like `1.2.3`. * - `$LATEST_TAG`: the most recent tag. Looks like `prefix-v1.2.3`, or may be unset. * - `$SUGGESTED_BUMP`: the suggested bump action based on commits. One of `major|minor|patch|none`. * * The command should print one of the following to `stdout`: * * - Nothing: the next version number will be determined based on commit history. * - `x.y.z`: the next version number will be `x.y.z`. * - `major|minor|patch`: the next version number will be the current version number * with the indicated component bumped. * * This setting cannot be specified together with `minMajorVersion`; the invoked * script can be used to achieve the effects of `minMajorVersion`. * @default - The next version will be determined based on the commit history and project settings. */ readonly nextVersionCommand?: string; /** * Node version to use in the release workflow * @default "lts/*" */ readonly nodeVersion?: string; /** * 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" */ readonly npmDistTag?: string; /** * Steps to execute after build as part of the release workflow. * @default [] */ readonly postBuildSteps?: Array; /** * Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre"). * @default - normal semantic versions */ readonly prerelease?: string; /** * Instead of actually publishing to package managers, just print the publishing command. * @default false */ readonly publishDryRun?: boolean; /** * Publish packages to npm * @default true */ readonly publishToNpm?: boolean; /** * Find commits that should be considered releasable Used to decide if a release is required. * @default ReleasableCommits.everyCommit() */ readonly releasableCommits?: ReleasableCommits; /** * The GitHub Actions environment used for the release. * This can be used to add an explicit approval step to the release * or limit who can initiate a release through environment protection rules. * * When multiple artifacts are released, the environment can be overwritten * on a per artifact basis. * @default - no environment used, unless set at the artifact level */ readonly releaseEnvironment?: string; /** * The release trigger to use. * @default - Continuous releases (`ReleaseTrigger.continuous()`) */ readonly releaseTrigger?: release.ReleaseTrigger; /** * Build environment variables for release workflows. * @default {} */ readonly releaseWorkflowEnv?: Record; /** * The name of the default release workflow. * @default "release" */ readonly releaseWorkflowName?: string; /** * A set of workflow steps to execute in order to setup the workflow container. */ readonly releaseWorkflowSetupSteps?: Array; /** * Container image to use for GitHub workflows. * @default - default image */ readonly workflowContainerImage?: string; /** * Github Runner selection labels. * @default ["ubuntu-latest"] */ readonly workflowRunsOn?: Array; /** * Github Runner Group selection options. */ readonly workflowRunsOnGroup?: GroupRunnerOptions; /** * Whether the monorepo uses Yarn Berry. * When enabled, release tasks use Yarn Berry compatible commands. * @default false */ readonly yarnBerry?: boolean; }