Created
July 21, 2019 17:25
-
-
Save mrutherford2/b38042a9c8b958de9524663b2ffc21e6 to your computer and use it in GitHub Desktop.
DotNetCore Build and Publish Self Contained
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
pool: | |
vmImage: 'windows-latest' | |
variables: | |
solution: '**/*.sln' | |
buildPlatform: 'Any CPU' | |
buildConfiguration: 'Release' | |
# Installs preview version of .NET Core SDK, can remove this task if you are not using preview version of .NET | |
steps: | |
- task: DotNetCoreInstaller@0 | |
displayName: 'Installing .NET Core SDK...' | |
inputs: | |
version: 3.0.100-preview6-012264 | |
- task: DotNetCoreCLI@2 | |
displayName: Restore | |
inputs: | |
command: restore | |
projects: '**/*.csproj' | |
- task: DotNetCoreCLI@2 | |
displayName: Build | |
inputs: | |
projects: '**/*.csproj' | |
arguments: '--configuration $(BuildConfiguration)' | |
- task: DotNetCoreCLI@2 | |
displayName: Publish | |
inputs: | |
command: publish | |
publishWebProjects: True | |
arguments: '--configuration $(BuildConfiguration) -r win-x86 --self-contained true --output $(build.artifactstagingdirectory)' | |
zipAfterPublish: true | |
- task: PublishBuildArtifacts@1 | |
displayName: 'Publish Artifact' | |
inputs: | |
PathtoPublish: '$(build.artifactstagingdirectory)' | |
ArtifactName: 'drop' | |
condition: succeededOrFailed() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment