-
Notifications
You must be signed in to change notification settings - Fork 232
Expand file tree
/
Copy pathinstall-tools.yml
More file actions
104 lines (89 loc) · 3.02 KB
/
Copy pathinstall-tools.yml
File metadata and controls
104 lines (89 loc) · 3.02 KB
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
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
steps:
- task: UseDotNet@2
displayName: Use .NET SDK
inputs:
version: 8.x
- task: UseDotNet@2
displayName: Use .NET SDK
inputs:
version: 6.x
- task: NuGetToolInstaller@1
displayName: Install Nuget
- task: NuGetAuthenticate@1
- task: PowerShell@2
displayName: Version Check
inputs:
targetType: inline
pwsh: true
script: |
Write-Output $PSVersionTable
- task: NodeTool@1
displayName: Install NodeJs
inputs:
version: 22.x
- task: PowerShell@2
displayName: Configure private npm feed
inputs:
targetType: filePath
pwsh: true
filePath: $(Build.SourcesDirectory)/tools/Configure-PrivateNpmFeed.ps1
arguments: -SourcesDirectory "$(Build.SourcesDirectory)"
- task: npmAuthenticate@0
displayName: Authenticate to private npm feed
inputs:
workingFile: $(Build.SourcesDirectory)/.npmrc
- task: npmAuthenticate@0
displayName: Authenticate to private npm feed (Rush)
inputs:
workingFile: $(Build.SourcesDirectory)/autorest.powershell/common/config/rush/.npmrc
- task: PowerShell@2
displayName: Apply npm auth config to user profile
inputs:
targetType: inline
pwsh: true
script: |
# Copy authenticated .npmrc to the user home dir so ALL npm subprocesses
# (including autorest's internal npm calls) use the private feed + auth tokens.
$src = "$(Build.SourcesDirectory)/.npmrc"
$dst = Join-Path $env:USERPROFILE ".npmrc"
Copy-Item -Path $src -Destination $dst -Force
Write-Host "Copied npm config to $dst"
- task: Npm@1
displayName: Install AutoRest
inputs:
command: custom
workingDir: $(Build.SourcesDirectory)
customCommand: install --no-package-lock autorest@3.7.2
- task: Npm@1
displayName: Install AutorestCore
inputs:
command: custom
workingDir: $(Build.SourcesDirectory)
customCommand: install --no-package-lock @autorest/core@3.10.4
- task: PowerShell@2
displayName: Pre-populate autorest extension cache
inputs:
targetType: filePath
pwsh: true
filePath: $(Build.SourcesDirectory)/tools/utilities/PrePopulateAutorestCache.ps1
- task: Npm@1
displayName: Install Rush
inputs:
command: custom
workingDir: $(Build.SourcesDirectory)
customCommand: install --no-package-lock @microsoft/rush
- task: PowerShell@2
displayName: Rush Build
inputs:
targetType: inline
pwsh: true
workingDirectory: "autorest.powershell"
script: |
npx --no-install rush install
if ($LASTEXITCODE -ne 0) { throw "rush install failed with exit code $LASTEXITCODE" }
npx --no-install rush link
if ($LASTEXITCODE -ne 0) { throw "rush link failed with exit code $LASTEXITCODE" }
npx --no-install rush rebuild
if ($LASTEXITCODE -ne 0) { throw "rush rebuild failed with exit code $LASTEXITCODE" }