NuGet Package Version and NuGet ID

I have one Project.sln in my GitRepo. And I need to build 4 NuGet packages with different configurations (local, qa, sandboxes and production). I am using TeamCity with Octopus Deploy.

In TeamCity, my build configuration has the following build steps:

1) NuGet Installer
2) Build Project.sln with *Local* Configuration
3) NuGet Pack with using .csproj file

4) NuGet Installer
5) Build Project.sln with *QA* Configuration
6) NuGet Pack with using .csproj file

7) NuGet Installer
8) Build Project.sln with *Sandbox* Configuration
9) NuGet Pack with using .csproj file

10) NuGet Installer
11) Build Project.sln with *Production* Configuration
12) NuGet Pack with using .csproj file

And I have the following problems:

1) When I use the AssemblyInfo patcher, it only makes one NuGet batch file. In step 3, TeamCity creates a package named 2.2.1.% Build.counter%. And in step 6, he creates a package with the same name and overwrites it. It does the same in steps 9 and 12. Finally, I only have one NuGet package with the latest configuration (in my case, Production).

I want to have 4 such packages:

2.2.1.%build.counter%_local
2.2.1.%build.counter%_qa
2.2.1.%build.counter%_sandbox
2.2.1.%build.counter%_production

2) Octopus. TeamCity ( 4 , AssemblyInfo), (Project), "some" ( QA) QA, Octopus NuGet. - "". , , TeamCity.

+4
2

TeamCity NuGet, . NuGet.

0

, nuget ( nuget) .nuspec.

(1 4 )

<?xml version="1.0"?>
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
    <id>yourProcjectName.qa</id>
    <version>1.0.0</version>
    <authors>Jay Hamlin</authors>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>Simple Description</description>
  </metadata>
  <files>
    <file src="bin\Release\*.dll" target="lib" />
  </files>
</package>
  1. , 'id' nuget.
  2. "" TeamCity. :

enter image description here

  1. Nuget : {package_id}. {Version}.nupkg ( {version}. {Package_id}.nupkg - )

  2. nuget. , , , 4 .nuspec, 4 , .

Ps. nuspec, nuget ()

0

Source: https://habr.com/ru/post/1618938/


All Articles