-
Notifications
You must be signed in to change notification settings - Fork 1
/
build-steps.yml
46 lines (45 loc) · 1.85 KB
/
build-steps.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
parameters:
- name: moduleName
type: string
steps:
- script: dotnet tool install --global GitVersion.Tool --version 5.3.3
displayName: Install Gitversion
- pwsh: |
$raw = dotnet-gitversion
Write-Host $raw
$version = $raw | ConvertFrom-Json | ForEach-Object MajorMinorPatch
Write-Host "##vso[build.updatebuildnumber]$version"
displayName: Set Build Number
- pwsh: |
$rawManifest = Get-Content -Path "${{ parameters.moduleName }}.psd1" -raw
$updatedManifest = $rawManifest -replace "ModuleVersion\s*=\s*['`"][0-9.]+['`"]", "ModuleVersion = '$(Build.BuildNumber)'"
$updatedManifest | Out-File -Path "${{ parameters.moduleName }}.psd1" -NoNewline
displayName: Update Module Manifest Version Number
- task: CopyFiles@2
inputs:
contents: |
**/*
!**/.*/**/*
!**/.*
!*.yml
targetFolder: $(Build.ArtifactStagingDirectory)/${{ parameters.moduleName }}
- publish: '$(Build.ArtifactStagingDirectory)/${{ parameters.moduleName }}'
artifact: 'files'
displayName: 'Publish Artifact files'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: $(Build.ArtifactStagingDirectory)/${{ parameters.moduleName }}
archiveFile: '$(Build.ArtifactStagingDirectory)/${{ parameters.moduleName }}_$(Build.BuildNumber).zip'
displayName: 'Archive zip'
- publish: '$(Build.ArtifactStagingDirectory)/${{ parameters.moduleName }}_$(Build.BuildNumber).zip'
artifact: 'zip'
displayName: 'Publish Artifact zip'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: $(Build.ArtifactStagingDirectory)/${{ parameters.moduleName }}
archiveType: tar
archiveFile: '$(Build.ArtifactStagingDirectory)/${{ parameters.moduleName }}_$(Build.BuildNumber).tar.gz'
displayName: 'Archive tar'
- publish: '$(Build.ArtifactStagingDirectory)/${{ parameters.moduleName }}_$(Build.BuildNumber).tar.gz'
artifact: 'tar'
displayName: 'Publish Artifact tar'