Customizing nuget package name

Hello,

Is there anyway to pass in a dynamic nuget package name? Basically I'd like to add the environment to the package name, ex: Database.Root.DEV.nupkg

I've tried adding:

<OctoPackProjectName>Database.Root.$(Configuration)</OctoPackProjectName>

To the sqlproj file but that didn't work.

I also tried passing in via msbuild:
/p:OctoPackProjectName

It continues to use the name from the nuspec file

Thank you!
Tagged:

Best Answer

  • dnlnlndnlnln Posts: 234 Gold 2
    Accepted Answer
    Sorry for the delay in responding. The OctoPackProjectName seems to be getting ignored by the Octopus NuGet packaging library, but it's unclear why.

    However, there is an alternative property that may work: OctoPackAppendToPackageId, e.g.
    <PropertyGroup>
      <OctoPackAppendToPackageId>$(Configuration)</OctoPackAppendToPackageId>
    </PropertyGroup>
    
    It will use the ID element from the nuspec as the filename prefix. Would you mind trying that and let us know if that creates the package name you need?
    Daniel Nolan
    Product Manager
    Redgate Software
Sign In or Register to comment.