@@ -139,6 +139,118 @@ Commands:
139139 init initiates a release by creating a release pull request.
140140 tag-and-release tags and creates a GitHub release for a merged pull request.
141141
142+ # release init
143+
144+ The 'release init' command is the primary entry point for initiating
145+ a new release. It automates the creation of a release pull request by parsing
146+ conventional commits, determining the next semantic version for each library,
147+ and generating a changelog. Librarian is environment aware and will check if the
148+ current directory is the root of a librarian repository. If you are not
149+ executing in such a directory the '--repo' flag must be provided.
150+
151+ This command scans the git history since the last release, identifies changes
152+ (feat, fix, BREAKING CHANGE), and calculates the appropriate version bump
153+ according to semver rules. It then delegates all language-specific file
154+ modifications, such as updating a CHANGELOG.md or bumping the version in a pom.xml,
155+ to the configured language-specific container.
156+
157+ By default, 'release init' leaves the changes in your local working directory
158+ for inspection. Use the '--push' flag to automatically commit the changes to
159+ a new branch and create a pull request on GitHub. The '--commit' flag may be
160+ used to create a local commit without creating a pull request; this flag is
161+ ignored if '--push' is also specified.
162+
163+ Examples:
164+
165+ # Create a release PR for all libraries with pending changes.
166+ librarian release init --push
167+
168+ # Create a release PR for a single library.
169+ librarian release init --library=secretmanager --push
170+
171+ # Manually specify a version for a single library, overriding the calculation.
172+ librarian release init --library=secretmanager --library-version=2.0.0 --push
173+
174+ Usage:
175+
176+ librarian release init [flags]
177+
178+ Flags:
179+
180+ -branch string
181+ The branch to use with remote code repositories. This is used to specify
182+ which branch to clone and which branch to use as the base for a pull
183+ request. (default "main")
184+ -commit
185+ If true, librarian will create a commit for the release but not create
186+ a pull request. This flag is ignored if push is set to true.
187+ -image string
188+ Language specific image used to invoke code generation and releasing.
189+ If not specified, the image configured in the state.yaml is used.
190+ -library string
191+ The library ID to generate or release (e.g. google-cloud-secretmanager-v1).
192+ This corresponds to a releasable language unit.
193+ -library-version string
194+ Overrides the automatic semantic version calculation and forces a specific
195+ version for a library. Requires the --library flag to be specified.
196+ -output string
197+ Working directory root. When this is not specified, a working directory
198+ will be created in /tmp.
199+ -push
200+ If true, Librarian will create a commit and a pull request for the changes.
201+ A GitHub token with push access must be provided via the
202+ LIBRARIAN_GITHUB_TOKEN environment variable.
203+ -repo string
204+ Code repository where the generated code will reside. Can be a remote
205+ in the format of a remote URL such as https://github.com/{owner}/{repo} or a
206+ local file path like /path/to/repo. Both absolute and relative paths are
207+ supported. If not specified, will try to detect if the current working directory
208+ is configured as a language repository.
209+
210+ # release tag-and-release
211+
212+ The 'tag-and-release' command is the final step in the release
213+ process. It is designed to be run after a release pull request, created by
214+ 'release init', has been merged.
215+
216+ This command's primary responsibilities are to:
217+
218+ - Create a Git tag for each library version included in the merged pull request.
219+ - Create a corresponding GitHub Release for each tag, using the release notes
220+ from the pull request body.
221+ - Update the pull request's label from 'release:pending' to 'release:done' to
222+ mark the process as complete.
223+
224+ You can target a specific merged pull request using the '--pr' flag. If no pull
225+ request is specified, the command will automatically search for and process all
226+ merged pull requests with the 'release:pending' label from the last 30 days.
227+
228+ Examples:
229+
230+ # Tag and create a GitHub release for a specific merged PR.
231+ librarian release tag-and-release --repo=https://github.com/googleapis/google-cloud-go --pr=https://github.com/googleapis/google-cloud-go/pull/123
232+
233+ # Find and process all pending merged release PRs in a repository.
234+ librarian release tag-and-release --repo=https://github.com/googleapis/google-cloud-go
235+
236+ Usage:
237+
238+ librarian release tag-and-release [arguments]
239+
240+ Flags:
241+
242+ -pr string
243+ The URL of a pull request to operate on.
244+ It should be in the format of https://github.com/{owner}/{repo}/pull/{number}.
245+ If not specified, will search for all merged pull requests with the label
246+ "release:pending" in the last 30 days.
247+ -repo string
248+ Code repository where the generated code will reside. Can be a remote
249+ in the format of a remote URL such as https://github.com/{owner}/{repo} or a
250+ local file path like /path/to/repo. Both absolute and relative paths are
251+ supported. If not specified, will try to detect if the current working directory
252+ is configured as a language repository.
253+
142254# version
143255
144256Version prints version information for the librarian binary.
0 commit comments