Skip to content

Commit

Permalink
ci: add azure pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
foxbot committed Mar 17, 2019
1 parent 049b014 commit 9b2bc18
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
25 changes: 25 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -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')
)
19 changes: 19 additions & 0 deletions azure/build.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions azure/deploy.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9b2bc18

Please sign in to comment.