forked from Kasper24/Artemis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-pr.yml
113 lines (100 loc) · 3.32 KB
/
azure-pipelines-pr.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
# .NET Desktop
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
trigger: none
pr:
- master
- Development
resources:
repositories:
- repository: RGBNET
type: github
endpoint: github.com_SpoinkyNL
name: DarthAffe/RGB.NET
ref: Development
- repository: Plugins
type: github
endpoint: github.com_SpoinkyNL
name: Artemis-RGB/Artemis.Plugins
ref: master
pool:
vmImage: 'windows-latest'
variables:
artemisSolution: '**/Artemis.sln'
rgbSolution: '**/RGB.NET.sln'
pluginProjects: '**/Artemis.Plugins.*.csproj'
BuildId: $(Build.BuildId)
BuildNumber: $(Build.BuildNumber)
SourceBranch: $(Build.SourceBranch)
SourceVersion: $(Build.SourceVersion)
steps:
- checkout: RGBNET
path: s/RGB.NET
- checkout: self
path: s/Artemis
- checkout: Plugins
path: s/Artemis.Plugins
- task: DotNetCoreCLI@2
displayName: 'RGB.NET - Build'
inputs:
command: 'build'
projects: '$(rgbSolution)'
arguments: '--configuration Release'
- task: DotNetCoreCLI@2
displayName: 'Artemis - Publish'
inputs:
command: 'publish'
publishWebProjects: false
projects: '$(artemisSolution)'
arguments: '--runtime win-x64 --self-contained false --configuration Release --output $(Build.ArtifactStagingDirectory)/build /nowarn:cs1591'
zipAfterPublish: false
modifyOutputPath: false
- task: PowerShell@2
displayName: 'Artemis - Create buildinfo.json'
inputs:
targetType: 'inline'
script: |
$OFS = "`r`n"
SET-Content -Path 'buildinfo.json' -Value ('{' + $OFS + ' "BuildId": 0,' + $OFS + ' "BuildNumber": 0.0,' + $OFS + ' "SourceBranch": "",' + $OFS + ' "SourceVersion": ""' + $OFS + '}')
workingDirectory: '$(Build.ArtifactStagingDirectory)/build'
- task: FileTransform@1
displayName: 'Artemis - Populate buildinfo.json'
inputs:
folderPath: '$(Build.ArtifactStagingDirectory)/build'
fileType: 'json'
targetFiles: '**/buildinfo.json'
# Copy Artemis binaries to where plugin projects expect them
- task: CopyFiles@2
displayName: 'Plugins - Prepare Artemis binaries'
inputs:
SourceFolder: '$(Build.ArtifactStagingDirectory)/build'
Contents: '**'
TargetFolder: 'Artemis/src/Artemis.UI/bin/net5.0-windows'
- task: PowerShell@2
displayName: 'Plugins - Insert build number into plugin.json'
inputs:
targetType: 'inline'
script: |
Get-ChildItem -Recurse -Filter plugin.json |
Foreach-Object {
$buidNumber = "1.0.1." + $Env:BUILD_BUILDID;
$a = Get-Content $_.FullName | ConvertFrom-Json
$a.Version = $buidNumber;
$a | ConvertTo-Json | Set-Content $_.FullName
}
workingDirectory: 'Artemis.Plugins'
- task: DotNetCoreCLI@2
displayName: 'Plugins - Publish'
inputs:
command: 'publish'
publishWebProjects: false
arguments: '--runtime win-x64 --configuration Release --self-contained false --output $(Build.ArtifactStagingDirectory)/build/Plugins'
projects: '$(pluginProjects)'
zipAfterPublish: true
- task: PublishPipelineArtifact@1
displayName: 'Upload build to Azure Pipelines'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/build'
artifact: 'Artemis build'
publishLocation: 'pipeline'