{"id":17398488,"url":"https://github.com/vweevers/dotnet-bump","last_synced_at":"2025-04-30T05:21:23.190Z","repository":{"id":50513873,"uuid":"302867605","full_name":"vweevers/dotnet-bump","owner":"vweevers","description":"CLI to increment and git-tag the version of .NET, C(++) and npm projects.","archived":false,"fork":false,"pushed_at":"2022-07-29T17:50:38.000Z","size":66,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-25T01:58:20.253Z","etag":null,"topics":["cli","csproj","dotnet","nodejs","npm-package","release","vcxproj","version"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vweevers.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-10T09:41:13.000Z","updated_at":"2023-01-28T22:37:29.000Z","dependencies_parsed_at":"2022-09-26T16:41:19.008Z","dependency_job_id":null,"html_url":"https://github.com/vweevers/dotnet-bump","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fdotnet-bump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fdotnet-bump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fdotnet-bump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fdotnet-bump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vweevers","download_url":"https://codeload.github.com/vweevers/dotnet-bump/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251645981,"owners_count":21620846,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","csproj","dotnet","nodejs","npm-package","release","vcxproj","version"],"created_at":"2024-10-16T14:57:24.358Z","updated_at":"2025-04-30T05:21:23.172Z","avatar_url":"https://github.com/vweevers.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dotnet-bump\n\n**CLI to increment and git-tag the version of .NET, C(++) and npm projects.** Geared towards Visual Studio projects.\n\n[![npm status](http://img.shields.io/npm/v/dotnet-bump.svg)](https://www.npmjs.org/package/dotnet-bump)\n[![node](https://img.shields.io/node/v/dotnet-bump.svg)](https://www.npmjs.org/package/dotnet-bump)\n![Test](https://github.com/vweevers/dotnet-bump/workflows/Test/badge.svg)\n![Release](https://github.com/vweevers/dotnet-bump/workflows/Release/badge.svg)\n[![Common Changelog](https://common-changelog.org/badge.svg)](https://common-changelog.org)\n\n## Example\n\n```\n\u003e dotnet-bump minor --dry-run\n- Would stage Foo\\Foo.csproj\n- Would stage Bar\\version.h\n- Would commit and tag v1.1.0\n```\n\n```\n\u003e dotnet-bump minor\n- Stage Foo\\Foo.csproj\n- Stage Bar\\version.h\n- Commit and tag v1.1.0\n```\n\n## Usage\n\n```\ndotnet-bump \u003ctarget\u003e [options] [file..]\n```\n\nBump to `target` version, one of:\n\n- A release type: `major`, `minor`, `patch`, `premajor`, `preminor`, `prepatch`, `prerelease`\n  - The `major` type bumps the major version (for example `2.4.1 =\u003e 3.0.0`); `minor` and `patch` work the same way.\n  - The `premajor` type bumps the version up to the next major version and down to a prerelease of that major version; `preminor` and `prepatch` work the same way.\n  - The `prerelease` type works the same as `prepatch` if the input version is a non-prerelease. If the input is already a prerelease then it's simply incremented (for example `4.0.0-rc.2 =\u003e 4.0.0-rc.3`).\n- A specific version like 2.4.0 (must be [semver](https://semver.org/)).\n\nFiles can be glob patterns or paths to a:\n\n- `*.sln` Visual Studio solution (parsed to find projects)\n- `*.csproj` or `*.fsproj` project (parsed to find a `Version` element or `AssemblyInfo` file)\n- `*.cs` or `*.fs` file (containing assembly attributes, see below)\n- `*.nuspec` file (containing a `version` element)\n- `*.vcxproj` project (used to discover `version.h` files in the same directory)\n- `version.h` file (see below)\n- `*.json` or `*.json5` file (containing a `version`);\n- Directory containing any of the above.\n\nDefault is the current working directory. Files must reside in a git working tree (or multiple working trees).\n\nGlob patterns must use forward slashes (`/`) even on Windows, because the backward slash (`\\`) is an escape character. This means `dotnet-bump patch example\\*.h` should be `dotnet-bump patch example/*.h`. Backward slashes do work if the given argument is not a glob pattern, because `dotnet-bump` will interpret it as a file path: `dotnet-bump patch example\\version.h`.\n\n### Options\n\n```\n--dry-run  -d  Print changes but don't make them\n--force    -f  Continue if git working tree(s) are dirty\n--no-commit    Don't commit and tag\n--no-glob      Disable globbing\n--verbose      Verbose output\n--version  -v  Print version and exit\n--help     -h  Print usage and exit\n```\n\n## Supported patterns\n\n### .NET projects\n\nBoth legacy-style projects (that use assembly attributes) and SDK-style projects (that commonly use a `Version` element) are supported. For example, `dotnet-bump` would replace the `1.2.3` string here:\n\n```xml\n\u003cProject Sdk=\"Microsoft.NET.Sdk\"\u003e\n  \u003cPropertyGroup\u003e\n    \u003cVersion\u003e1.2.3\u003c/Version\u003e\n  \u003c/PropertyGroup\u003e\n\u003c/Project\u003e\n```\n\nIf the project is published as a NuGet package, the project version can usually serve as the source of truth. Other times a custom `*.nuspec` file may be necessary. For example:\n\n```xml\n\u003cpackage xmlns=\"..\"\u003e\n  \u003cmetadata\u003e\n    \u003cid\u003eExample\u003c/id\u003e\n    \u003cversion\u003e1.2.3\u003c/version\u003e\n  \u003c/metadata\u003e\n  \u003cfiles\u003e\n    \u003cfile src=\"Example.dll\" target=\"build\\native\\x64\\bin\" /\u003e\n    \u003cfile src=\"Example.targets\" target=\"build\\Example.targets\" /\u003e\n  \u003c/files\u003e\n\u003c/package\u003e\n```\n\n### Assembly attributes (C# / F#)\n\nIf an `AssemblyInfo.cs` file is found then `dotnet-bump` will replace the following attribute and leave other attributes as-is. If a version has four numeric components (`1.2.3.0`) then the last component (`.0`) will be stripped.\n\n```cs\n[assembly: AssemblyVersion(\"1.2.3\")]\n```\n\nIf `AssemblyFileVersion` and / or `AssemblyInformationalVersion` attributes are present they will be updated as well, but only if `AssemblyVersion` is present because it is used to determine the current version.\n\n```cs\n[assembly: AssemblyFileVersion(\"1.2.3\")]\n[assembly: AssemblyInformationalVersion(\"1.2.3\")]\n```\n\n### `version.h` (C / C++)\n\nOne of the following combination of constants can be used, and must be written exactly as below with optional added whitespace (though `dotnet-bump` will strip such whitespace). Other lines in the `version.h` file will be left alone.\n\n```c\n#define VERSION_MAJOR 1\n#define VERSION_MINOR 2\n#define VERSION_PATCH 3\n```\n\n```c\n#define VERSION_MAJOR 1\n#define VERSION_MINOR 2\n#define VERSION_PATCH 3\n#define VERSION_BUILD 0\n```\n\n```c\n#define VERSION_MAJOR 1\n#define VERSION_MINOR 2\n#define VERSION_BUILD 3\n#define VERSION_REVISION 0\n```\n\nIf the combination has four constants, the last constant will be ignored (on read) and set to `0` (on write).\n\n## Install\n\nDownload [a portable binary](https://github.com/vweevers/dotnet-bump/releases) or install with [npm](https://npmjs.org):\n\n```\nnpm install dotnet-bump --save-dev\n```\n\n## License\n\n[MIT](LICENSE) © Vincent Weevers\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvweevers%2Fdotnet-bump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvweevers%2Fdotnet-bump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvweevers%2Fdotnet-bump/lists"}