updateVersion
Updates the version of the project based on the specified update type.
This function performs a series of tasks to handle version updates: 1. Validates the version update type. 2. Checks if Git and GitHub CLI are installed. 3. Verifies that the Git repository is clean. 4. Runs spellcheck and linting. 5. Builds the project. 6. Updates version in files and changelog. 7. Adds updated files to Git, tags the commit, and pushes to the repository. 8. If an Obsidian plugin, copies the updated manifest and publishes a GitHub release.
Import:
import { updateVersion } from 'obsidian-dev-utils/script-utils/version';Signature:
function updateVersion(versionUpdateType: string | undefined, options: UpdateVersionOptions): Promise<void>Parameters:
| Parameter | Type | Description |
|---|---|---|
versionUpdateType | string | undefined | The type of version update to perform (major, minor, patch, premajor, preminor, prepatch, prerelease, or x.y.z[-suffix]). |
options | UpdateVersionOptions | The UpdateVersionOptions controlling the release behavior. |
Returns: Promise<void> — A Promise that resolves when the version update is complete.
Links to this page: