-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathpackage.yml
More file actions
146 lines (120 loc) · 6.13 KB
/
package.yml
File metadata and controls
146 lines (120 loc) · 6.13 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
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
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# Template for building platform-specific VSIX packages
# Sets VSCETARGET environment variable for noxfile.py to select correct debugpy wheels
# Iterates over buildPlatforms to create a job per platform
parameters:
- name: buildPlatforms
type: object
displayName: 'List of platforms to build'
- name: customNPMRegistry
type: string
default: ''
displayName: 'Custom NPM registry (optional)'
- name: nodeVersion
type: string
default: '22.17.0'
displayName: 'Node version to install'
- name: buildSteps
type: stepList
default: []
displayName: 'Build steps to execute'
- name: isPreRelease
type: boolean
default: false
displayName: 'Is this a pre-release build'
- name: standardizedVersioning
type: boolean
default: false
displayName: 'Use standardized versioning (YYYYMMDDRR format)'
- name: vscePackageArgs
type: string
default: ''
displayName: 'Additional vsce package arguments'
- name: workingDirectory
type: string
default: '$(Build.SourcesDirectory)'
displayName: 'Working directory for packaging'
jobs:
- ${{ each platform in parameters.buildPlatforms }}:
- job: Build_${{ replace(coalesce(platform.vsceTarget, 'universal'), '-', '_') }}
displayName: "Build ${{ coalesce(platform.vsceTarget, 'universal') }}"
${{ if eq(platform.name, 'Linux') }}:
pool:
name: AzurePipelines-EO
image: 1ESPT-Ubuntu22.04
os: linux
${{ if eq(platform.name, 'MacOS') }}:
pool:
name: Azure Pipelines
image: macos-latest
os: macOS
${{ if eq(platform.name, 'Windows') }}:
pool:
name: AzurePipelines-EO
image: 1ESPT-Windows2022
os: windows
variables:
packageArch: ${{ coalesce(platform.packageArch, '') }}
vsceTarget: ${{ platform.vsceTarget }}
${{ if eq(platform.name, 'MacOS') }}:
BUILDSECMON_OPT_IN: false
templateContext:
outputs:
- output: pipelineArtifact
displayName: "Publish VSIX for ${{ coalesce(platform.vsceTarget, 'universal') }}"
targetPath: '$(Build.ArtifactStagingDirectory)/drop'
artifactName: vsix-${{ coalesce(platform.vsceTarget, 'universal') }}
steps:
- template: setup.yml@self
parameters:
customNPMRegistry: ${{ parameters.customNPMRegistry }}
nodeVersion: ${{ parameters.nodeVersion }}
- ${{ if and(eq(parameters.isPreRelease, true), eq(parameters.standardizedVersioning, true)) }}:
- template: modify-extension-version.yml@self
parameters:
workingDirectory: ${{ parameters.workingDirectory }}
- bash: |
echo "##vso[task.setvariable variable=VSCETARGET]${{ platform.vsceTarget }}"
echo "Building for target: ${{ platform.vsceTarget }}"
displayName: 'Set VSCETARGET variable'
- ${{ each buildStep in parameters.buildSteps }}:
- ${{ buildStep }}
- ${{ if eq(platform.vsceTarget, '') }}:
- bash: |
VSIX=$(node -p "require(\"./package.json\").publisher + \".\" + require(\"./package.json\").name + \".\" + require(\"./package.json\").version + \".universal.vsix\"")
echo "##vso[task.setvariable variable=VSIX;isOutput=true]$VSIX"
name: SetExtensionName
displayName: 🗄 Set VSIX file name
workingDirectory: ${{ parameters.workingDirectory }}
- ${{ if ne(platform.vsceTarget, '') }}:
- bash: |
VSIX=$(node -p "require(\"./package.json\").publisher + \".\" + require(\"./package.json\").name + \".\" + require(\"./package.json\").version + \".\" + \"${{ platform.vsceTarget }}\" + \".vsix\"")
echo "##vso[task.setvariable variable=VSIX;isOutput=true]$VSIX"
name: SetExtensionName
displayName: 🗄 Set VSIX file name
workingDirectory: ${{ parameters.workingDirectory }}
- ${{ if eq(parameters.isPreRelease, false) }}:
- ${{ if eq(platform.vsceTarget, '') }}:
- script: npx @vscode/vsce@latest package -o $(Build.BinariesDirectory)/$(SetExtensionName.VSIX) ${{ parameters.vscePackageArgs }}
displayName: 💾 Package extension
workingDirectory: ${{ parameters.workingDirectory }}
- ${{ if ne(platform.vsceTarget, '') }}:
- script: npx @vscode/vsce@latest package -o $(Build.BinariesDirectory)/$(SetExtensionName.VSIX) --target ${{ platform.vsceTarget }} ${{ parameters.vscePackageArgs }}
displayName: 💾 Package extension
workingDirectory: ${{ parameters.workingDirectory }}
- ${{ if eq(parameters.isPreRelease, true) }}:
- ${{ if eq(platform.vsceTarget, '') }}:
- script: npx @vscode/vsce@latest package -o $(Build.BinariesDirectory)/$(SetExtensionName.VSIX) --pre-release ${{ parameters.vscePackageArgs }}
displayName: 💾 Package pre-release extension
workingDirectory: ${{ parameters.workingDirectory }}
- ${{ if ne(platform.vsceTarget, '') }}:
- script: npx @vscode/vsce@latest package -o $(Build.BinariesDirectory)/$(SetExtensionName.VSIX) --target ${{ platform.vsceTarget }} --pre-release ${{ parameters.vscePackageArgs }}
displayName: 💾 Package pre-release extension
workingDirectory: ${{ parameters.workingDirectory }}
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.BinariesDirectory)
contents: '*.vsix'
targetFolder: $(Build.ArtifactStagingDirectory)/drop
displayName: 📦 Copy VSIX to staging