MyGet and Cake, generate version number

177 views Asked by At

I'm using a custom cake build script w/ MyGet. I had previously used a line like so on AppVeyor

var version = AppVeyor.IsRunningOnAppVeyor ? AppVeyor.Environment.Build.Version : "0.0.1";

to get a version number from the build CI platform. However on MyGet I have a MyGet.IsRunningOnMyGet but I don't seem to have a build version number or environment object in MyGet . Any suggestions on how I should be getting the build number so I can pass it to the 'pack' command further down in the cake script?

1

There are 1 answers

0
devlead On

Doesn't look like the IMyGetProvider supports that yet, that said it's available as an environment variable MyGet version environment

So you should be able to do

var version = EnvironmentVariable("PackageVersion"); 

See MyGet documentation for Available environment Variables.