From 7d6902695b4a21cec46fbf0a58261607422e8d96 Mon Sep 17 00:00:00 2001 From: Matthias Gernand Date: Thu, 5 May 2022 16:57:32 +0200 Subject: [PATCH] Updated packages and added package publish to pipeline. (#16) --- azure-pipelines.yml | 32 ++++++++++++++++++++++-- src/Fluxera.Entity/Fluxera.Entity.csproj | 2 +- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d322157..5e99bad 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -54,5 +54,33 @@ stages: displayName: 'Publish Package Artifacts' inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)' - ArtifactName: 'drop' - publishLocation: 'Container' \ No newline at end of file + ArtifactName: 'packages' + publishLocation: 'Container' + +- stage: PublishPackages + dependsOn: BuildAndTest + # Only publish packages for main branch. + condition: and(succeeded('BuildAndTest'), eq(variables['Build.SourceBranch'], 'refs/heads/main')) + jobs: + - job: PublishPackages + pool: + name: Default + steps: + # Download the created packages. + - task: DownloadBuildArtifacts@0 + displayName: 'Download NuGet Packges' + inputs: + buildType: 'current' + downloadType: 'single' + artifactName: 'packages' + downloadPath: '$(System.ArtifactsDirectory)' + # Publish the NuGet packages to the package feed. + - task: DotNetCoreCLI@2 + displayName: Push Nuget Package + inputs: + command: custom + custom: nuget + arguments: > + push $(System.ArtifactsDirectory)/**/*.nupkg + -s https://api.nuget.org/v3/index.json + -k $(NuGetApiKey) diff --git a/src/Fluxera.Entity/Fluxera.Entity.csproj b/src/Fluxera.Entity/Fluxera.Entity.csproj index 4068e08..fdeb9da 100644 --- a/src/Fluxera.Entity/Fluxera.Entity.csproj +++ b/src/Fluxera.Entity/Fluxera.Entity.csproj @@ -22,7 +22,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive