I'm trying to pack several packages, however the --no-build argument or option is being ignored and several projects including test projects are being built.
I have tried different combinations on using "NoBuild" but for some reason extra projects are always referenced, how can i pack without build or using additional projects in pack?
Main YAML:
# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- develop
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
storeBuildNumber: $(Build.BuildNumber)
NugetVersion: '1.1.0-unstable'
steps:
- template: AzureDevOps/Templates/provision-template.yml
parameters:
projects: |
**/ProjectA.csproj
**/ProjectB.csproj
Template YAML:
parameters:
projects: ''
steps:
- task: DotNetCoreCLI@2
displayName: "ProvisionRestoreProjects"
inputs:
command: 'restore'
projects: ${{ parameters.projects }}
arguments: >
-s "http://MyFeed/nuget/Feed-feature-yaml/"
-k "ASDF3234234SDSD"
- task: DotNetCoreCLI@2
displayName: "ProvisionBuildProjects"
inputs:
command: 'build'
projects: ${{ parameters.projects }}
arguments: '--configuration release --no-cache'
- task: DotNetCoreCLI@2
displayName: "ProvisionPackProjects"
inputs:
command: 'pack'
nobuild: true
projects: ${{ parameters.projects }}
versioningScheme: 'byEnvVar'
versionEnvVar: 'NugetVersion'
arguments: '--no-build'
- task: DotNetCoreCLI@2
displayName: "ProvisionPushProjects"
inputs:
command: custom
custom: nuget
arguments: >
push "$(Build.ArtifactStagingDirectory)\*.nupkg"
-s "http://MyFeed/nuget/Feed-feature-yaml/"
-k "ASDF3234234SDSD"
I have just encountered this. My workaround was to use a custom command where the pipeline doesn't inject well meaning defaults.
This still leaves you figuring out how to override the package version.
Well i started with Cinderella and ended up with Frankenstein, here are my findings and the solution that worked for me.
Findings
Solution
Main YAML:
Template YAML: