0
votes

I have a build step in TeamCity 9.1 to push a .nupkg file to a hosted feed on myget.org, but it doesn't work with wildcards.

The build step is as follows:

mono /opt/NuGet2/NuGet.exe push %srcDir%/bin/release/Foo.1.0.0.nupkg -Source https://www.myget.org/F/<org_name>/api/v2/package

This works, but I don't want to explicitly set the version number in a build step because this will be incremented over time.

I tried adding a wildcard to the statement like this:

mono /opt/NuGet2/NuGet.exe push %srcDir%/bin/release/Foo.*.nupkg -Source https://www.myget.org/F/<org_name>/api/v2/package

But the wildcard (instead of 1.0.0) seems to break the TeamCity build agent and it gets stuck in a loop until I kill it manually.

How can I create the build step in TeamCity such that I don't need to hard-code a version number in it? Is there a way to omit the version number from the .nupkg file name or allow TeamCity to work with wildcard file names?

1
How do you run this command in TeamCity, what runner is used? If you use command line runner, you should be able to run any script supported by OS. If you know the version number, but it changes from build to build, then you probably can use TeamCity parameters.Alina Mishina

1 Answers

0
votes

You can simply use the "NuGet Publish" runner type and in the "Packages" setting specify a wildcard for where the packages reside (For example: ManualTests/Artifacts/*.nupkg).