-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathazure-pipelines.yml
169 lines (167 loc) · 7.16 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
#trigger:
# branches:
# include:
# - master
# - dev
#
#pr:
# branches:
# include:
# - master
# - dev
variables:
solution: 'Buttplug.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
jobs:
- job: Windows
pool:
vmImage: 'windows-2022'
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.
- template: build/setup-signing-key.yml
- task: VSBuild@1
displayName: "Build Project"
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
maximumCpuCount: true
# - task: VSTest@2
# displayName: "Test Project"
# inputs:
# platform: '$(buildPlatform)'
# configuration: '$(buildConfiguration)'
# - task: CopyFiles@2
# displayName: "Copy buttplug files to unity runtime"
# condition: and(succeeded(), eq(variables['buildConfiguration'], 'Release'))
# inputs:
# Contents: "$(System.DefaultWorkingDirectory)/Buttplug/bin/Release/net47/*.dll"
# TargetFolder: '$(Build.ArtifactStagingDirectory)/ButtplugUnity'
# flattenFolders: true
# CleanTargetFolder: true
# - task: CopyFiles@2
# displayName: "Copy buttplug websocket files to unity runtime"
# condition: and(succeeded(), eq(variables['buildConfiguration'], 'Release'))
# inputs:
# Contents: "$(System.DefaultWorkingDirectory)/Buttplug.Client.Connectors.WebsocketConnector/bin/Release/net47/*.dll"
# TargetFolder: '$(Build.ArtifactStagingDirectory)/ButtplugUnity'
# flattenFolders: true
# CleanTargetFolder: false
# - task: ArchiveFiles@2
# displayName: "Archive unity artifacts"
# condition: and(succeeded(), eq(variables['buildConfiguration'], 'Release'))
# inputs:
# rootFolderOrFile: "$(Build.ArtifactStagingDirectory)/ButtplugUnity"
# archiveType: "zip"
# archiveFile: "$(Build.ArtifactStagingDirectory)/buttplug-unity-libraries-$(gitVersion).zip"
# includeRootFolder: false
- task: CopyFiles@2
displayName: "Copy nuget packages to staging"
inputs:
# Prefix this with Buttplug, otherwise we'll archive the packages directory too. Make sure
# to wildcard *.*nupkg so we pick up snupkg
Contents: "$(System.DefaultWorkingDirectory)/Buttplug*/**/*.*nupkg"
TargetFolder: '$(Build.ArtifactStagingDirectory)/nuget'
CleanTargetFolder: true
- task: PowerShell@2
displayName: 'Sign Exported Nuget Packages'
# Only sign on dev/master builds
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/dev'), eq(variables['Build.SourceBranch'], 'refs/heads/master')))
inputs:
targetType: inline
script: |
Get-ChildItem -Path $(Build.ArtifactStagingDirectory) -Filter *.nupkg -Recurse -File -Name| ForEach-Object {
nuget sign $(Build.ArtifactStagingDirectory)\$_ -CertificatePath SigningCert.pfx -CertificatePassword "$(NPLabsRepoSigningKey)" -Timestamper http://timestamp.comodoca.com/rfc3161
}
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: 'artifacts-$(buildConfiguration)'
#- job: Documentation
# pool:
# vmImage: 'vs2017-win2016'
# dependsOn:
# - Windows
# condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/dev'), eq(variables['Build.SourceBranch'], 'refs/heads/master')))
# steps:
# - task: PowerShell@2
# displayName: Documentation Generation
# inputs:
# targetType: inline
# script: |
# cinst -y docfx
# copy-item README.md docs/index.md
# copy-item *.md docs/articles/
# docfx docs/docfx.json
# - task: ArchiveFiles@2
# displayName: "Archive Documentation Artifacts"
# inputs:
# rootFolderOrFile: "docs/_site"
# archiveType: "zip"
# archiveFile: "$(Build.ArtifactStagingDirectory)/buttplug-csharp-docs-$(gitVersion).zip"
# includeRootFolder: true
# # - task: PublishBuildArtifacts@1
# # displayName: "Publish Documentation Artifacts"
# # inputs:
# # PathtoPublish: "$(Build.ArtifactStagingDirectory)/buttplug-csharp-docs-$(gitVersion).zip"
# # ArtifactName: "buttplug-csharp-docs"
# # - task: PowerShell@2
# # displayName: Deploy Master Documentation to Netlify
# # condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
# # inputs:
# # targetType: inline
# # script: |
# # npm i -g netlify-cli
# # netlify deploy --prod --open --site=$(NETLIFY_MASTER_DOC_SITEID) --auth=$(NETLIFY_TOKEN) --dir=docs/_site
# # - task: PowerShell@2
# # displayName: Deploy Dev Documentation to Netlify
# # condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/dev'))
# # inputs:
# # targetType: inline
# # script: |
# # npm i -g netlify-cli
# # netlify deploy --prod --open --site=$(NETLIFY_DEV_DOC_SITEID) --auth=$(NETLIFY_TOKEN) --dir=docs/_site
#- job: Deploy
# dependsOn:
# - Windows
# condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/dev'), eq(variables['Build.SourceBranch'], 'refs/heads/master')))
# pool:
# vmImage: 'windows-2022'
# steps:
# - template: build/setup-variables.yml
# - task: DownloadPipelineArtifact@2
# displayName: Download Artifacts from other jobs
# inputs:
# buildType: 'current'
# - task: NuGetCommand@2
# displayName: "Push NuGet packages to NuGet.org"
# condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
# inputs:
# command: "push"
# nuGetFeedType: "external"
# packagesToPush: "$(System.ArtifactsDirectory)/artifacts-Release/**/!(*.symbols).nupkg"
# allowPackageConflicts: false
# publishFeedCredentials: "NuGet.org"
# - task: GitHubRelease@0
# displayName: Upload Unity zip to Github
# condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
# inputs:
# gitHubConnection: "release"
# repositoryName: "buttplugio/buttplug-csharp"
# action: "create"
# releaseNotes: "Buttplug C# releases are stored on NuGet, please retrieve libraries from there. The only files released here are for Buttplug Unity building. To download the Unity package, see [the Buttplug Unity repo](https://github.com/buttplugio/buttplug-unity) for more info."
# tagSource: "auto"
# title: "Buttplug Unity Release"
# assets: |
# $(System.ArtifactsDirectory)\**\buttplug-unity-*.zip
# isPreRelease: false