I'm trying to create a CI/CD but I'm only getting one artifact. The artifact that I'm getting is the client app (a Blazor application). My solution structure is as follows:
-src
--API
--Core
--Domain
--UI
These are virtual maps in VS. In the build stage, all projects get built.
This is the YAML:
trigger:
- develop
pool:
vmImage: 'windows-latest'
variables:
solution: '*/.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
package-version: '1.2.6'
dotNetFramework: 'net6.0'
dotNetVersion: '6.0.x'
targetRuntime: 'linux-x64'
azureSubscription: 'TestResources'
stages:
stage: Build
jobs:
job: build
steps:
task: UseDotNet@2
displayName: 'Use .NET 6 sdk'
inputs:
packageType: 'sdk'
version: $(dotNetVersion)
includePreviewVersions: true
task: DotNetCoreCLI@2
displayName: Build solution
inputs:
command: 'build'
projects: '*/.sln'
arguments: '--configuration $(buildConfiguration)'
task: DotNetCoreCLI@2
displayName: Run unit tests
inputs:
command: 'test'
projects: '*/Tests/*.csproj'
arguments: '--configuration $(buildConfiguration)'
stage: Development
displayName: 'Deploy to Dev'
dependsOn: [ Build ]
condition: succeeded()
variables:
- group: Apep
jobs:
job: DeployToDevelopment
displayName: 'Deploy Development'
variables:
sqlFile: '$(Build.SourcesDirectory)/SQL/sqlscript.sql'
steps:
Publish it as .NET 6 self-contained application for linux runtime
- task: DotNetCoreCLI@2
inputs:
command: publish
#publishWebProjects: false
#arguments: '--configuration $(BuildConfiguration) --framework $(dotNetFramework) --runtime $(targetRuntime) --self-contained --output $(Build.ArtifactStagingDirectory)'
zipAfterPublish: True
projects: '*/.sln'
Package the file and uploads them as an artifact of the build
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: 'drop'
publishLocation: 'pipeline'
I've tried targeting the projects parameter to target just one project but it keeps building my client application ( a Blazor application ).