Getting the version (patch) incremented prior to build/publish
See original GitHub issueFrom @GuardRex on November 26, 2015 20:39
The version that matches what we’ll see in VS published output matches the version in project.json
, so starting with …
"version": "1.0.9"
… will lead to folder named 1.0.9
in <output_folder>/approot/packages/<project_package>
.
If I establish a PS script that would modify the project.json
version and run that script in prepare
or build
…
"scripts": {
"prepare": [ "powershell.exe -ExecutionPolicy ByPass -file %project:Directory%/net5-autoupdate-version.ps1" ]
},
… it does increment the version in project.json
, but it does so after the build/publish. The version showing in project.json
at that point is always one patch number higher than the actual version in the package that I’m publishing. I have the same outcome if I try to hook the script in the vsweb-publish script prior to the Publish-AspNet
command.
Is there a way to (or a tip to) auto-increment the project version (patch) when publishing, preferably with a version (patch) number in project.json
that matches the package version (patch) in the output folder?
Copied from original issue: aspnet/dnx#3209
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (1 by maintainers)
NPM has the version command which lets you bump up each number. Having the same for
dotnet
would be great.@PhilipDaniels that sounds interesting. Can you take a look at http://dotnet.github.io/docs/core-concepts/core-sdk/cli/extensibility.html? It would be great to have these tools available as dotnet extensions!