-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathazure-pipelines-dev.yml
More file actions
134 lines (115 loc) · 4.52 KB
/
Copy pathazure-pipelines-dev.yml
File metadata and controls
134 lines (115 loc) · 4.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# https://aka.ms/yaml
trigger:
branches:
include:
- dev/*
paths:
include:
- src/*
variables:
- group: GitRelease
- name: patch
value: $[counter('versioncounter', 1)]
- name: buildPlatform
value: 'Any CPU'
- name: buildConfiguration
value: 'Release'
- name: GitHubApplicationName
value: 'Amusoft.VisualStudio.TemplateGenerator'
- name: GitHubRepoName
value: 'Amusoft.VisualStudio.TemplateGenerator'
- name: GitHubAssetsPattern
value: '$(Build.ArtifactStagingDirectory)\*.zip'
- name: GitHubAccessToken
value: '$(gitAccessToken)'
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
value: 1
pool:
vmImage: 'windows-2019'
jobs:
- job:
displayName: Build
condition: succeeded()
steps:
- task: PowerShell@2
displayName: GetVersion .Desktop
inputs:
filePath: 'build\csproj-version-to-pipeline.ps1'
arguments: '$(patch) $(Build.SourcesDirectory)\src\Generator.Client.Desktop\Generator.Client.Desktop.csproj PackageVersion'
- task: PowerShell@2
displayName: GetVersion .CLI
inputs:
filePath: 'build\csproj-version-to-pipeline.ps1'
arguments: '$(patch) $(Build.SourcesDirectory)\src\Generator.Client.CommandLine\Generator.Client.CommandLine.csproj PackageVersionCLI'
- task: NuGetToolInstaller@1
inputs:
versionSpec: '4.x'
- task: NuGetCommand@2
inputs:
command: 'restore'
restoreSolution: '**/*.sln'
feedsToUse: 'select'
- task: VSBuild@1
inputs:
solution: '**\*.sln'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
condition: succeeded()
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\*test*.dll
!**\*TestAdapter.dll
!**\obj\**
searchFolder: '$(System.DefaultWorkingDirectory)'
- task: PowerShell@2
condition: succeeded()
displayName: dotnet publish
inputs:
targetType: 'inline'
script: |
mkdir $(Build.ArtifactStagingDirectory)\desktop
& dotnet build $(Build.SourcesDirectory)\src\Generator.Client.Desktop\Generator.Client.Desktop.csproj -r win-x64 -c $(buildConfiguration)
& dotnet publish $(Build.SourcesDirectory)\src\Generator.Client.Desktop\Generator.Client.Desktop.csproj -r win-x64 -c $(buildConfiguration) --self-contained --no-build -o $(Build.ArtifactStagingDirectory)\desktop
mkdir $(Build.ArtifactStagingDirectory)\cli-netcore2.1-standalone
mkdir $(Build.ArtifactStagingDirectory)\cli-netcore2.1-shared
& dotnet publish $(Build.SourcesDirectory)\src\Generator.Client.CommandLine\Generator.Client.CommandLine.csproj -r win-x64 -f netcoreapp2.1 -c $(buildConfiguration) --self-contained true -o $(Build.ArtifactStagingDirectory)\cli-netcore2.1-standalone
& dotnet publish $(Build.SourcesDirectory)\src\Generator.Client.CommandLine\Generator.Client.CommandLine.csproj -r win-x64 -f netcoreapp2.1 -c $(buildConfiguration) --self-contained false -o $(Build.ArtifactStagingDirectory)\cli-netcore2.1-shared
- task: PowerShell@2
condition: succeeded()
displayName: dotnet pack dev
inputs:
targetType: 'inline'
script: |
dotnet --version
mkdir $(Build.ArtifactStagingDirectory)\nupkg
Write-Host $(PackageVersion)
Write-Host $(PackageVersionCLI)
$commandSample = "dotnet pack $(Build.SourcesDirectory)\src\Generator.Client.CommandLine\Generator.Client.CommandLine.csproj -c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory)\nupkg /p:PackAsTool=true /p:VersionPrefix=$(PackageVersionCLI) /p:VersionSuffix=dev /p:SymbolPackageFormat=snupkg --include-symbols"
Write-Host $commandSample
Invoke-Expression $commandSample
- task: CopyFiles@2
condition: succeeded()
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: |
**/*.md
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PowerShell@2
condition: succeeded()
displayName: zip artifacts
inputs:
targetType: 'inline'
script: |
7z a $(Build.ArtifactStagingDirectory)\TemplateGenerator_$(PackageVersion)_win64.zip $(Build.ArtifactStagingDirectory)\*
- task: PublishPipelineArtifact@0
condition: succeeded()
inputs:
artifactName: 'drop'
targetPath: '$(Build.ArtifactStagingDirectory)\TemplateGenerator_$(PackageVersion)_win64.zip'
- task: PublishPipelineArtifact@0
condition: succeeded()
inputs:
artifactName: 'nupkg'
targetPath: '$(Build.ArtifactStagingDirectory)\nupkg'