-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathBuild-Module-job.yml
56 lines (49 loc) · 1.96 KB
/
Build-Module-job.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
parameters:
buildSourcePath: "**/build.psd1"
gitVersionVariable: 'NuGetVersion'
requiredModulesPath: RequiredModules.psd1
artifactName: BuildOutput
pool:
vmImage: 'windows-2019'
jobs:
- job: Build
pool: ${{ parameters.pool }}
dependsOn: [Initialize,GitVersion]
workspace:
clean: all
variables:
SemVer: $[dependencies.GitVersion.outputs['GitVersion.${{ parameters.gitVersionVariable }}']]
DotNetBuild: $[dependencies.Initialize.outputs['Output.HasDotNetProject']]
SubModuleCount: $[dependencies.Initialize.outputs['Output.SubModuleCount']]
steps:
- checkout: self
clean: true
lfs: true
submodules: recursive
persistCredentials: true
# Ensure LFS updates for submodules
- powershell: |
git config http.https://qmdevteam.visualstudio.com.extraheader="AUTHORIZATION: bearer $(System.AccessToken)"
git submodule foreach --recursive "ls && git lfs install --local && git lfs pull"
displayName: 'Fetch Submodule LFS files'
condition: gt(variables['SubModuleCount'], 0)
name: FetchSubmoduleLFS
- ${{ if ne('', parameters.requiredModulesPath ) }}:
- template: Install-RequiredModule-step.yml
parameters:
path: $(Build.SourcesDirectory)/${{ parameters.requiredModulesPath }}
- powershell: |
$VersionPrefix, $VersionSuffix = "$(SemVer)" -split '[-+]', 2
dotnet build -c Release -p:VersionPrefix=$VersionPrefix -p:VersionSuffix=$VersionSuffix
displayName: Build Solution
condition: eq(variables['DotNetBuild'],'True')
- template: Build-Module-step.yml
parameters:
sourcePath: $(Build.SourcesDirectory)/${{ parameters.buildSourcePath }}
destination: $(Build.BinariesDirectory)
semVer: $(SemVer)
- task: PublishPipelineArtifact@1
displayName: Publish Build Output
inputs:
artifactName: ${{ parameters.artifactName }}
targetPath: $(Build.BinariesDirectory)