Skip to content

Instantly share code, notes, and snippets.

@mrutherford2
Created July 21, 2019 17:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mrutherford2/b38042a9c8b958de9524663b2ffc21e6 to your computer and use it in GitHub Desktop.
Save mrutherford2/b38042a9c8b958de9524663b2ffc21e6 to your computer and use it in GitHub Desktop.
DotNetCore Build and Publish Self Contained
# 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