-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathazure-pipelines.yml
135 lines (131 loc) · 4.63 KB
/
azure-pipelines.yml
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
135
trigger:
branches:
include:
- master
- dev
pr:
branches:
include:
- master
- dev
variables:
solution: 'NogasmChart.sln'
buildPlatform: 'Any CPU'
jobs:
- job: Windows
pool:
vmImage: 'windows-latest'
strategy:
matrix:
# Debug:
# buildConfiguration: Debug
Release:
buildConfiguration: Release
steps:
- template: build/build-start.yml
parameters:
platform: "win-x64"
# Set up key after build start, otherwise we won't have nuget to update yet.
- task: MagicChunks@2
inputs:
sourcePath: '$(Build.SourcesDirectory)\NogasmChart\secrets.json'
fileType: 'Json'
targetPathType: 'source'
transformationType: 'json'
transformations: |
{
"sentryUrl": "$(SENTRY_URL)"
}
- task: Assembly-Info-NetFramework@2
inputs:
Path: '$(Build.SourcesDirectory)'
FileNames: |
**\AssemblyInfo.cs
**\AssemblyInfo.vb
InsertAttributes: false
FileEncoding: 'auto'
WriteBOM: false
LogLevel: 'verbose'
FailOnWarning: false
DisableTelemetry: true
VersionNumber: "0.0.$(Build.BuildId)"
InformationalVersion: "0.0.$(Build.BuildId)-$(gitVersion)-$(buildConfiguration)"
- task: CmdLine@2
inputs:
script: 'type $(Build.SourcesDirectory)\NogasmChart\Properties\AssemblyInfo.cs'
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '7.x'
- task: DotNetCoreCLI@2
inputs:
command: 'build'
arguments: '-c $(buildConfiguration)'
displayName: 'dotnet build $(buildConfiguration)'
- task: DotNetCoreCLI@2
inputs:
command: 'publish'
publishWebProjects: false
arguments: '-r win-x64 -c $(buildConfiguration) -o $(Build.SourcesDirectory)\NogasmChart\bin\x64\$(buildConfiguration)\net7.0-windows\win-x64'
displayName: 'dotnet publish $(buildConfiguration)'
- task: PowerShell@2
inputs:
targetType: inline
script: Get-ChildItem -Path '$(Build.SourcesDirectory)\NogasmChart\bin\x64\$(buildConfiguration)' -recurse
- task: ExtractFiles@1
inputs:
archiveFilePatterns: '$(Build.SourcesDirectory)\NogasmChart\bin\x64\$(buildConfiguration)\net7.0-windows\win-x64\win-x64.zip'
destinationFolder: '$(Build.SourcesDirectory)\NogasmChart\bin\x64\$(buildConfiguration)\net7.0-windows\win-x64\publish'
cleanDestinationFolder: true
overwriteExistingFiles: false
- task: PowerShell@2
displayName: "Get VC Redist"
inputs:
targetType: inline
script: |
$WebClient = New-Object System.Net.WebClient
$WebClient.DownloadFile( "https://aka.ms/vs/17/release/vc_redist.x64.exe", "vc_redist.x64.exe" )
- task: PowerShell@2
displayName: "Build Installer"
inputs:
targetType: inline
script: |
$Env:CONFIGURATION = "$(buildConfiguration)"
$Env:BUILD_VERSION = "$(gitVersion)"
ISCC nogasm-chart-installer.iss
move installer\nogasm-chart-installer.exe installer\$(cliBuildName)-installer.exe
- task: CopyFiles@2
displayName: "Copy installer to staging"
inputs:
contents: "$(System.DefaultWorkingDirectory)/installer/*.exe"
targetFolder: '$(Build.ArtifactStagingDirectory)'
flattenFolders: true
- task: PublishPipelineArtifact@0
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifactName: 'win-x64-$(buildConfiguration)'
- job: Deploy
dependsOn:
- Windows
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
pool:
vmImage: 'windows-latest'
steps:
- template: build/setup-variables.yml
- task: DownloadPipelineArtifact@1
displayName: Download Artifacts from other jobs
inputs:
buildType: 'current'
- task: GitHubRelease@0
displayName: Upload NogasmChart Release to Github
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
gitHubConnection: "release"
repositoryName: "blackspherefollower/NogasmChart"
action: "create"
tagSource: "auto"
title: "NogasmChart $(gitVersion)"
assets: |
$(System.ArtifactsDirectory)\**\*.zip
$(System.ArtifactsDirectory)\**\*installer.exe
isPreRelease: false