### Install Dependencies Source: https://github.com/googleapis/release-please/blob/main/CONTRIBUTING.md Run this command to install project dependencies before running tests. ```bash npm install ``` -------------------------------- ### Configure release-please manifest Source: https://github.com/googleapis/release-please/blob/main/docs/manifest-releaser.md Example configuration for various package types within a release-please manifest file. ```json "exclude-paths": ["path/to/myPyPkgA"] }, // path segment should be a folder relative to repository root "path/to/myJSPkgA": { // overrides release-type for node "release-type": "node", // create published GitHub Releases on `manifest-release` runs "draft": false }, "path/to/myJSPkgB": { // overrides release-type for node "release-type": "node", // overrides default release-as. // see top level note about deleting/modifying after release PR merge "release-as": "3.2.1" }, "path/to/my-rust-crate": { // override release-type for rust "release-type": "rust" }, "path/to/myPyPkgA": { // when a default release-as is set, this is how you revert to using // conventional commits version bumping for an individual package. // Note: if present and set to "", the behavior will always be to use // conventional commits, regardless of presence or absence of default // release-as config. "release-as": "", "package-name": "coolio-pkg", // our change log is located at path/to/myPyPkgA/docs/CHANGES.rst "changelog-path": "docs/CHANGES.rst" }, "path/to/github-enterprise-package": { // override changelog host for github enterprise package "changelog-host": "https://example.com" } } } ``` -------------------------------- ### Install release-please CLI Source: https://github.com/googleapis/release-please/blob/main/docs/cli.md Install the release-please CLI globally using npm. This command is required before using any release-please commands. ```bash npm i release-please -g ``` -------------------------------- ### Advanced Release Please Configuration Options Source: https://github.com/googleapis/release-please/blob/main/docs/manifest-releaser.md This example demonstrates most of the available configuration options for release-please, including bootstrap SHA, last release SHA, plugins, release types, versioning strategies, and changelog settings. Consult the JSON schema for a complete definition. ```json { "bootstrap-sha": "6fc119838885b0cb831e78ddd23ac01cb819e585", "last-release-sha": "7td2b9838885b3adf52e78ddd23ac01cb819e631", "plugins": ["node-workspace", "cargo-workspace"], "release-type": "python", "release-as": "1.2.3", "bump-minor-pre-major": true, "bump-patch-for-minor-pre-major": true, "prerelease-type": "beta", "changelog-sections": [...], "changelog-host": "https://example.com", "include-commit-authors": true, "draft": true, "prerelease": true } ``` -------------------------------- ### Configure release tag format Source: https://github.com/googleapis/release-please/blob/main/docs/manifest-releaser.md Examples of tag naming patterns and how to adjust them using the include-component-in-tag property. ```sh -v ``` ```sh ❯ looking for tagName: -v ⚠ Expected 1 releases, only found 0 ``` ```sh v ``` -------------------------------- ### Node Workspace Plugin Configuration Source: https://github.com/googleapis/release-please/blob/main/docs/manifest-releaser.md Example configuration for the node-workspace plugin, enabling updates for peer dependencies. ```json { "plugins": [ { "type": "node-workspace", "updatePeerDependencies": true } ] } ``` -------------------------------- ### Configure group-priority plugin Source: https://github.com/googleapis/release-please/blob/main/docs/manifest-releaser.md Example configuration for limiting release pull requests to specific prioritized groups. ```json { "release-type": "java", "packages": { "packages/rustA": { "component": "pkgA" }, "packages/rustB": { "component": "pkgB" } }, "plugins": [ { "type": "group-priority", "groups": ["snapshot"] } ] } ``` -------------------------------- ### Set initial version in .release-please-manifest.json Source: https://github.com/googleapis/release-please/blob/main/docs/manifest-releaser.md Manually add an entry to `.release-please-manifest.json` to specify the initial version for a package. This ensures release-please uses the correct starting version for subsequent releases. ```json { "path/to/pkg": "1.1.1" } ``` -------------------------------- ### Configure linked-versions and cargo-workspace Source: https://github.com/googleapis/release-please/blob/main/docs/manifest-releaser.md Example configuration for linking versions of Rust components while disabling internal workspace merging. ```json { "release-type": "rust", "packages": { "packages/rustA": { "component": "pkgA" }, "packages/rustB": { "component": "pkgB" } }, "plugins": [ { "type": "cargo-workspace", "merge": false }, { "type": "linked-versions", "groupName": "my group", "components": [ "pkgA", "pkgB" ] } ] } ``` -------------------------------- ### Sentence-case commit message output Source: https://github.com/googleapis/release-please/blob/main/docs/manifest-releaser.md Example of how a commit message is transformed into the CHANGELOG format using the sentence-case plugin. ```text Bug Fixes: * Patch issues in OpenSSL ``` -------------------------------- ### Block Annotation for Version Updates Source: https://github.com/googleapis/release-please/blob/main/docs/java-releases.md Use block annotations to surround lines of code where semver versions need replacement. Specify the artifact name and version type ('current' or 'released') at the start and end the block with '{x-version-end}'. ```java {x-version-start:my-artifact:current} String version = "1.0.0"; {x-version-end} ``` ```java {x-version-start:my-artifact:released} String version = "1.0.0"; {x-version-end} ``` -------------------------------- ### Block Current Version Update Source: https://github.com/googleapis/release-please/blob/main/test/updaters/fixtures/java-replacements-test.txt Use this directive for block version updates representing the current version. The versions listed between the start and end markers should always be replaced. ```plaintext # {x-version-update-start:module-name:current} 2.3.4 3.4.5 # {x-version-update-end} ``` -------------------------------- ### CLI Command: release-please bootstrap Source: https://github.com/googleapis/release-please/blob/main/docs/cli.md Initializes or updates release configuration files via a pull request. ```APIDOC ## CLI Command: release-please bootstrap ### Description This command generates the initial `release-please-config.json` and `.release-please-manifest.json` files or updates them with additional configurations. It automatically opens a pull request against the target branch. ### Parameters #### Options - **--token** (string) - Required - GitHub authentication token. - **--repo-url** (string) - Required - The repository URL in / format. - **--release-type** (ReleaseType) - Required - Language strategy that determines which files to update. - **--config-file** (string) - Optional - Override the path to the release-please config file. Defaults to `release-please-config.json`. - **--manifest-file** (string) - Optional - Override the path to the release-please manifest file. Defaults to `.release-please-manifest.json`. - **--path** (string) - Optional - Path for changes to consider part of this component's release. Defaults to `.`. - **--package-name** (string) - Optional - Name of the package being released. - **--component** (string) - Optional - Name of the component used for branch naming and release tagging. - **--initial-version** (string) - Optional - Version string to set as the last released version. Defaults to `0.0.0`. - **--versioning-strategy** (VersioningStrategyType) - Optional - Override method of determining SemVer version bumps. Defaults to `default`. - **--bump-minor-pre-major** (boolean) - Optional - Bump minor version for breaking changes for versions < 1.0.0. - **--bump-patch-for-minor-pre-major** (boolean) - Optional - Bump patch version for features for versions < 1.0.0. - **--prerelease-type** (string) - Optional - Configuration option for the prerelease versioning strategy. - **--draft** (boolean) - Optional - If set, create releases as drafts. ### Request Example ```bash release-please bootstrap \ --token=$GITHUB_TOKEN \ --repo-url=owner/repo \ --release-type=node ``` ``` -------------------------------- ### Run Tests Source: https://github.com/googleapis/release-please/blob/main/CONTRIBUTING.md Execute this command to run the project's test suite. ```bash npm test ``` -------------------------------- ### Compile and Test New Feature with CLI Source: https://github.com/googleapis/release-please/blob/main/CONTRIBUTING.md Compile the project and then use the Release Please CLI to test a new release PR. Ensure you have a GITHUB_TOKEN set. ```bash npm run compile && node build/src/bin/release-please.js release-pr \ --token=$GITHUB_TOKEN \ --repo-url=/ [extra options] ``` -------------------------------- ### Show Help for Manifest PR Command Source: https://github.com/googleapis/release-please/blob/main/docs/cli.md Use this command to display the help information for the `release-please manifest-pr` CLI command, detailing its options and usage. ```bash ❯ release-please manifest-pr --help release-please manifest-pr create a release-PR using a manifest file Options: --help Show help [boolean] --version Show version number [boolean] --debug print verbose errors (use only for local debugging). [boolean] [default: false] --trace print extra verbose errors (use only for local debugging). [boolean] [default: false] --token GitHub token with repo write permissions --api-url URL to use when making API requests [string] [default: "https://api.github.com"] --graphql-url URL to use when making GraphQL requests [string] [default: "https://api.github.com"] --default-branch The branch to open release PRs against and tag releases on [deprecated: use --target-branch instead] [string] --target-branch The branch to open release PRs against and tag releases on [string] --repo-url GitHub URL to generate release for [required] --dry-run Prepare but do not take action[boolean] [default: false] --label comma-separated list of labels to add to from release PR [default: "autorelease: pending"] --fork should the PR be created from a fork [boolean] [default: false] --draft-pull-request mark pull request as a draft [boolean] [default: false] --signoff Add Signed-off-by line at the end of the commit log message using the user and email provided. (format "Name "). [string] --config-file where can the config file be found in the project? [default: "release-please-config.json"] --manifest-file where can the manifest file be found in the project? [default: ".release-please-manifest.json"] ``` -------------------------------- ### Bootstrap release-please configuration Source: https://github.com/googleapis/release-please/blob/main/docs/cli.md Executes the bootstrap command to create or update configuration files in a repository. ```bash release-please bootstrap \ --token=$GITHUB_TOKEN \ --repo-url=/ \ --release-type= [extra options] ``` -------------------------------- ### Show Help for Manifest Release Command Source: https://github.com/googleapis/release-please/blob/main/docs/cli.md Use the `--help` flag to display detailed usage information and available options for the `release-please manifest-release` command. This command is deprecated and will be removed in a future major version. ```bash ❯ release-please manifest-release --help ``` -------------------------------- ### Create empty .release-please-manifest.json Source: https://github.com/googleapis/release-please/blob/main/docs/manifest-releaser.md Create an empty `.release-please-manifest.json` file using a shell command. This file is used for package version tracking. ```shell echo "{}" > .release-please-manifest.json ``` -------------------------------- ### Global CLI Options Source: https://github.com/googleapis/release-please/blob/main/docs/cli.md Configuration options applicable to all release-please CLI commands. ```APIDOC ## Global Options ### Description These options are available on all release-please commands to configure authentication, repository targeting, and logging behavior. ### Parameters #### Options - **--token** (string) - Required - GitHub token with repo write permissions - **--repo-url** (string) - Required - GitHub repository in the format of / - **--api-url** (string) - Optional - Base URI for making REST API requests. Defaults to https://api.github.com - **--graphql-url** (string) - Optional - Base URI for making GraphQL requests. Defaults to https://api.github.com - **--target-branch** (string) - Optional - The branch to open release PRs against and tag releases on. Defaults to the default branch of the repository - **--dry-run** (boolean) - Optional - If set, reports the activity that would happen without taking effect - **--debug** (boolean) - Optional - If set, sets log level to >=DEBUG - **--trace** (boolean) - Optional - If set, sets log level to >=TRACE ``` -------------------------------- ### Create a GitHub release Source: https://github.com/googleapis/release-please/blob/main/docs/cli.md Use this command to create a release directly on GitHub. ```bash release-please github-release \ --token=$GITHUB_TOKEN --repo-url=/ [extra options] ``` -------------------------------- ### Manifest Release Command Options Source: https://github.com/googleapis/release-please/blob/main/docs/cli.md This command creates releases/tags from the last release-PR using a manifest file. It requires a GitHub token with repo write permissions and the repository URL. Options include specifying API URLs, target branch, dry-run, draft releases, and custom labels. ```bash release-please manifest-release create releases/tags from last release-PR using a manifest file Options: --help Show help [boolean] --version Show version number [boolean] --debug print verbose errors (use only for local debugging). [boolean] [default: false] --trace print extra verbose errors (use only for local debugging). [boolean] [default: false] --token GitHub token with repo write permissions --api-url URL to use when making API requests [string] [default: "https://api.github.com"] --graphql-url URL to use when making GraphQL requests [string] [default: "https://api.github.com"] --default-branch The branch to open release PRs against and tag releases on [deprecated: use --target-branch instead] [string] --target-branch The branch to open release PRs against and tag releases on [string] --repo-url GitHub URL to generate release for [required] --dry-run Prepare but do not take action [boolean] [default: false] --draft mark release as a draft. no tag is created but tag_name and target_commitish are associated with the release for future tag creation upon "un-drafting" the release. [boolean] [default: false] --label comma-separated list of labels to remove to from release PR [default: "autorelease: pending"] --release-label set a pull request label other than "autorelease: tagged" [string] [default: "autorelease: tagged"] --config-file where can the config file be found in the project? [default: "release-please-config.json"] --manifest-file where can the manifest file be found in the project? [default: ".release-please-manifest.json"] ``` -------------------------------- ### Run CLI Command Directly Source: https://github.com/googleapis/release-please/blob/main/CONTRIBUTING.md This is an alternative way to run the Release Please CLI command directly, without the compilation step. ```bash release-please release-pr \ --token=$GITHUB_TOKEN \ --repo-url=/ [extra options] ``` -------------------------------- ### Minimal release-please-config.json for JS package Source: https://github.com/googleapis/release-please/blob/main/docs/manifest-releaser.md Create a minimal `release-please-config.json` file for a single JavaScript package, specifying the package path. ```json { "packages": { "path/to/pkg": {} } } ``` -------------------------------- ### Run release-please command Source: https://github.com/googleapis/release-please/blob/main/docs/manifest-releaser.md Execute the release-please command to generate a release pull request. Optionally provide a token, repository URL, and target branch. ```bash release-please [--token=your/apikey.txt] --repo-url=/ [--target-branch=testing] release-pr ``` -------------------------------- ### Configure Extra Files for Generic Updater Source: https://github.com/googleapis/release-please/blob/main/docs/customizing.md Use the 'extra-files' option to specify additional files to update with the Generic updater. This can be a simple list of paths. ```json { "extra-files": [ "path/to/file.md" ] } ``` -------------------------------- ### Debug release-please with CLI Source: https://github.com/googleapis/release-please/blob/main/docs/troubleshooting.md Use the CLI with --dry-run and --debug flags to inspect behavior without creating actual releases or pull requests. ```bash # install the release-please binary npm install -g release-please export GITHUB_TOKEN="my-access-token" release-please release-pr \ --token=${GITHUB_TOKEN} \ --repo-url=my-owner/my-repo \ --debug \ --dry-run ``` -------------------------------- ### Automate monorepo releases with GitHub Actions and Lerna Source: https://github.com/googleapis/release-please/blob/main/docs/manifest-releaser.md A GitHub Actions workflow configuration for automating release PRs and publishing packages in a Lerna-managed monorepo. ```yaml on: push: branches: - main permissions: contents: write pull-requests: write name: Run Release Please jobs: release-please: runs-on: ubuntu-latest steps: - uses: googleapis/release-please-action@v2 id: release with: command: manifest token: ${{secrets.GITHUB_TOKEN}} default-branch: main # The logic below handles the npm publication: - name: Checkout Repository if: ${{ steps.release.outputs.releases_created }} uses: actions/checkout@v2 - name: Setup Node uses: actions/setup-node@v1 if: ${{ steps.release.outputs.releases_created }} with: node-version: 14 registry-url: 'https://registry.npmjs.org' - name: Build Packages if: ${{ steps.release.outputs.releases_created }} run: | npm install npx lerna bootstrap # Release Please has already incremented versions and published tags, so we just # need to publish all unpublished versions to NPM here # See: https://github.com/lerna/lerna/tree/main/commands/publish#bump-from-package - name: Publish to NPM if: ${{ steps.release.outputs.releases_created }} env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} run: npx lerna publish from-package --no-push --no-private --yes ``` -------------------------------- ### Basic Manifest Plugin Implementation Source: https://github.com/googleapis/release-please/blob/main/docs/manifest-releaser.md A simple plugin that logs the number of packages being released. Ensure this plugin is last in the configuration if its accuracy depends on subsequent plugins. ```typescript import {CheckpointType} from '../util/checkpoint'; export default class LogNumberPkgsReleased extends ManifestPlugin { async run( pullRequests: CandidateReleasePullRequest[] ): Promise<[VersionsMap, ManifestPackageWithPRData[]]> { logger.info( `Number of packages to release: ${pullRequests.length}` ); return pullRequests; } } ``` -------------------------------- ### Configure components in manifest Source: https://github.com/googleapis/release-please/blob/main/docs/troubleshooting.md Define component names for independent modules in a monorepo within the manifest configuration. ```json { "packages": { "path/to/pkg-a": { "component": "pkg-a" }, "path/to/pkg-b": { "component": "pkg-b" } } } ``` -------------------------------- ### Create or update a release PR Source: https://github.com/googleapis/release-please/blob/main/docs/cli.md Use this command to initiate or update a release pull request for a repository. ```bash release-please release-pr --token=$GITHUB_TOKEN \ --repo-url=/ [extra options] ``` -------------------------------- ### Test configuration in a specific branch Source: https://github.com/googleapis/release-please/blob/main/docs/troubleshooting.md Target a specific branch for testing configuration changes using the --target-branch option. ```bash export GITHUB_TOKEN="my-access-token" release-please release-pr \ --token=${GITHUB_TOKEN} \ --repo-url=my-owner/my-repo \ --target-branch=my-test-branch \ --debug \ --dry-run ``` -------------------------------- ### Add Google Auth Library dependency to SBT Source: https://github.com/googleapis/release-please/blob/main/test/updaters/fixtures/java-auth-readme.md Add the library dependency to your build.sbt file. ```Scala libraryDependencies += "com.google.auth" % "google-auth-library-oauth2-http" % "0.16.2" ``` -------------------------------- ### Add Google Auth Library dependency to Gradle Source: https://github.com/googleapis/release-please/blob/main/test/updaters/fixtures/java-auth-readme.md Add the compile dependency to your build.gradle file. ```Groovy compile 'com.google.auth:google-auth-library-oauth2-http:0.16.2' ``` -------------------------------- ### Include Terraform Google Module Source: https://github.com/googleapis/release-please/blob/main/test/updaters/fixtures/README.md Use this snippet to include the 'mine' Google module from Terraform. Specify the source and version to ensure compatibility. ```hcl module "vpc" { source = "terraform-google-modules/mine/google" version = "~> 2.0" } ``` -------------------------------- ### Add SBT Dependency for Credentials Source: https://github.com/googleapis/release-please/blob/main/test/updaters/fixtures/java-multiple-versions-readme.md Use this snippet to add the google-auth-library-credentials dependency to your SBT project. Replace the version number with the latest release. ```scala libraryDependencies += "com.google.auth" % "google-auth-library-credentials" % "0.16.2" ``` -------------------------------- ### Add Maven Dependency for Credentials Source: https://github.com/googleapis/release-please/blob/main/test/updaters/fixtures/java-multiple-versions-readme.md Use this snippet to add the google-auth-library-credentials dependency to your Maven project. Replace the version number with the latest release. ```xml com.google.auth google-auth-library-credentials 0.16.2 ``` -------------------------------- ### Add Gradle Dependency for Credentials Source: https://github.com/googleapis/release-please/blob/main/test/updaters/fixtures/java-multiple-versions-readme.md Use this snippet to add the google-auth-library-credentials dependency to your Gradle project. Replace the version number with the latest release. ```groovy compile 'com.google.auth:google-auth-library-credentials:0.16.2' ``` -------------------------------- ### Inline Annotation for Version Updates Source: https://github.com/googleapis/release-please/blob/main/docs/java-releases.md Use inline annotations in comments to mark lines where semver versions need replacement. Specify the artifact name and whether to use the 'current' or 'released' version. ```java String version = "1.0.0"; // x-version-update:my-artifact:current ``` ```java String version = "1.0.0"; // x-version-update:my-artifact:released ``` -------------------------------- ### Lint and Fix Code Source: https://github.com/googleapis/release-please/blob/main/CONTRIBUTING.md Use this command to lint your code and automatically fix any style issues. ```bash npm run fix ``` -------------------------------- ### Specify Version Number in Commit Source: https://github.com/googleapis/release-please/blob/main/README.md Use 'Release-As: x.x.x' in the commit body to set the version number for the next release. This is case-insensitive. ```git git commit --allow-empty -m "chore: release 2.0.0" -m "Release-As: 2.0.0" ``` -------------------------------- ### Add Maven Dependency for OAuth2 HTTP Source: https://github.com/googleapis/release-please/blob/main/test/updaters/fixtures/java-multiple-versions-readme.md Use this snippet to add the google-auth-library-oauth2-http dependency to your Maven project. Replace the version number with the latest release. ```xml com.google.auth google-auth-library-oauth2-http 0.16.2 ``` -------------------------------- ### Force Generic Updater for Specific File Source: https://github.com/googleapis/release-please/blob/main/docs/customizing.md To ensure the Generic updater is used for a specific file, even if its extension might suggest another default updater, specify the type as 'generic'. ```json { "extra-files": [ { "type": "generic", "path": "path/to/file.yml" } ] } ``` -------------------------------- ### Inline Released Version Update Source: https://github.com/googleapis/release-please/blob/main/test/updaters/fixtures/java-replacements-test.txt Use this directive for inline version updates that represent a released version. This should be replaced for non-snapshot releases. ```plaintext 1.2.3 # {x-version-update:module-name:released} ``` -------------------------------- ### Inline Current Version Update Source: https://github.com/googleapis/release-please/blob/main/test/updaters/fixtures/java-replacements-test.txt Use this directive for inline version updates that represent the current version. It should always be replaced with the actual version number. ```plaintext 1.2.3 # {x-version-update:module-name:current} ``` -------------------------------- ### Block Released Version Update Source: https://github.com/googleapis/release-please/blob/main/test/updaters/fixtures/java-replacements-test.txt Use this directive for block version updates representing a released version. The versions listed should be replaced for non-snapshot releases. ```plaintext # {x-version-update-start:module-name:released} 2.3.4 3.4.5 # {x-version-update-end} ``` -------------------------------- ### Update XML Element with XPath Source: https://github.com/googleapis/release-please/blob/main/docs/customizing.md Configure the GenericXml updater to target a specific element within an XML file using XPath for version updates. ```json { "extra-files": [ { "type": "xml", "path": "path/to/file.xml", "xpath": "//xpath/to/field" } ] } ``` -------------------------------- ### Conventional Commit with Multiple Changes Source: https://github.com/googleapis/release-please/blob/main/README.md Use footers at the bottom of a commit message to represent multiple distinct changes, including features, fixes, and breaking changes. This format is useful when a single pull request addresses several issues or introduces multiple enhancements. ```text feat: adds v4 UUID to crypto This adds support for v4 UUIDs to the library. fix(utils): unicode no longer throws exception PiperOrigin-RevId: 345559154 BREAKING-CHANGE: encode method no longer throws. Source-Link: googleapis/googleapis@5e0dcb2 feat(utils): update encode to support unicode PiperOrigin-RevId: 345559182 Source-Link: googleapis/googleapis@e5eef86 ``` -------------------------------- ### Update TOML Property with JSONPath Source: https://github.com/googleapis/release-please/blob/main/docs/customizing.md Configure the GenericToml updater to target a specific property within a TOML file using JSONPath for version updates. ```json { "extra-files": [ { "type": "toml", "path": "path/to/file.toml", "jsonpath": "$.json.path.to.field" } ] } ``` -------------------------------- ### Update YAML Property with JSONPath Source: https://github.com/googleapis/release-please/blob/main/docs/customizing.md Configure the GenericYaml updater to target a specific property within a YAML file using JSONPath for version updates. ```json { "extra-files": [ { "type": "yaml", "path": "path/to/file.yaml", "jsonpath": "$.json.path.to.field" } ] } ``` -------------------------------- ### Update JSON File Version with JSONPath Source: https://github.com/googleapis/release-please/blob/main/docs/customizing.md Configure the GenericJson updater to target a specific field within a JSON file using JSONPath for version updates. ```json { "extra-files": [ { "type": "json", "path": "path/to/file.json", "jsonpath": "$.json.path.to.field" } ] } ``` -------------------------------- ### Override Release Notes Source: https://github.com/googleapis/release-please/blob/main/README.md Use BEGIN_COMMIT_OVERRIDE and END_COMMIT_OVERRIDE markers in a merged pull request's body to specify a custom commit message for release notes generation. This feature requires squash-merging. ```git BEGIN_COMMIT_OVERRIDE feat: add ability to override merged commit message fix: another message chore: a third message END_COMMIT_OVERRIDE ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.