Skip to content

Commit 76840de

Browse files
author
Justin Skiles
committed
Set up CI with Azure Pipelines
[skip ci]
1 parent d60a23e commit 76840de

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

azure-pipelines.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# .NET Desktop
2+
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
3+
# Add steps that publish symbols, save build artifacts, and more:
4+
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
5+
6+
trigger:
7+
branches:
8+
include:
9+
- master
10+
tags:
11+
include:
12+
- '*'
13+
14+
pool:
15+
vmImage: 'windows-latest'
16+
17+
variables:
18+
- group: NuGet
19+
- name: solution
20+
value: '**/*.sln'
21+
- name: buildPlatform
22+
value: 'Any CPU'
23+
- name: buildConfiguration
24+
value: 'Release'
25+
26+
steps:
27+
- task: NuGetToolInstaller@1
28+
29+
- task: NuGetCommand@2
30+
displayName: NuGet Restore
31+
inputs:
32+
restoreSolution: '$(solution)'
33+
34+
- task: VSBuild@1
35+
displayName: Build (Visual Studio)
36+
inputs:
37+
solution: '$(solution)'
38+
platform: '$(buildPlatform)'
39+
configuration: '$(buildConfiguration)'
40+
41+
# Only pack if this is from a tag
42+
- task: DotNetCoreCLI@2
43+
displayName: NuGet Pack (if tagged)
44+
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
45+
inputs:
46+
command: 'pack'
47+
packagesToPack: 'src/SourceSchemaParser/SourceSchemaParser.csproj'
48+
versioningScheme: 'off'
49+
50+
# Deploy release to NuGet.org
51+
# Custom nuget command has to be used to workaround issue where dotnet core doesn't support encrypted API Key publication
52+
# -n to skip symbols
53+
# --skip-duplicate to prevent publishing the same version more than once
54+
# Only publish if this is from a tag
55+
- task: DotNetCoreCLI@2
56+
displayName: Push NuGet Package (if tagged)
57+
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
58+
inputs:
59+
command: custom
60+
custom: nuget
61+
arguments: >
62+
push $(Build.ArtifactStagingDirectory)/**.nupkg
63+
-s $(NuGetSourceServerUrl)
64+
-k $(NuGetSourceServerApiKey)
65+
-n true
66+
--skip-duplicate
67+
68+
# Deploy release to GitHub
69+
# Only publish if this is from a tag
70+
- task: GitHubRelease@1
71+
displayName: Push GitHub Release (if tagged)
72+
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
73+
inputs:
74+
gitHubConnection: 'GitHub.com OAuth - Babelshift'
75+
repositoryName: 'babelshift/SourceSchemaParser'
76+
action: 'create'
77+
target: '$(Build.SourceVersion)'
78+
tagSource: 'gitTag'
79+
changeLogCompareToRelease: 'lastFullRelease'
80+
changeLogType: 'commitBased'

0 commit comments

Comments
 (0)