-
Notifications
You must be signed in to change notification settings - Fork 7.1k
/
release-UpdateDepsJson.yml
69 lines (60 loc) · 2.18 KB
/
release-UpdateDepsJson.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
jobs:
- job: UpdateDepsFiles
displayName: Update deps files
pool: PowerShell1ES
demands:
- ImageOverride -equals MMS2019TLS
variables:
- group: 'Azure Blob variable group'
steps:
- checkout: self
clean: true
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: PowerShellCore
pipeline: '696'
preferTriggeringPipeline: true
runVersion: latestFromBranch
runBranch: '$(Build.SourceBranch)'
artifact: finalResults
patterns: '**/PowerShell*-win-x64.zip'
path: '$(Pipeline.Workspace)/releasePipeline/finalResults'
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: PowerShellCore
pipeline: '696'
preferTriggeringPipeline: true
runVersion: latestFromBranch
runBranch: '$(Build.SourceBranch)'
artifact: BuildInfoJson
path: '$(Pipeline.Workspace)/releasePipeline/BuildInfoJson'
- pwsh: |
$fileName = (Get-Item "$ENV:PIPELINE_WORKSPACE/releasePipeline/BuildInfoJson/*.json").BaseName
if ($fileName -notin 'stable','preview')
{
throw "Unexpected fileName: $fileName"
}
$vstsCommand = "vso[task.setvariable variable=BlobPrefix]$fileName"
Write-Verbose -Verbose $vstsCommand
Write-Host "##$vstsCommand"
displayName: Determine container name
- pwsh: |
$zipFile = Get-Item "$ENV:PIPELINE_WORKSPACE/releasePipeline/finalResults/PowerShell*-win-x64.zip" -Exclude *-symbols-*
Write-Verbose -Verbose "zipFile: $zipFile"
Expand-Archive -Path $zipFile -Destination "$ENV:PIPELINE_WORKSPACE/expanded"
$pwshDepsFile = Get-Item "$ENV:PIPELINE_WORKSPACE/expanded/pwsh.deps.json"
$vstsCommand = "vso[task.setvariable variable=FileToUpload]$pwshDepsFile"
Write-Verbose -Verbose $vstsCommand
Write-Host "##$vstsCommand"
displayName: Determine file to upload
- task: AzureFileCopy@2
displayName: 'AzureBlob pwsh.deps.json file Copy'
inputs:
SourcePath: '$(FileToUpload)'
azureSubscription: '$(AzureFileCopySubscription)'
Destination: AzureBlob
storage: '$(StorageAccount)'
ContainerName: ps-deps-json
blobPrefix: '$(BlobPrefix)'