forked from ethanmoffat/EndlessClient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
137 lines (128 loc) · 4.08 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
136
137
name: 1.0.$(rev:rrr)
trigger:
- master
- release/*
schedules:
- cron: 0 5 * * 6
branches:
include:
- master
- release/*
always: true
strategy:
matrix:
linux:
imageName: "ubuntu-latest"
solutionName: "EndlessClient.Linux.sln"
friendlyPlatform: "Linux"
dropDir: net6.0
windows:
imageName: "windows-latest"
solutionName: "EndlessClient.sln"
friendlyPlatform: "Windows"
dropDir: net6.0-windows
pool:
vmImage: $(imageName)
variables:
buildConfiguration: Release
steps:
- checkout: self
persistCredentials: true
- task: UseDotNet@2
displayName: 'Install .Net core 3.1.x runtime'
inputs:
packageType: runtime
version: 3.1.x
- task: UseDotNet@2
displayName: 'Install .Net 6 runtime/sdk'
inputs:
version: 6.0.x
- task: Assembly-Info-NetCore@3
displayName: 'Set assembly version and copyright info'
inputs:
Path: '$(Build.SourcesDirectory)'
FileNames: '**/*.csproj'
InsertAttributes: true
FileEncoding: 'auto'
WriteBOM: false
GenerateDocumentationFile: 'false'
Authors: 'Ethan Moffat'
Copyright: 'Copyright © 2014-2022 Ethan Moffat'
VersionNumber: '$(Build.BuildNumber)'
FileVersionNumber: '$(Build.BuildNumber)'
InformationalVersion: '$(Build.BuildNumber)'
LogLevel: 'verbose'
FailOnWarning: false
DisableTelemetry: false
- task: Assembly-Info-NetCore@3
displayName: 'Set nuget package properties'
inputs:
Path: '$(Build.SourcesDirectory)'
FileNames: |
**/EOLib*.csproj
!**/EOLib.*Test.csproj
InsertAttributes: true
FileEncoding: 'auto'
WriteBOM: false
GeneratePackageOnBuild: 'true'
PackageRequireLicenseAcceptance: 'false'
PackageLicenseExpression: 'MIT'
PackageProjectUrl: 'https://github.com/ethanmoffat/EndlessClient'
RepositoryUrl: 'https://github.com/ethanmoffat/EndlessClient'
RepositoryType: 'git'
PackageTags: 'endless-online eo'
PackageVersion: '$(Build.BuildNumber)'
LogLevel: 'verbose'
FailOnWarning: false
DisableTelemetry: false
- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
inputs:
command: 'restore'
verbosityRestore: 'minimal'
projects: '$(Build.SourcesDirectory)/$(solutionName)'
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
command: 'build'
projects: '$(Build.SourcesDirectory)/$(solutionName)'
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'dotnet test - skipping EOLib.Graphics.Test (not supported on VSTS agent)'
inputs:
command: 'test'
projects: '$(Build.SourcesDirectory)/$(solutionName)'
arguments: '--filter "TestCategory!=GraphicsDevice" --configuration $(buildConfiguration)'
testRunTitle: $(friendlyPlatform)
- task: ArchiveFiles@2
displayName: 'ZIP EndlessClient'
inputs:
rootFolderOrFile: $(Build.SourcesDirectory)/bin/$(buildConfiguration)/client/$(dropDir)/
archiveFile: $(Build.ArtifactStagingDirectory)/zip/EndlessClient.$(friendlyPlatform).zip
- task: ArchiveFiles@2
displayName: 'ZIP EOBot'
inputs:
rootFolderOrFile: $(Build.SourcesDirectory)/bin/$(buildConfiguration)/utils/EOBot/net6.0/
archiveFile: $(Build.ArtifactStagingDirectory)/zip/EOBot.$(friendlyPlatform).zip
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifacts'
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/zip
ArtifactName: EndlessClient
- task: CopyFiles@2
displayName: 'Copy nuget packages'
inputs:
SourceFolder: '$(Build.SourcesDirectory)/bin/$(buildConfiguration)/'
Contents: '**/*.nupkg'
TargetFolder: '$(Build.ArtifactStagingDirectory)/nuget'
- task: PublishBuildArtifacts@1
displayName: 'Publish nuget Artifacts'
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/nuget
ArtifactName: nuget.$(friendlyPlatform)
- script: |
git tag build/$(Build.BuildNumber)
git push origin build/$(Build.BuildNumber)
workingDirectory: $(Build.SourcesDirectory)
displayName: Tag sources on CI/Manual builds
condition: and(succeeded(), or(eq(variables['build.reason'], 'IndividualCI'), eq(variables['build.reason'], 'Manual')))