From 9b2bc18c5cc51bf887f4df6fc775bee967c889d6 Mon Sep 17 00:00:00 2001 From: Christopher Felegy Date: Sat, 16 Mar 2019 16:26:12 -0400 Subject: [PATCH] ci: add azure pipelines --- azure-pipelines.yml | 25 +++++++++++++++++++++++++ azure/build.yml | 19 +++++++++++++++++++ azure/deploy.yml | 12 ++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 azure-pipelines.yml create mode 100644 azure/build.yml create mode 100644 azure/deploy.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..372c9bff1 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,25 @@ +variables: + buildConfiguration: Release + buildTag: $[ startsWith(variables['Build.SourceBranch'], 'refs/tags') ] + buildNumber: $[ variables('Build.BuildNumber') ] + + +jobs: +- job: Linux + pool: + vmImage: 'ubuntu-16.04' + steps: + - template: azure/build.yml + +- job: Windows + pool: + vmImage: 'vs2017-win2016' + steps: + - template: azure/build.yml + - template: azure/deploy.yml + # TODO: condition check for dev branch + condition: | + and ( + succeeded(), + eq(variables['Build.SourceBranch'], 'refs/heads/ci/azure') + ) diff --git a/azure/build.yml b/azure/build.yml new file mode 100644 index 000000000..f488a2550 --- /dev/null +++ b/azure/build.yml @@ -0,0 +1,19 @@ +steps: +- task: DotNetCoreCLI@2 + inputs: + command: restore + projects: 'Discord.Net.sln' + +- task: DotNetCoreCLI@2 + inputs: + command: build + projects: 'Discord.Net.sln' + configuration: $(buildConfiguration) + arguments: '/p:BuildNumber=$(buildNumber) /p:IsTagBuild=$(buildTag)' + +- task: DotNetCoreCLI@2 + inputs: + command: test + projects: './test/**/*.csproj' + configuration: $(buildConfiguration) + nobuild: True diff --git a/azure/deploy.yml b/azure/deploy.yml new file mode 100644 index 000000000..52663df3f --- /dev/null +++ b/azure/deploy.yml @@ -0,0 +1,12 @@ +steps: +- task: DotNetCoreCLI@2 + inputs: + command: 'pack' + projects: 'Discord.Net.sln' + configuration: $(buildConfiguration) + nobuild: True + arguments: '/p:BuildNumber=$(buildNumber) /p:IsTagBuild=$(buildTag)' + + # TODO: build nuspec + +- task: PublishBuildArtifacts@1