release Submodule
Constructs
Publisher
Implements GitHub jobs for publishing modules to package managers.
Under the hood, it uses https://github.com/aws/publib
Initializers
import { release } from 'projen'
new release.Publisher(project: Project, options: PublisherOptions)
| Name | Type | Description |
|---|---|---|
| projen.Project | No description. |
| | No description. |
projectRequired
- Type: projen.Project
optionsRequired
- Type: PublisherOptions
Methods
| Name | Description |
|---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
| Adds post publishing steps for the GitHub release job. |
| Adds pre publishing steps for the GitHub release job. |
| Publish to git. |
| Creates a GitHub Release. |
| Adds a go publishing job. |
| Publishes artifacts from java/** to Maven. |
| Publishes artifacts from js/** to npm. |
| Publishes artifacts from dotnet/** to NuGet Gallery. |
| Publishes wheel artifacts from python to PyPI. |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
addGitHubPostPublishingSteps
public addGitHubPostPublishingSteps(steps: ...JobStep[]): void
Adds post publishing steps for the GitHub release job.
stepsRequired
- Type: ...projen.github.workflows.JobStep[]
The steps.
addGitHubPrePublishingSteps
public addGitHubPrePublishingSteps(steps: ...JobStep[]): void
Adds pre publishing steps for the GitHub release job.
stepsRequired
- Type: ...projen.github.workflows.JobStep[]
The steps.
publishToGit
public publishToGit(options: GitPublishOptions): Task
Publish to git.
This includes generating a project-level changelog and release tags.
optionsRequired
- Type: GitPublishOptions
Options.
publishToGitHubReleases
public publishToGitHubReleases(options: GitHubReleasesPublishOptions): void
Creates a GitHub Release.
optionsRequired
Options.
publishToGo
public publishToGo(options?: GoPublishOptions): void
Adds a go publishing job.
optionsOptional
- Type: GoPublishOptions
Options.
publishToMaven
public publishToMaven(options?: MavenPublishOptions): void
Publishes artifacts from java/** to Maven.
optionsOptional
- Type: MavenPublishOptions
Options.
publishToNpm
public publishToNpm(options?: NpmPublishOptions): void
Publishes artifacts from js/** to npm.
optionsOptional
- Type: NpmPublishOptions
Options.
publishToNuget
public publishToNuget(options?: NugetPublishOptions): void
Publishes artifacts from dotnet/** to NuGet Gallery.
optionsOptional
- Type: NugetPublishOptions
Options.
publishToPyPi
public publishToPyPi(options?: PyPiPublishOptions): void
Publishes wheel artifacts from python to PyPI.
optionsOptional
- Type: PyPiPublishOptions
Options.
Static Functions
| Name | Description |
|---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
isConstruct
import { release } from 'projen'
release.Publisher.isConstruct(x: any)
Checks if x is a construct.
Use this method instead of instanceof to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct in each copy of the constructs library
is seen as a different class, and an instance of one class will not test as
instanceof the other class. npm install will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof will behave
unpredictably. It is safest to avoid using instanceof, and using
this type-testing method instead.
xRequired
- Type: any
Any object.
isComponent
import { release } from 'projen'
release.Publisher.isComponent(x: any)
Test whether the given construct is a component.
xRequired
- Type: any
Properties
| Name | Type | Description |
|---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
| string | No description. |
| string | No description. |
| string | No description. |
| string | No description. |
| string | No description. |
nodeRequired
public readonly node: Node;
- Type: constructs.Node
The tree node.
projectRequired
public readonly project: Project;
- Type: projen.Project
artifactNameRequired
public readonly artifactName: string;
- Type: string
buildJobIdRequired
public readonly buildJobId: string;
- Type: string
jsiiReleaseVersionRequired
jsiiReleaseVersion- Deprecated: use
publibVersion
public readonly jsiiReleaseVersion: string;
- Type: string
publibVersionRequired
public readonly publibVersion: string;
- Type: string
conditionOptional
public readonly condition: string;
- Type: string
Constants
| Name | Type | Description |
|---|---|---|
| string | No description. |
PUBLISH_GIT_TASK_NAMERequired
public readonly PUBLISH_GIT_TASK_NAME: string;
- Type: string
Release
Manages releases (currently through GitHub workflows).
By default, no branches are released. To add branches, call addBranch().
Initializers
import { release } from 'projen'
new release.Release(scope: IConstruct, options: ReleaseOptions)
| Name | Type | Description |
|---|---|---|
| constructs.IConstruct | should be part of the project the Release belongs to. |
| | options to configure the Release Component. |
scopeRequired
- Type: constructs.IConstruct
should be part of the project the Release belongs to.
optionsRequired
- Type: ReleaseOptions
options to configure the Release Component.
Methods
| Name | Description |
|---|---|
| Returns a string representation of this construct. |
| Called after synthesis. |
| Called before synthesis. |
| Synthesizes files to the project output directory. |
| Adds a release branch. |
| Adds jobs to all release workflows. |
toString
public toString(): string
Returns a string representation of this construct.
postSynthesize
public postSynthesize(): void
Called after synthesis.
Order is not guaranteed.
preSynthesize
public preSynthesize(): void
Called before synthesis.
synthesize
public synthesize(): void
Synthesizes files to the project output directory.
addBranch
public addBranch(branch: string, options: BranchOptions): void
Adds a release branch.
It is a git branch from which releases are published. If a project has more than one release
branch, we require that majorVersion is also specified for the primary branch in order to
ensure branches always release the correct version.
branchRequired
- Type: string
The branch to monitor (e.g. main, v2.x).
optionsRequired
- Type: BranchOptions
Branch definition.
addJobs
public addJobs(jobs: {[ key: string ]: Job}): void
Adds jobs to all release workflows.
jobsRequired
- Type: {[ key: string ]: projen.github.workflows.Job}
The jobs to add (name => job).
Static Functions
| Name | Description |
|---|---|
| Checks if x is a construct. |
| Test whether the given construct is a component. |
| Returns the Release component of a project or undefined if the project does not have a Release component. |
isConstruct
import { release } from 'projen'
release.Release.isConstruct(x: any)
Checks if x is a construct.
Use this method instead of instanceof to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct in each copy of the constructs library
is seen as a different class, and an instance of one class will not test as
instanceof the other class. npm install will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof will behave
unpredictably. It is safest to avoid using instanceof, and using
this type-testing method instead.
xRequired
- Type: any
Any object.
isComponent
import { release } from 'projen'
release.Release.isComponent(x: any)
Test whether the given construct is a component.
xRequired
- Type: any
of
import { release } from 'projen'
release.Release.of(project: Project)
Returns the Release component of a project or undefined if the project does not have a Release component.
projectRequired
- Type: projen.Project
Properties
| Name | Type | Description |
|---|---|---|
| constructs.Node | The tree node. |
| projen.Project | No description. |
| string | Location of build artifacts. |
| string[] | Retrieve all release branch names. |
| | Package publisher. |
nodeRequired
public readonly node: Node;
- Type: constructs.Node
The tree node.
projectRequired
public readonly project: Project;
- Type: projen.Project
artifactsDirectoryRequired
public readonly artifactsDirectory: string;
- Type: string
Location of build artifacts.
branchesRequired
public readonly branches: string[];
- Type: string[]
Retrieve all release branch names.
publisherRequired
public readonly publisher: Publisher;
- Type: Publisher
Package publisher.
Constants
| Name | Type | Description |
|---|---|---|
| string | No description. |
ANTI_TAMPER_CMDRequired
public readonly ANTI_TAMPER_CMD: string;
- Type: string
Structs
BranchOptions
Options for a release branch.
Initializer
import { release } from 'projen'
const branchOptions: release.BranchOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| number | The major versions released from this branch. |
| string | The GitHub Actions environment used for the release. |
| number | The minimum major version to release. |
| number | The minor versions released from this branch. |
| string | The npm distribution tag to use for this branch. |
| string | Bump the version as a pre-release tag. |
| string | Automatically add the given prefix to release tags. Useful if you are releasing on multiple branches with overlapping version numbers. |
| string | The name of the release workflow. |
majorVersionRequired
public readonly majorVersion: number;
- Type: number
The major versions released from this branch.
environmentOptional
public readonly environment: string;
- Type: string
- Default: no environment used, unless set at the artifact level
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.
minMajorVersionOptional
public readonly minMajorVersion: number;
- Type: number
The minimum major version to release.
minorVersionOptional
public readonly minorVersion: number;
- Type: number
The minor versions released from this branch.
npmDistTagOptional
public readonly npmDistTag: string;
- Type: string
- Default: "latest"
The npm distribution tag to use for this branch.
prereleaseOptional
public readonly prerelease: string;
- Type: string
- Default: normal releases
Bump the version as a pre-release tag.
tagPrefixOptional
public readonly tagPrefix: string;
- Type: string
- Default: no prefix
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.
workflowNameOptional
public readonly workflowName: string;
- Type: string
- Default: "release-BRANCH"
The name of the release workflow.
CodeArtifactOptions
Options for publishing packages to AWS CodeArtifact.
Initializer
import { release } from 'projen'
const codeArtifactOptions: release.CodeArtifactOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | GitHub secret which contains the AWS access key ID to use when publishing packages to AWS CodeArtifact. |
| | Provider to use for authorizing requests to AWS CodeArtifact. |
| string | ARN of AWS role to be assumed prior to get authorization token from AWS CodeArtifact This property must be specified only when publishing to AWS CodeArtifact (registry contains AWS CodeArtifact URL). |
| string | GitHub secret which contains the AWS secret access key to use when publishing packages to AWS CodeArtifact. |
accessKeyIdSecretOptional
public readonly accessKeyIdSecret: string;
- Type: string
- Default: When the
authProvidervalue is set toCodeArtifactAuthProvider.ACCESS_AND_SECRET_KEY_PAIR, the default is "AWS_ACCESS_KEY_ID". ForCodeArtifactAuthProvider.GITHUB_OIDC, this value must be left undefined.
GitHub secret which contains the AWS access key ID to use when publishing packages to AWS CodeArtifact.
This property must be specified only when publishing to AWS CodeArtifact (npmRegistryUrl contains AWS CodeArtifact URL).
authProviderOptional
public readonly authProvider: CodeArtifactAuthProvider;
- Type: CodeArtifactAuthProvider
- Default: CodeArtifactAuthProvider.ACCESS_AND_SECRET_KEY_PAIR
Provider to use for authorizing requests to AWS CodeArtifact.
roleToAssumeOptional
public readonly roleToAssume: string;
- Type: string
- Default: undefined
ARN of AWS role to be assumed prior to get authorization token from AWS CodeArtifact This property must be specified only when publishing to AWS CodeArtifact (registry contains AWS CodeArtifact URL).
When using the CodeArtifactAuthProvider.GITHUB_OIDC auth provider, this value must be defined.
secretAccessKeySecretOptional
public readonly secretAccessKeySecret: string;
- Type: string
- Default: When the
authProvidervalue is set toCodeArtifactAuthProvider.ACCESS_AND_SECRET_KEY_PAIR, the default is "AWS_SECRET_ACCESS_KEY". ForCodeArtifactAuthProvider.GITHUB_OIDC, this value must be left undefined.
GitHub secret which contains the AWS secret access key to use when publishing packages to AWS CodeArtifact.
This property must be specified only when publishing to AWS CodeArtifact (npmRegistryUrl contains AWS CodeArtifact URL).
CommonPublishOptions
Common publishing options.
Initializer
import { release } from 'projen'
const commonPublishOptions: release.CommonPublishOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | The GitHub Actions environment used for publishing. |
| projen.github.workflows.JobStep[] | Steps to execute after executing the publishing command. |
| projen.github.workflows.JobStep[] | Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed. |
| projen.github.workflows.Tools | Additional tools to install in the publishing job. |
githubEnvironmentOptional
public readonly githubEnvironment: string;
- Type: string
- Default: no environment used, unless set at the package level
The GitHub Actions environment used for publishing.
This can be used to add an explicit approval step to the release or limit who can initiate a release through environment protection rules.
Set this to overwrite a package level publishing environment just for this artifact.
postPublishStepsOptional
public readonly postPublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute after executing the publishing command.
These can be used to add/update the release artifacts ot any other tasks needed.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPostPublishingSteps.
prePublishStepsOptional
public readonly prePublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed.
These steps are executed after dist/ has been populated with the build
output.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPrePublishingSteps.
publishToolsOptional
public readonly publishTools: Tools;
- Type: projen.github.workflows.Tools
- Default: no additional tools are installed
Additional tools to install in the publishing job.
ContinuousReleaseOptions
Initializer
import { release } from 'projen'
const continuousReleaseOptions: release.ContinuousReleaseOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string[] | Paths for which pushes should trigger a release. |
pathsOptional
public readonly paths: string[];
- Type: string[]
Paths for which pushes should trigger a release.
GitHubReleasesPublishOptions
Publishing options for GitHub releases.
Initializer
import { release } from 'projen'
const gitHubReleasesPublishOptions: release.GitHubReleasesPublishOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | The GitHub Actions environment used for publishing. |
| projen.github.workflows.JobStep[] | Steps to execute after executing the publishing command. |
| projen.github.workflows.JobStep[] | Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed. |
| projen.github.workflows.Tools | Additional tools to install in the publishing job. |
| string | The location of an .md file (relative to dist/) that includes the changelog for the release. |
| string | The location of a text file (relative to dist/) that contains the release tag. |
| string | The location of a text file (relative to dist/) that contains the version number. |
githubEnvironmentOptional
public readonly githubEnvironment: string;
- Type: string
- Default: no environment used, unless set at the package level
The GitHub Actions environment used for publishing.
This can be used to add an explicit approval step to the release or limit who can initiate a release through environment protection rules.
Set this to overwrite a package level publishing environment just for this artifact.
postPublishStepsOptional
public readonly postPublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute after executing the publishing command.
These can be used to add/update the release artifacts ot any other tasks needed.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPostPublishingSteps.
prePublishStepsOptional
public readonly prePublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed.
These steps are executed after dist/ has been populated with the build
output.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPrePublishingSteps.
publishToolsOptional
public readonly publishTools: Tools;
- Type: projen.github.workflows.Tools
- Default: no additional tools are installed
Additional tools to install in the publishing job.
changelogFileRequired
public readonly changelogFile: string;
- Type: string
The location of an .md file (relative to dist/) that includes the changelog for the release.
Example
changelog.md
releaseTagFileRequired
public readonly releaseTagFile: string;
- Type: string
The location of a text file (relative to dist/) that contains the release tag.
Example
releasetag.txt
versionFileRequired
public readonly versionFile: string;
- Type: string
The location of a text file (relative to dist/) that contains the version number.
Example
version.txt
GitPublishOptions
Publishing options for Git releases.
Initializer
import { release } from 'projen'
const gitPublishOptions: release.GitPublishOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | The location of an .md file (relative to dist/) that includes the changelog for the release. |
| string | The location of a text file (relative to dist/) that contains the release tag. |
| string | The location of a text file (relative to dist/) that contains the version number. |
| string | Branch to push to. |
| string | Override git-push command. |
| string | The location of an .md file that includes the project-level changelog. |
changelogFileRequired
public readonly changelogFile: string;
- Type: string
The location of an .md file (relative to dist/) that includes the changelog for the release.
Example
changelog.md
releaseTagFileRequired
public readonly releaseTagFile: string;
- Type: string
The location of a text file (relative to dist/) that contains the release tag.
Example
releasetag.txt
versionFileRequired
public readonly versionFile: string;
- Type: string
The location of a text file (relative to dist/) that contains the version number.
Example
version.txt
gitBranchOptional
public readonly gitBranch: string;
- Type: string
- Default: "main"
Branch to push to.
gitPushCommandOptional
public readonly gitPushCommand: string;
- Type: string
Override git-push command.
Set to an empty string to disable pushing.
projectChangelogFileOptional
public readonly projectChangelogFile: string;
- Type: string
The location of an .md file that includes the project-level changelog.
GoPublishOptions
Options for Go releases.
Initializer
import { release } from 'projen'
const goPublishOptions: release.GoPublishOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | The GitHub Actions environment used for publishing. |
| projen.github.workflows.JobStep[] | Steps to execute after executing the publishing command. |
| projen.github.workflows.JobStep[] | Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed. |
| projen.github.workflows.Tools | Additional tools to install in the publishing job. |
| string | Branch to push to. |
| string | The commit message. |
| string | The name of the secret that includes a GitHub deploy key used to push to the GitHub repository. |
| string | The name of the secret that includes a personal GitHub access token used to push to the GitHub repository. |
| boolean | Use SSH to push to GitHub instead of a personal accses token. |
| string | The email to use in the release git commit. |
| string | The user name to use for the release git commit. |
githubEnvironmentOptional
public readonly githubEnvironment: string;
- Type: string
- Default: no environment used, unless set at the package level
The GitHub Actions environment used for publishing.
This can be used to add an explicit approval step to the release or limit who can initiate a release through environment protection rules.
Set this to overwrite a package level publishing environment just for this artifact.
postPublishStepsOptional
public readonly postPublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute after executing the publishing command.
These can be used to add/update the release artifacts ot any other tasks needed.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPostPublishingSteps.
prePublishStepsOptional
public readonly prePublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed.
These steps are executed after dist/ has been populated with the build
output.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPrePublishingSteps.
publishToolsOptional
public readonly publishTools: Tools;
- Type: projen.github.workflows.Tools
- Default: no additional tools are installed
Additional tools to install in the publishing job.
gitBranchOptional
public readonly gitBranch: string;
- Type: string
- Default: "main"
Branch to push to.
gitCommitMessageOptional
public readonly gitCommitMessage: string;
- Type: string
- Default: "chore(release): $VERSION"
The commit message.
githubDeployKeySecretOptional
public readonly githubDeployKeySecret: string;
- Type: string
- Default: "GO_GITHUB_DEPLOY_KEY"
The name of the secret that includes a GitHub deploy key used to push to the GitHub repository.
Ignored if githubUseSsh is false.
githubTokenSecretOptional
public readonly githubTokenSecret: string;
- Type: string
- Default: "GO_GITHUB_TOKEN"
The name of the secret that includes a personal GitHub access token used to push to the GitHub repository.
Ignored if githubUseSsh is true.
githubUseSshOptional
public readonly githubUseSsh: boolean;
- Type: boolean
- Default: false
Use SSH to push to GitHub instead of a personal accses token.
gitUserEmailOptional
public readonly gitUserEmail: string;
- Type: string
- Default: default GitHub Actions user email
The email to use in the release git commit.
gitUserNameOptional
public readonly gitUserName: string;
- Type: string
- Default: default GitHub Actions user name
The user name to use for the release git commit.
JsiiReleaseGo
Initializer
import { release } from 'projen'
const jsiiReleaseGo: release.JsiiReleaseGo = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | The GitHub Actions environment used for publishing. |
| projen.github.workflows.JobStep[] | Steps to execute after executing the publishing command. |
| projen.github.workflows.JobStep[] | Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed. |
| projen.github.workflows.Tools | Additional tools to install in the publishing job. |
| string | Branch to push to. |
| string | The commit message. |
| string | The name of the secret that includes a GitHub deploy key used to push to the GitHub repository. |
| string | The name of the secret that includes a personal GitHub access token used to push to the GitHub repository. |
| boolean | Use SSH to push to GitHub instead of a personal accses token. |
| string | The email to use in the release git commit. |
| string | The user name to use for the release git commit. |
githubEnvironmentOptional
githubEnvironment- Deprecated: Use
GoPublishOptionsinstead.
public readonly githubEnvironment: string;
- Type: string
- Default: no environment used, unless set at the package level
The GitHub Actions environment used for publishing.
This can be used to add an explicit approval step to the release or limit who can initiate a release through environment protection rules.
Set this to overwrite a package level publishing environment just for this artifact.
postPublishStepsOptional
postPublishSteps- Deprecated: Use
GoPublishOptionsinstead.
public readonly postPublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute after executing the publishing command.
These can be used to add/update the release artifacts ot any other tasks needed.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPostPublishingSteps.
prePublishStepsOptional
prePublishSteps- Deprecated: Use
GoPublishOptionsinstead.
public readonly prePublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed.
These steps are executed after dist/ has been populated with the build
output.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPrePublishingSteps.
publishToolsOptional
publishTools- Deprecated: Use
GoPublishOptionsinstead.
public readonly publishTools: Tools;
- Type: projen.github.workflows.Tools
- Default: no additional tools are installed
Additional tools to install in the publishing job.
gitBranchOptional
gitBranch- Deprecated: Use
GoPublishOptionsinstead.
public readonly gitBranch: string;
- Type: string
- Default: "main"
Branch to push to.
gitCommitMessageOptional
gitCommitMessage- Deprecated: Use
GoPublishOptionsinstead.
public readonly gitCommitMessage: string;
- Type: string
- Default: "chore(release): $VERSION"
The commit message.
githubDeployKeySecretOptional
githubDeployKeySecret- Deprecated: Use
GoPublishOptionsinstead.
public readonly githubDeployKeySecret: string;
- Type: string
- Default: "GO_GITHUB_DEPLOY_KEY"
The name of the secret that includes a GitHub deploy key used to push to the GitHub repository.
Ignored if githubUseSsh is false.
githubTokenSecretOptional
githubTokenSecret- Deprecated: Use
GoPublishOptionsinstead.
public readonly githubTokenSecret: string;
- Type: string
- Default: "GO_GITHUB_TOKEN"
The name of the secret that includes a personal GitHub access token used to push to the GitHub repository.
Ignored if githubUseSsh is true.
githubUseSshOptional
githubUseSsh- Deprecated: Use
GoPublishOptionsinstead.
public readonly githubUseSsh: boolean;
- Type: boolean
- Default: false
Use SSH to push to GitHub instead of a personal accses token.
gitUserEmailOptional
gitUserEmail- Deprecated: Use
GoPublishOptionsinstead.
public readonly gitUserEmail: string;
- Type: string
- Default: default GitHub Actions user email
The email to use in the release git commit.
gitUserNameOptional
gitUserName- Deprecated: Use
GoPublishOptionsinstead.
public readonly gitUserName: string;
- Type: string
- Default: default GitHub Actions user name
The user name to use for the release git commit.
JsiiReleaseMaven
Initializer
import { release } from 'projen'
const jsiiReleaseMaven: release.JsiiReleaseMaven = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | The GitHub Actions environment used for publishing. |
| projen.github.workflows.JobStep[] | Steps to execute after executing the publishing command. |
| projen.github.workflows.JobStep[] | Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed. |
| projen.github.workflows.Tools | Additional tools to install in the publishing job. |
| string | URL of Nexus repository. |
| string | GitHub secret name which contains the GPG private key or file that includes it. |
| string | GitHub secret name which contains the GPG private key or file that includes it. |
| string | GitHub secret name which contains the Password for maven repository. |
| string | Deployment repository when not deploying to Maven Central. |
| string | Used in maven settings for credential lookup (e.g. use github when publishing to GitHub). |
| string | GitHub secret name which contains the Maven Central (sonatype) staging profile ID (e.g. 68a05363083174). Staging profile ID can be found in the URL of the "Releases" staging profile under "Staging Profiles" in https://oss.sonatype.org (e.g. https://oss.sonatype.org/#stagingProfiles;11a33451234521). |
| string | GitHub secret name which contains the Username for maven repository. |
githubEnvironmentOptional
githubEnvironment- Deprecated: Use
MavenPublishOptionsinstead.
public readonly githubEnvironment: string;
- Type: string
- Default: no environment used, unless set at the package level
The GitHub Actions environment used for publishing.
This can be used to add an explicit approval step to the release or limit who can initiate a release through environment protection rules.
Set this to overwrite a package level publishing environment just for this artifact.
postPublishStepsOptional
postPublishSteps- Deprecated: Use
MavenPublishOptionsinstead.
public readonly postPublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute after executing the publishing command.
These can be used to add/update the release artifacts ot any other tasks needed.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPostPublishingSteps.
prePublishStepsOptional
prePublishSteps- Deprecated: Use
MavenPublishOptionsinstead.
public readonly prePublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed.
These steps are executed after dist/ has been populated with the build
output.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPrePublishingSteps.
publishToolsOptional
publishTools- Deprecated: Use
MavenPublishOptionsinstead.
public readonly publishTools: Tools;
- Type: projen.github.workflows.Tools
- Default: no additional tools are installed
Additional tools to install in the publishing job.
mavenEndpointOptional
mavenEndpoint- Deprecated: Use
MavenPublishOptionsinstead.
public readonly mavenEndpoint: string;
- Type: string
- Default: "https://oss.sonatype.org" or none when publishing to Maven Central
URL of Nexus repository.
if not set, defaults to https://oss.sonatype.org
mavenGpgPrivateKeyPassphraseOptional
mavenGpgPrivateKeyPassphrase- Deprecated: Use
MavenPublishOptionsinstead.
public readonly mavenGpgPrivateKeyPassphrase: string;
- Type: string
- Default: "MAVEN_GPG_PRIVATE_KEY_PASSPHRASE" or not set when using GitHub Packages
GitHub secret name which contains the GPG private key or file that includes it.
This is used to sign your Maven packages. See instructions.
mavenGpgPrivateKeySecretOptional
mavenGpgPrivateKeySecret- Deprecated: Use
MavenPublishOptionsinstead.
public readonly mavenGpgPrivateKeySecret: string;
- Type: string
- Default: "MAVEN_GPG_PRIVATE_KEY" or not set when using GitHub Packages
GitHub secret name which contains the GPG private key or file that includes it.
This is used to sign your Maven packages. See instructions.
mavenPasswordOptional
mavenPassword- Deprecated: Use
MavenPublishOptionsinstead.
public readonly mavenPassword: string;
- Type: string
- Default: "MAVEN_PASSWORD" or "GITHUB_TOKEN" when using GitHub Packages
GitHub secret name which contains the Password for maven repository.
For Maven Central, you will need to Create JIRA account and then request a new project (see links).
https://issues.sonatype.org/secure/CreateIssue.jspa?issuetype=21&pid=10134
mavenRepositoryUrlOptional
mavenRepositoryUrl- Deprecated: Use
MavenPublishOptionsinstead.
public readonly mavenRepositoryUrl: string;
- Type: string
- Default: not set
Deployment repository when not deploying to Maven Central.
mavenServerIdOptional
mavenServerId- Deprecated: Use
MavenPublishOptionsinstead.
public readonly mavenServerId: string;
- Type: string
- Default: "ossrh" (Maven Central) or "github" when using GitHub Packages
Used in maven settings for credential lookup (e.g. use github when publishing to GitHub).
Set to central-ossrh to publish to Maven Central.
mavenStagingProfileIdOptional
mavenStagingProfileId- Deprecated: Use
MavenPublishOptionsinstead.
public readonly mavenStagingProfileId: string;
- Type: string
- Default: "MAVEN_STAGING_PROFILE_ID" or not set when using GitHub Packages
GitHub secret name which contains the Maven Central (sonatype) staging profile ID (e.g. 68a05363083174). Staging profile ID can be found in the URL of the "Releases" staging profile under "Staging Profiles" in https://oss.sonatype.org (e.g. https://oss.sonatype.org/#stagingProfiles;11a33451234521).
mavenUsernameOptional
mavenUsername- Deprecated: Use
MavenPublishOptionsinstead.
public readonly mavenUsername: string;
- Type: string
- Default: "MAVEN_USERNAME" or the GitHub Actor when using GitHub Packages
GitHub secret name which contains the Username for maven repository.
For Maven Central, you will need to Create JIRA account and then request a new project (see links).
https://issues.sonatype.org/secure/CreateIssue.jspa?issuetype=21&pid=10134
JsiiReleaseNpm
Initializer
import { release } from 'projen'
const jsiiReleaseNpm: release.JsiiReleaseNpm = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | The GitHub Actions environment used for publishing. |
| projen.github.workflows.JobStep[] | Steps to execute after executing the publishing command. |
| projen.github.workflows.JobStep[] | Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed. |
| projen.github.workflows.Tools | Additional tools to install in the publishing job. |
| | Options for publishing npm package to AWS CodeArtifact. |
| string | Tags can be used to provide an alias instead of version numbers. |
| boolean | Should provenance statements be generated when package is published. |
| string | GitHub secret which contains the NPM token to use for publishing packages. |
| string | The domain name of the npm package registry. |
| boolean | Use trusted publishing for publishing to npmjs.com Needs to be pre-configured on npm.js to work. |
githubEnvironmentOptional
githubEnvironment- Deprecated: Use
NpmPublishOptionsinstead.
public readonly githubEnvironment: string;
- Type: string
- Default: no environment used, unless set at the package level
The GitHub Actions environment used for publishing.
This can be used to add an explicit approval step to the release or limit who can initiate a release through environment protection rules.
Set this to overwrite a package level publishing environment just for this artifact.
postPublishStepsOptional
postPublishSteps- Deprecated: Use
NpmPublishOptionsinstead.
public readonly postPublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute after executing the publishing command.
These can be used to add/update the release artifacts ot any other tasks needed.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPostPublishingSteps.
prePublishStepsOptional
prePublishSteps- Deprecated: Use
NpmPublishOptionsinstead.
public readonly prePublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed.
These steps are executed after dist/ has been populated with the build
output.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPrePublishingSteps.
publishToolsOptional
publishTools- Deprecated: Use
NpmPublishOptionsinstead.
public readonly publishTools: Tools;
- Type: projen.github.workflows.Tools
- Default: no additional tools are installed
Additional tools to install in the publishing job.
codeArtifactOptionsOptional
codeArtifactOptions- Deprecated: Use
NpmPublishOptionsinstead.
public readonly codeArtifactOptions: CodeArtifactOptions;
- Type: CodeArtifactOptions
- Default: package is not published to
Options for publishing npm package to AWS CodeArtifact.
distTagOptional
distTag- Deprecated: Use
npmDistTagfor each release branch instead.
public readonly distTag: string;
- Type: string
- Default: "latest"
Tags can be used to provide an alias instead of version numbers.
For example, a project might choose to have multiple streams of development and use a different tag for each stream, e.g., stable, beta, dev, canary.
By default, the latest tag is used by npm to identify the current version
of a package, and npm install <pkg> (without any @<version> or @<tag>
specifier) installs the latest tag. Typically, projects only use the
latest tag for stable release versions, and use other tags for unstable
versions such as prereleases.
The next tag is used by some projects to identify the upcoming version.
npmProvenanceOptional
npmProvenance- Deprecated: Use
NpmPublishOptionsinstead.
public readonly npmProvenance: boolean;
- Type: boolean
- Default: enabled for for public packages using trusted publishing, disabled otherwise
Should provenance statements be generated when package is published.
Note that this component is using publib to publish packages,
which is using npm internally and supports provenance statements independently of the package manager used.
Only works in supported CI/CD environments.
npmTokenSecretOptional
npmTokenSecret- Deprecated: Use
NpmPublishOptionsinstead.
public readonly npmTokenSecret: string;
- Type: string
- Default: "NPM_TOKEN" or "GITHUB_TOKEN" if
registryis set tonpm.pkg.github.com.
GitHub secret which contains the NPM token to use for publishing packages.
registryOptional
registry- Deprecated: Use
NpmPublishOptionsinstead.
public readonly registry: string;
- Type: string
- Default: "registry.npmjs.org"
The domain name of the npm package registry.
To publish to GitHub Packages, set this value to "npm.pkg.github.com". In
this if npmTokenSecret is not specified, it will default to
GITHUB_TOKEN which means that you will be able to publish to the
repository's package store. In this case, make sure repositoryUrl is
correctly defined.
Example
"npm.pkg.github.com"
trustedPublishingOptional
trustedPublishing- Deprecated: Use
NpmPublishOptionsinstead.
public readonly trustedPublishing: boolean;
- Type: boolean
- Default: false
Use trusted publishing for publishing to npmjs.com Needs to be pre-configured on npm.js to work.
Requires npm CLI version 11.5.1 or later, this is NOT ensured automatically.
When used, npmTokenSecret will be ignored.
JsiiReleaseNuget
Initializer
import { release } from 'projen'
const jsiiReleaseNuget: release.JsiiReleaseNuget = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | The GitHub Actions environment used for publishing. |
| projen.github.workflows.JobStep[] | Steps to execute after executing the publishing command. |
| projen.github.workflows.JobStep[] | Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed. |
| projen.github.workflows.Tools | Additional tools to install in the publishing job. |
| string | GitHub secret which contains the API key for NuGet. |
| string | NuGet Server URL (defaults to nuget.org). |
| string | The NuGet.org username (profile name, not email address) for trusted publisher authentication. |
| boolean | Use NuGet trusted publishing instead of API keys. |
githubEnvironmentOptional
githubEnvironment- Deprecated: Use
NugetPublishOptionsinstead.
public readonly githubEnvironment: string;
- Type: string
- Default: no environment used, unless set at the package level
The GitHub Actions environment used for publishing.
This can be used to add an explicit approval step to the release or limit who can initiate a release through environment protection rules.
Set this to overwrite a package level publishing environment just for this artifact.
postPublishStepsOptional
postPublishSteps- Deprecated: Use
NugetPublishOptionsinstead.
public readonly postPublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute after executing the publishing command.
These can be used to add/update the release artifacts ot any other tasks needed.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPostPublishingSteps.
prePublishStepsOptional
prePublishSteps- Deprecated: Use
NugetPublishOptionsinstead.
public readonly prePublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed.
These steps are executed after dist/ has been populated with the build
output.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPrePublishingSteps.
publishToolsOptional
publishTools- Deprecated: Use
NugetPublishOptionsinstead.
public readonly publishTools: Tools;
- Type: projen.github.workflows.Tools
- Default: no additional tools are installed
Additional tools to install in the publishing job.
nugetApiKeySecretOptional
nugetApiKeySecret- Deprecated: Use
NugetPublishOptionsinstead.
public readonly nugetApiKeySecret: string;
- Type: string
- Default: "NUGET_API_KEY"
GitHub secret which contains the API key for NuGet.
nugetServerOptional
nugetServer- Deprecated: Use
NugetPublishOptionsinstead.
public readonly nugetServer: string;
- Type: string
NuGet Server URL (defaults to nuget.org).
nugetUsernameSecretOptional
nugetUsernameSecret- Deprecated: Use
NugetPublishOptionsinstead.
public readonly nugetUsernameSecret: string;
- Type: string
- Default: "NUGET_USERNAME"
The NuGet.org username (profile name, not email address) for trusted publisher authentication.
Required when using trusted publishing.
trustedPublishingOptional
trustedPublishing- Deprecated: Use
NugetPublishOptionsinstead.
public readonly trustedPublishing: boolean;
- Type: boolean
Use NuGet trusted publishing instead of API keys.
Needs to be setup in NuGet.org.
https://learn.microsoft.com/en-us/nuget/nuget-org/trusted-publishing
JsiiReleasePyPi
Initializer
import { release } from 'projen'
const jsiiReleasePyPi: release.JsiiReleasePyPi = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | The GitHub Actions environment used for publishing. |
| projen.github.workflows.JobStep[] | Steps to execute after executing the publishing command. |
| projen.github.workflows.JobStep[] | Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed. |
| projen.github.workflows.Tools | Additional tools to install in the publishing job. |
| boolean | Generate and publish cryptographic attestations for files uploaded to PyPI. |
| | Options for publishing to AWS CodeArtifact. |
| boolean | Use PyPI trusted publishing instead of tokens or username & password. |
| string | The GitHub secret which contains PyPI password. |
| string | The registry url to use when releasing packages. |
| string | The GitHub secret which contains PyPI user name. |
githubEnvironmentOptional
githubEnvironment- Deprecated: Use
PyPiPublishOptionsinstead.
public readonly githubEnvironment: string;
- Type: string
- Default: no environment used, unless set at the package level
The GitHub Actions environment used for publishing.
This can be used to add an explicit approval step to the release or limit who can initiate a release through environment protection rules.
Set this to overwrite a package level publishing environment just for this artifact.
postPublishStepsOptional
postPublishSteps- Deprecated: Use
PyPiPublishOptionsinstead.
public readonly postPublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute after executing the publishing command.
These can be used to add/update the release artifacts ot any other tasks needed.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPostPublishingSteps.
prePublishStepsOptional
prePublishSteps- Deprecated: Use
PyPiPublishOptionsinstead.
public readonly prePublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed.
These steps are executed after dist/ has been populated with the build
output.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPrePublishingSteps.
publishToolsOptional
publishTools- Deprecated: Use
PyPiPublishOptionsinstead.
public readonly publishTools: Tools;
- Type: projen.github.workflows.Tools
- Default: no additional tools are installed
Additional tools to install in the publishing job.
attestationsOptional
attestations- Deprecated: Use
PyPiPublishOptionsinstead.
public readonly attestations: boolean;
- Type: boolean
- Default: enabled when using trusted publishing, otherwise not applicable
Generate and publish cryptographic attestations for files uploaded to PyPI.
Attestations provide package provenance and integrity an can be viewed on PyPI. They are only available when using a Trusted Publisher for publishing.
codeArtifactOptionsOptional
codeArtifactOptions- Deprecated: Use
PyPiPublishOptionsinstead.
public readonly codeArtifactOptions: CodeArtifactOptions;
- Type: CodeArtifactOptions
- Default: undefined
Options for publishing to AWS CodeArtifact.
trustedPublishingOptional
trustedPublishing- Deprecated: Use
PyPiPublishOptionsinstead.
public readonly trustedPublishing: boolean;
- Type: boolean
Use PyPI trusted publishing instead of tokens or username & password.
Needs to be setup in PyPI.
https://docs.pypi.org/trusted-publishers/adding-a-publisher/
twinePasswordSecretOptional
twinePasswordSecret- Deprecated: Use
PyPiPublishOptionsinstead.
public readonly twinePasswordSecret: string;
- Type: string
- Default: "TWINE_PASSWORD"
The GitHub secret which contains PyPI password.
twineRegistryUrlOptional
twineRegistryUrl- Deprecated: Use
PyPiPublishOptionsinstead.
public readonly twineRegistryUrl: string;
- Type: string
- Default: twine default
The registry url to use when releasing packages.
twineUsernameSecretOptional
twineUsernameSecret- Deprecated: Use
PyPiPublishOptionsinstead.
public readonly twineUsernameSecret: string;
- Type: string
- Default: "TWINE_USERNAME"
The GitHub secret which contains PyPI user name.
ManualReleaseOptions
Initializer
import { release } from 'projen'
const manualReleaseOptions: release.ManualReleaseOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| boolean | Maintain a project-level changelog. |
| string | Project-level changelog file path. |
| string | Override git-push command. |
changelogOptional
public readonly changelog: boolean;
- Type: boolean
- Default: true
Maintain a project-level changelog.
changelogPathOptional
public readonly changelogPath: string;
- Type: string
- Default: 'CHANGELOG.md'
Project-level changelog file path.
Ignored if changelog is false.
gitPushCommandOptional
public readonly gitPushCommand: string;
- Type: string
Override git-push command.
Set to an empty string to disable pushing.
MavenPublishOptions
Options for Maven releases.
Initializer
import { release } from 'projen'
const mavenPublishOptions: release.MavenPublishOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | The GitHub Actions environment used for publishing. |
| projen.github.workflows.JobStep[] | Steps to execute after executing the publishing command. |
| projen.github.workflows.JobStep[] | Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed. |
| projen.github.workflows.Tools | Additional tools to install in the publishing job. |
| string | URL of Nexus repository. |
| string | GitHub secret name which contains the GPG private key or file that includes it. |
| string | GitHub secret name which contains the GPG private key or file that includes it. |
| string | GitHub secret name which contains the Password for maven repository. |
| string | Deployment repository when not deploying to Maven Central. |
| string | Used in maven settings for credential lookup (e.g. use github when publishing to GitHub). |
| string | GitHub secret name which contains the Maven Central (sonatype) staging profile ID (e.g. 68a05363083174). Staging profile ID can be found in the URL of the "Releases" staging profile under "Staging Profiles" in https://oss.sonatype.org (e.g. https://oss.sonatype.org/#stagingProfiles;11a33451234521). |
| string | GitHub secret name which contains the Username for maven repository. |
githubEnvironmentOptional
public readonly githubEnvironment: string;
- Type: string
- Default: no environment used, unless set at the package level
The GitHub Actions environment used for publishing.
This can be used to add an explicit approval step to the release or limit who can initiate a release through environment protection rules.
Set this to overwrite a package level publishing environment just for this artifact.
postPublishStepsOptional
public readonly postPublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute after executing the publishing command.
These can be used to add/update the release artifacts ot any other tasks needed.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPostPublishingSteps.
prePublishStepsOptional
public readonly prePublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed.
These steps are executed after dist/ has been populated with the build
output.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPrePublishingSteps.
publishToolsOptional
public readonly publishTools: Tools;
- Type: projen.github.workflows.Tools
- Default: no additional tools are installed
Additional tools to install in the publishing job.
mavenEndpointOptional
public readonly mavenEndpoint: string;
- Type: string
- Default: "https://oss.sonatype.org" or none when publishing to Maven Central
URL of Nexus repository.
if not set, defaults to https://oss.sonatype.org
mavenGpgPrivateKeyPassphraseOptional
public readonly mavenGpgPrivateKeyPassphrase: string;
- Type: string
- Default: "MAVEN_GPG_PRIVATE_KEY_PASSPHRASE" or not set when using GitHub Packages
GitHub secret name which contains the GPG private key or file that includes it.
This is used to sign your Maven packages. See instructions.
mavenGpgPrivateKeySecretOptional
public readonly mavenGpgPrivateKeySecret: string;
- Type: string
- Default: "MAVEN_GPG_PRIVATE_KEY" or not set when using GitHub Packages
GitHub secret name which contains the GPG private key or file that includes it.
This is used to sign your Maven packages. See instructions.
mavenPasswordOptional
public readonly mavenPassword: string;
- Type: string
- Default: "MAVEN_PASSWORD" or "GITHUB_TOKEN" when using GitHub Packages
GitHub secret name which contains the Password for maven repository.
For Maven Central, you will need to Create JIRA account and then request a new project (see links).
https://issues.sonatype.org/secure/CreateIssue.jspa?issuetype=21&pid=10134
mavenRepositoryUrlOptional
public readonly mavenRepositoryUrl: string;
- Type: string
- Default: not set
Deployment repository when not deploying to Maven Central.
mavenServerIdOptional
public readonly mavenServerId: string;
- Type: string
- Default: "ossrh" (Maven Central) or "github" when using GitHub Packages
Used in maven settings for credential lookup (e.g. use github when publishing to GitHub).
Set to central-ossrh to publish to Maven Central.
mavenStagingProfileIdOptional
public readonly mavenStagingProfileId: string;
- Type: string
- Default: "MAVEN_STAGING_PROFILE_ID" or not set when using GitHub Packages
GitHub secret name which contains the Maven Central (sonatype) staging profile ID (e.g. 68a05363083174). Staging profile ID can be found in the URL of the "Releases" staging profile under "Staging Profiles" in https://oss.sonatype.org (e.g. https://oss.sonatype.org/#stagingProfiles;11a33451234521).
mavenUsernameOptional
public readonly mavenUsername: string;
- Type: string
- Default: "MAVEN_USERNAME" or the GitHub Actor when using GitHub Packages
GitHub secret name which contains the Username for maven repository.
For Maven Central, you will need to Create JIRA account and then request a new project (see links).
https://issues.sonatype.org/secure/CreateIssue.jspa?issuetype=21&pid=10134
NpmPublishOptions
Options for npm release.
Initializer
import { release } from 'projen'
const npmPublishOptions: release.NpmPublishOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | The GitHub Actions environment used for publishing. |
| projen.github.workflows.JobStep[] | Steps to execute after executing the publishing command. |
| projen.github.workflows.JobStep[] | Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed. |
| projen.github.workflows.Tools | Additional tools to install in the publishing job. |
| | Options for publishing npm package to AWS CodeArtifact. |
| string | Tags can be used to provide an alias instead of version numbers. |
| boolean | Should provenance statements be generated when package is published. |
| string | GitHub secret which contains the NPM token to use for publishing packages. |
| string | The domain name of the npm package registry. |
| boolean | Use trusted publishing for publishing to npmjs.com Needs to be pre-configured on npm.js to work. |
githubEnvironmentOptional
public readonly githubEnvironment: string;
- Type: string
- Default: no environment used, unless set at the package level
The GitHub Actions environment used for publishing.
This can be used to add an explicit approval step to the release or limit who can initiate a release through environment protection rules.
Set this to overwrite a package level publishing environment just for this artifact.
postPublishStepsOptional
public readonly postPublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute after executing the publishing command.
These can be used to add/update the release artifacts ot any other tasks needed.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPostPublishingSteps.
prePublishStepsOptional
public readonly prePublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed.
These steps are executed after dist/ has been populated with the build
output.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPrePublishingSteps.
publishToolsOptional
public readonly publishTools: Tools;
- Type: projen.github.workflows.Tools
- Default: no additional tools are installed
Additional tools to install in the publishing job.
codeArtifactOptionsOptional
public readonly codeArtifactOptions: CodeArtifactOptions;
- Type: CodeArtifactOptions
- Default: package is not published to
Options for publishing npm package to AWS CodeArtifact.
distTagOptional
distTag- Deprecated: Use
npmDistTagfor each release branch instead.
public readonly distTag: string;
- Type: string
- Default: "latest"
Tags can be used to provide an alias instead of version numbers.
For example, a project might choose to have multiple streams of development and use a different tag for each stream, e.g., stable, beta, dev, canary.
By default, the latest tag is used by npm to identify the current version
of a package, and npm install <pkg> (without any @<version> or @<tag>
specifier) installs the latest tag. Typically, projects only use the
latest tag for stable release versions, and use other tags for unstable
versions such as prereleases.
The next tag is used by some projects to identify the upcoming version.
npmProvenanceOptional
public readonly npmProvenance: boolean;
- Type: boolean
- Default: enabled for for public packages using trusted publishing, disabled otherwise
Should provenance statements be generated when package is published.
Note that this component is using publib to publish packages,
which is using npm internally and supports provenance statements independently of the package manager used.
Only works in supported CI/CD environments.
npmTokenSecretOptional
public readonly npmTokenSecret: string;
- Type: string
- Default: "NPM_TOKEN" or "GITHUB_TOKEN" if
registryis set tonpm.pkg.github.com.
GitHub secret which contains the NPM token to use for publishing packages.
registryOptional
public readonly registry: string;
- Type: string
- Default: "registry.npmjs.org"
The domain name of the npm package registry.
To publish to GitHub Packages, set this value to "npm.pkg.github.com". In
this if npmTokenSecret is not specified, it will default to
GITHUB_TOKEN which means that you will be able to publish to the
repository's package store. In this case, make sure repositoryUrl is
correctly defined.
Example
"npm.pkg.github.com"
trustedPublishingOptional
public readonly trustedPublishing: boolean;
- Type: boolean
- Default: false
Use trusted publishing for publishing to npmjs.com Needs to be pre-configured on npm.js to work.
Requires npm CLI version 11.5.1 or later, this is NOT ensured automatically.
When used, npmTokenSecret will be ignored.
NugetPublishOptions
Options for NuGet releases.
Initializer
import { release } from 'projen'
const nugetPublishOptions: release.NugetPublishOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | The GitHub Actions environment used for publishing. |
| projen.github.workflows.JobStep[] | Steps to execute after executing the publishing command. |
| projen.github.workflows.JobStep[] | Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed. |
| projen.github.workflows.Tools | Additional tools to install in the publishing job. |
| string | GitHub secret which contains the API key for NuGet. |
| string | NuGet Server URL (defaults to nuget.org). |
| string | The NuGet.org username (profile name, not email address) for trusted publisher authentication. |
| boolean | Use NuGet trusted publishing instead of API keys. |
githubEnvironmentOptional
public readonly githubEnvironment: string;
- Type: string
- Default: no environment used, unless set at the package level
The GitHub Actions environment used for publishing.
This can be used to add an explicit approval step to the release or limit who can initiate a release through environment protection rules.
Set this to overwrite a package level publishing environment just for this artifact.
postPublishStepsOptional
public readonly postPublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute after executing the publishing command.
These can be used to add/update the release artifacts ot any other tasks needed.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPostPublishingSteps.
prePublishStepsOptional
public readonly prePublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed.
These steps are executed after dist/ has been populated with the build
output.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPrePublishingSteps.
publishToolsOptional
public readonly publishTools: Tools;
- Type: projen.github.workflows.Tools
- Default: no additional tools are installed
Additional tools to install in the publishing job.
nugetApiKeySecretOptional
public readonly nugetApiKeySecret: string;
- Type: string
- Default: "NUGET_API_KEY"
GitHub secret which contains the API key for NuGet.
nugetServerOptional
public readonly nugetServer: string;
- Type: string
NuGet Server URL (defaults to nuget.org).
nugetUsernameSecretOptional
public readonly nugetUsernameSecret: string;
- Type: string
- Default: "NUGET_USERNAME"
The NuGet.org username (profile name, not email address) for trusted publisher authentication.
Required when using trusted publishing.
trustedPublishingOptional
public readonly trustedPublishing: boolean;
- Type: boolean
Use NuGet trusted publishing instead of API keys.
Needs to be setup in NuGet.org.
https://learn.microsoft.com/en-us/nuget/nuget-org/trusted-publishing
PublisherOptions
Options for Publisher.
Initializer
import { release } from 'projen'
const publisherOptions: release.PublisherOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | The name of the artifact to download (e.g. dist). |
| string | The job ID that produces the build artifacts. |
| string | A GitHub workflow expression used as a condition for publishers. |
| boolean | Do not actually publish, only print the commands that would be executed instead. |
| boolean | Create an issue when a publish task fails. |
| string | The label to apply to the issue marking failed publish tasks. |
| string | No description. |
| string | Version requirement for publib. |
| boolean | Define publishing tasks that can be executed manually as well as workflows. |
| string | Container image to use for GitHub workflows. |
| string | Node version to setup in GitHub workflows if any node-based CLI utilities are needed. |
| string[] | Github Runner selection labels. |
| projen.GroupRunnerOptions | Github Runner Group selection options. |
artifactNameRequired
public readonly artifactName: string;
- Type: string
The name of the artifact to download (e.g. dist).
The artifact is expected to include a subdirectory for each release target:
go (GitHub), dotnet (NuGet), java (Maven), js (npm), python
(PyPI).
buildJobIdRequired
public readonly buildJobId: string;
- Type: string
The job ID that produces the build artifacts.
All publish jobs will take a dependency on this job.
conditionOptional
public readonly condition: string;
- Type: string
- Default: no condition
A GitHub workflow expression used as a condition for publishers.
dryRunOptional
public readonly dryRun: boolean;
- Type: boolean
Do not actually publish, only print the commands that would be executed instead.
Useful if you wish to block all publishing from a single option.
failureIssueOptional
public readonly failureIssue: boolean;
- Type: boolean
- Default: false
Create an issue when a publish task fails.
failureIssueLabelOptional
public readonly failureIssueLabel: string;
- Type: string
- Default: "failed-release"
The label to apply to the issue marking failed publish tasks.
Only applies if failureIssue is true.
jsiiReleaseVersionOptional
jsiiReleaseVersion- Deprecated: use
publibVersioninstead
public readonly jsiiReleaseVersion: string;
- Type: string
publibVersionOptional
public readonly publibVersion: string;
- Type: string
- Default: "latest"
Version requirement for publib.
publishTasksOptional
public readonly publishTasks: boolean;
- Type: boolean
- Default: false
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.
workflowContainerImageOptional
public readonly workflowContainerImage: string;
- Type: string
- Default: default image
Container image to use for GitHub workflows.
workflowNodeVersionOptional
public readonly workflowNodeVersion: string;
- Type: string
- Default: lts/*
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.
workflowRunsOnOptional
public readonly workflowRunsOn: string[];
- Type: string[]
- Default: ["ubuntu-latest"]
Github Runner selection labels.
workflowRunsOnGroupOptional
public readonly workflowRunsOnGroup: GroupRunnerOptions;
- Type: projen.GroupRunnerOptions
Github Runner Group selection options.
PyPiPublishOptions
Options for PyPI release.
Initializer
import { release } from 'projen'
const pyPiPublishOptions: release.PyPiPublishOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | The GitHub Actions environment used for publishing. |
| projen.github.workflows.JobStep[] | Steps to execute after executing the publishing command. |
| projen.github.workflows.JobStep[] | Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed. |
| projen.github.workflows.Tools | Additional tools to install in the publishing job. |
| boolean | Generate and publish cryptographic attestations for files uploaded to PyPI. |
| | Options for publishing to AWS CodeArtifact. |
| boolean | Use PyPI trusted publishing instead of tokens or username & password. |
| string | The GitHub secret which contains PyPI password. |
| string | The registry url to use when releasing packages. |
| string | The GitHub secret which contains PyPI user name. |
githubEnvironmentOptional
public readonly githubEnvironment: string;
- Type: string
- Default: no environment used, unless set at the package level
The GitHub Actions environment used for publishing.
This can be used to add an explicit approval step to the release or limit who can initiate a release through environment protection rules.
Set this to overwrite a package level publishing environment just for this artifact.
postPublishStepsOptional
public readonly postPublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute after executing the publishing command.
These can be used to add/update the release artifacts ot any other tasks needed.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPostPublishingSteps.
prePublishStepsOptional
public readonly prePublishSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
Steps to execute before executing the publishing command. These can be used to prepare the artifact for publishing if needed.
These steps are executed after dist/ has been populated with the build
output.
Note that when using this in publishToGitHubReleases this will override steps added via addGitHubPrePublishingSteps.
publishToolsOptional
public readonly publishTools: Tools;
- Type: projen.github.workflows.Tools
- Default: no additional tools are installed
Additional tools to install in the publishing job.
attestationsOptional
public readonly attestations: boolean;
- Type: boolean
- Default: enabled when using trusted publishing, otherwise not applicable
Generate and publish cryptographic attestations for files uploaded to PyPI.
Attestations provide package provenance and integrity an can be viewed on PyPI. They are only available when using a Trusted Publisher for publishing.
codeArtifactOptionsOptional
public readonly codeArtifactOptions: CodeArtifactOptions;
- Type: CodeArtifactOptions
- Default: undefined
Options for publishing to AWS CodeArtifact.
trustedPublishingOptional
public readonly trustedPublishing: boolean;
- Type: boolean
Use PyPI trusted publishing instead of tokens or username & password.
Needs to be setup in PyPI.
https://docs.pypi.org/trusted-publishers/adding-a-publisher/
twinePasswordSecretOptional
public readonly twinePasswordSecret: string;
- Type: string
- Default: "TWINE_PASSWORD"
The GitHub secret which contains PyPI password.
twineRegistryUrlOptional
public readonly twineRegistryUrl: string;
- Type: string
- Default: twine default
The registry url to use when releasing packages.
twineUsernameSecretOptional
public readonly twineUsernameSecret: string;
- Type: string
- Default: "TWINE_USERNAME"
The GitHub secret which contains PyPI user name.
ReleaseOptions
Options for Release.
Initializer
import { release } from 'projen'
const releaseOptions: release.ReleaseOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | The commit-and-tag-version compatible package used to bump the package version, as a dependency string. |
| string | Version requirement of publib which is used to publish modules to npm. |
| number | Major version to release from the default branch. |
| number | Minimal Major version to release. |
| string | A shell command to control the next version to release. |
| string | The npmDistTag to use when publishing from the default branch. |
| projen.github.workflows.JobStep[] | Steps to execute after build as part of the release workflow. |
| string | Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre"). |
| boolean | Instead of actually publishing to package managers, just print the publishing command. |
| boolean | Define publishing tasks that can be executed manually as well as workflows. |
| projen.ReleasableCommits | Find commits that should be considered releasable Used to decide if a release is required. |
| | Defines additional release branches. |
| string | The GitHub Actions environment used for the release. |
| boolean | Automatically release new versions every commit to one of branches in releaseBranches. |
| boolean | Create a github issue on every failed publishing task. |
| string | The label to apply to issues indicating publish failures. |
| string | CRON schedule to trigger new releases. |
| string | Automatically add the given prefix to release tags. Useful if you are releasing on multiple branches with overlapping version numbers. |
| | The release trigger to use. |
| {[ key: string ]: string} | Build environment variables for release workflows. |
| string | The name of the default release workflow. |
| projen.github.workflows.JobStep[] | A set of workflow steps to execute in order to setup the workflow container. |
| {[ key: string ]: any} | Custom configuration used when creating changelog with commit-and-tag-version package. |
| string | Container image to use for GitHub workflows. |
| string[] | Github Runner selection labels. |
| projen.GroupRunnerOptions | Github Runner Group selection options. |
| string | A directory which will contain build artifacts. |
| string | The default branch name to release from. |
| projen.Task | The task to execute in order to create the release artifacts. |
| string | A name of a .json file to set the version field in after a bump. |
| boolean | Create a GitHub release for each release. |
| string | Node version to setup in GitHub workflows if any node-based CLI utilities are needed. |
| projen.github.workflows.JobPermissions | Permissions granted to the release workflow job. |
bumpPackageOptional
public readonly bumpPackage: string;
- Type: string
- Default: A recent version of "commit-and-tag-version"
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.
jsiiReleaseVersionOptional
public readonly jsiiReleaseVersion: string;
- Type: string
- Default: "latest"
Version requirement of publib which is used to publish modules to npm.
majorVersionOptional
public readonly majorVersion: number;
- Type: number
- Default: Major version is not enforced.
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.
minMajorVersionOptional
public readonly minMajorVersion: number;
- Type: number
- Default: No minimum version is being enforced
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.
nextVersionCommandOptional
public readonly nextVersionCommand: string;
- Type: string
- Default: The next version will be determined based on the commit history and project settings.
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 like1.2.3.$LATEST_TAG: the most recent tag. Looks likeprefix-v1.2.3, or may be unset.$SUGGESTED_BUMP: the suggested bump action based on commits. One ofmajor|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 bex.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.
npmDistTagOptional
public readonly npmDistTag: string;
- Type: string
- Default: "latest"
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.
postBuildStepsOptional
public readonly postBuildSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
- Default: []
Steps to execute after build as part of the release workflow.
prereleaseOptional
public readonly prerelease: string;
- Type: string
- Default: normal semantic versions
Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
publishDryRunOptional
public readonly publishDryRun: boolean;
- Type: boolean
- Default: false
Instead of actually publishing to package managers, just print the publishing command.
publishTasksOptional
public readonly publishTasks: boolean;
- Type: boolean
- Default: false
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.
releasableCommitsOptional
public readonly releasableCommits: ReleasableCommits;
- Type: projen.ReleasableCommits
- Default: ReleasableCommits.everyCommit()
Find commits that should be considered releasable Used to decide if a release is required.
releaseBranchesOptional
public readonly releaseBranches: {[ key: string ]: BranchOptions};
- Type: {[ key: string ]: BranchOptions}
- Default: no additional branches are used for release. you can use
addBranch()to add additional branches.
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.
releaseEnvironmentOptional
public readonly releaseEnvironment: string;
- Type: string
- Default: no environment used, unless set at the artifact level
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.
releaseEveryCommitOptional
releaseEveryCommit- Deprecated: Use
releaseTrigger: ReleaseTrigger.continuous()instead
public readonly releaseEveryCommit: boolean;
- Type: boolean
- Default: true
Automatically release new versions every commit to one of branches in releaseBranches.
releaseFailureIssueOptional
public readonly releaseFailureIssue: boolean;
- Type: boolean
- Default: false
Create a github issue on every failed publishing task.
releaseFailureIssueLabelOptional
public readonly releaseFailureIssueLabel: string;
- Type: string
- Default: "failed-release"
The label to apply to issues indicating publish failures.
Only applies if releaseFailureIssue is true.
releaseScheduleOptional
releaseSchedule- Deprecated: Use
releaseTrigger: ReleaseTrigger.scheduled()instead
public readonly releaseSchedule: string;
- Type: string
- Default: no scheduled releases
CRON schedule to trigger new releases.
releaseTagPrefixOptional
public readonly releaseTagPrefix: string;
- Type: string
- Default: "v"
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.
releaseTriggerOptional
public readonly releaseTrigger: ReleaseTrigger;
- Type: ReleaseTrigger
- Default: Continuous releases (
ReleaseTrigger.continuous())
The release trigger to use.
releaseWorkflowEnvOptional
public readonly releaseWorkflowEnv: {[ key: string ]: string};
- Type: {[ key: string ]: string}
- Default: {}
Build environment variables for release workflows.
releaseWorkflowNameOptional
public readonly releaseWorkflowName: string;
- Type: string
- Default: "release"
The name of the default release workflow.
releaseWorkflowSetupStepsOptional
public readonly releaseWorkflowSetupSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
A set of workflow steps to execute in order to setup the workflow container.
versionrcOptionsOptional
public readonly versionrcOptions: {[ key: string ]: any};
- Type: {[ key: string ]: any}
- Default: standard configuration applicable for GitHub repositories
Custom configuration used when creating changelog with commit-and-tag-version package.
Given values either append to default configuration or overwrite values in it.
workflowContainerImageOptional
public readonly workflowContainerImage: string;
- Type: string
- Default: default image
Container image to use for GitHub workflows.
workflowRunsOnOptional
public readonly workflowRunsOn: string[];
- Type: string[]
- Default: ["ubuntu-latest"]
Github Runner selection labels.
workflowRunsOnGroupOptional
public readonly workflowRunsOnGroup: GroupRunnerOptions;
- Type: projen.GroupRunnerOptions
Github Runner Group selection options.
artifactsDirectoryRequired
public readonly artifactsDirectory: string;
- Type: string
- Default: "dist"
A directory which will contain build artifacts.
branchRequired
public readonly branch: string;
- Type: string
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().
taskRequired
public readonly task: Task;
- Type: projen.Task
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.
versionFileRequired
public readonly versionFile: string;
- Type: string
A name of a .json file to set the version field in after a bump.
Example
"package.json"
githubReleaseOptional
public readonly githubRelease: boolean;
- Type: boolean
- Default: true
Create a GitHub release for each release.
workflowNodeVersionOptional
public readonly workflowNodeVersion: string;
- Type: string
- Default: "lts/*""
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.
workflowPermissionsOptional
public readonly workflowPermissions: JobPermissions;
- Type: projen.github.workflows.JobPermissions
- Default:
{ contents: JobPermission.WRITE }
Permissions granted to the release workflow job.
ReleaseProjectOptions
Project options for release.
Initializer
import { release } from 'projen'
const releaseProjectOptions: release.ReleaseProjectOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | The commit-and-tag-version compatible package used to bump the package version, as a dependency string. |
| string | Version requirement of publib which is used to publish modules to npm. |
| number | Major version to release from the default branch. |
| number | Minimal Major version to release. |
| string | A shell command to control the next version to release. |
| string | The npmDistTag to use when publishing from the default branch. |
| projen.github.workflows.JobStep[] | Steps to execute after build as part of the release workflow. |
| string | Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre"). |
| boolean | Instead of actually publishing to package managers, just print the publishing command. |
| boolean | Define publishing tasks that can be executed manually as well as workflows. |
| projen.ReleasableCommits | Find commits that should be considered releasable Used to decide if a release is required. |
| | Defines additional release branches. |
| string | The GitHub Actions environment used for the release. |
| boolean | Automatically release new versions every commit to one of branches in releaseBranches. |
| boolean | Create a github issue on every failed publishing task. |
| string | The label to apply to issues indicating publish failures. |
| string | CRON schedule to trigger new releases. |
| string | Automatically add the given prefix to release tags. Useful if you are releasing on multiple branches with overlapping version numbers. |
| | The release trigger to use. |
| {[ key: string ]: string} | Build environment variables for release workflows. |
| string | The name of the default release workflow. |
| projen.github.workflows.JobStep[] | A set of workflow steps to execute in order to setup the workflow container. |
| {[ key: string ]: any} | Custom configuration used when creating changelog with commit-and-tag-version package. |
| string | Container image to use for GitHub workflows. |
| string[] | Github Runner selection labels. |
| projen.GroupRunnerOptions | Github Runner Group selection options. |
bumpPackageOptional
public readonly bumpPackage: string;
- Type: string
- Default: A recent version of "commit-and-tag-version"
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.
jsiiReleaseVersionOptional
public readonly jsiiReleaseVersion: string;
- Type: string
- Default: "latest"
Version requirement of publib which is used to publish modules to npm.
majorVersionOptional
public readonly majorVersion: number;
- Type: number
- Default: Major version is not enforced.
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.
minMajorVersionOptional
public readonly minMajorVersion: number;
- Type: number
- Default: No minimum version is being enforced
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.
nextVersionCommandOptional
public readonly nextVersionCommand: string;
- Type: string
- Default: The next version will be determined based on the commit history and project settings.
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 like1.2.3.$LATEST_TAG: the most recent tag. Looks likeprefix-v1.2.3, or may be unset.$SUGGESTED_BUMP: the suggested bump action based on commits. One ofmajor|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 bex.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.
npmDistTagOptional
public readonly npmDistTag: string;
- Type: string
- Default: "latest"
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.
postBuildStepsOptional
public readonly postBuildSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
- Default: []
Steps to execute after build as part of the release workflow.
prereleaseOptional
public readonly prerelease: string;
- Type: string
- Default: normal semantic versions
Bump versions from the default branch as pre-releases (e.g. "beta", "alpha", "pre").
publishDryRunOptional
public readonly publishDryRun: boolean;
- Type: boolean
- Default: false
Instead of actually publishing to package managers, just print the publishing command.
publishTasksOptional
public readonly publishTasks: boolean;
- Type: boolean
- Default: false
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.
releasableCommitsOptional
public readonly releasableCommits: ReleasableCommits;
- Type: projen.ReleasableCommits
- Default: ReleasableCommits.everyCommit()
Find commits that should be considered releasable Used to decide if a release is required.
releaseBranchesOptional
public readonly releaseBranches: {[ key: string ]: BranchOptions};
- Type: {[ key: string ]: BranchOptions}
- Default: no additional branches are used for release. you can use
addBranch()to add additional branches.
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.
releaseEnvironmentOptional
public readonly releaseEnvironment: string;
- Type: string
- Default: no environment used, unless set at the artifact level
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.
releaseEveryCommitOptional
releaseEveryCommit- Deprecated: Use
releaseTrigger: ReleaseTrigger.continuous()instead
public readonly releaseEveryCommit: boolean;
- Type: boolean
- Default: true
Automatically release new versions every commit to one of branches in releaseBranches.
releaseFailureIssueOptional
public readonly releaseFailureIssue: boolean;
- Type: boolean
- Default: false
Create a github issue on every failed publishing task.
releaseFailureIssueLabelOptional
public readonly releaseFailureIssueLabel: string;
- Type: string
- Default: "failed-release"
The label to apply to issues indicating publish failures.
Only applies if releaseFailureIssue is true.
releaseScheduleOptional
releaseSchedule- Deprecated: Use
releaseTrigger: ReleaseTrigger.scheduled()instead
public readonly releaseSchedule: string;
- Type: string
- Default: no scheduled releases
CRON schedule to trigger new releases.
releaseTagPrefixOptional
public readonly releaseTagPrefix: string;
- Type: string
- Default: "v"
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.
releaseTriggerOptional
public readonly releaseTrigger: ReleaseTrigger;
- Type: ReleaseTrigger
- Default: Continuous releases (
ReleaseTrigger.continuous())
The release trigger to use.
releaseWorkflowEnvOptional
public readonly releaseWorkflowEnv: {[ key: string ]: string};
- Type: {[ key: string ]: string}
- Default: {}
Build environment variables for release workflows.
releaseWorkflowNameOptional
public readonly releaseWorkflowName: string;
- Type: string
- Default: "release"
The name of the default release workflow.
releaseWorkflowSetupStepsOptional
public readonly releaseWorkflowSetupSteps: JobStep[];
- Type: projen.github.workflows.JobStep[]
A set of workflow steps to execute in order to setup the workflow container.
versionrcOptionsOptional
public readonly versionrcOptions: {[ key: string ]: any};
- Type: {[ key: string ]: any}
- Default: standard configuration applicable for GitHub repositories
Custom configuration used when creating changelog with commit-and-tag-version package.
Given values either append to default configuration or overwrite values in it.
workflowContainerImageOptional
public readonly workflowContainerImage: string;
- Type: string
- Default: default image
Container image to use for GitHub workflows.
workflowRunsOnOptional
public readonly workflowRunsOn: string[];
- Type: string[]
- Default: ["ubuntu-latest"]
Github Runner selection labels.
workflowRunsOnGroupOptional
public readonly workflowRunsOnGroup: GroupRunnerOptions;
- Type: projen.GroupRunnerOptions
Github Runner Group selection options.
ScheduledReleaseOptions
Initializer
import { release } from 'projen'
const scheduledReleaseOptions: release.ScheduledReleaseOptions = { ... }
Properties
| Name | Type | Description |
|---|---|---|
| string | Cron schedule for releases. |
scheduleRequired
public readonly schedule: string;
- Type: string
Cron schedule for releases.
Only defined if this is a scheduled release.
Example
'0 17 * * *' - every day at 5 pm
Classes
ReleaseTrigger
Used to manage release strategies.
This includes release and release artifact automation
Static Functions
| Name | Description |
|---|---|
| Creates a continuous release trigger. |
| Creates a manual release trigger. |
| Creates a scheduled release trigger. |
| The release can only be triggered using the GitHub UI. |
continuous
import { release } from 'projen'
release.ReleaseTrigger.continuous(options?: ContinuousReleaseOptions)
Creates a continuous release trigger.
Automated releases will occur on every commit.
optionsOptional
- Type: ContinuousReleaseOptions
manual
import { release } from 'projen'
release.ReleaseTrigger.manual(options?: ManualReleaseOptions)
Creates a manual release trigger.
Use this option if you want totally manual releases.
This will give you a release task that, in addition to the normal
release activities will trigger a publish:git task. This task will
handle project-level changelog management, release tagging, and pushing
these artifacts to origin.
The command used for pushing can be customised by specifying
gitPushCommand. Set to an empty string to disable pushing entirely.
Simply run yarn release to trigger a manual release.
optionsOptional
- Type: ManualReleaseOptions
release options.
scheduled
import { release } from 'projen'
release.ReleaseTrigger.scheduled(options: ScheduledReleaseOptions)
Creates a scheduled release trigger.
Automated releases will occur based on the provided cron schedule.
optionsRequired
- Type: ScheduledReleaseOptions
release options.
workflowDispatch
import { release } from 'projen'
release.ReleaseTrigger.workflowDispatch()
The release can only be triggered using the GitHub UI.
Properties
| Name | Type | Description |
|---|---|---|
| boolean | Whether or not this is a continuous release. |
| boolean | Whether or not this is a release trigger with a manual task run in a working copy. |
| string | Project-level changelog file path. |
| string | Override git-push command used when releasing manually. |
| string[] | Paths for which pushes will trigger a release when isContinuous is true. |
| string | Cron schedule for releases. |
isContinuousRequired
public readonly isContinuous: boolean;
- Type: boolean
Whether or not this is a continuous release.
isManualRequired
public readonly isManual: boolean;
- Type: boolean
Whether or not this is a release trigger with a manual task run in a working copy.
If the ReleaseTrigger is a GitHub-only manual task, this will return false.
changelogPathOptional
public readonly changelogPath: string;
- Type: string
Project-level changelog file path.
gitPushCommandOptional
public readonly gitPushCommand: string;
- Type: string
Override git-push command used when releasing manually.
Set to an empty string to disable pushing.
pathsOptional
public readonly paths: string[];
- Type: string[]
Paths for which pushes will trigger a release when isContinuous is true.
scheduleOptional
public readonly schedule: string;
- Type: string
Cron schedule for releases.
Only defined if this is a scheduled release.
Example
'0 17 * * *' - every day at 5 pm
Enums
CodeArtifactAuthProvider
Options for authorizing requests to a AWS CodeArtifact npm repository.
Members
| Name | Description |
|---|---|
| Fixed credentials provided via Github secrets. |
| Ephemeral credentials provided via Github's OIDC integration with an IAM role. |
ACCESS_AND_SECRET_KEY_PAIR
Fixed credentials provided via Github secrets.
GITHUB_OIDC
Ephemeral credentials provided via Github's OIDC integration with an IAM role.
See: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc.html https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services