Skip to content

Commit 2410bea

Browse files
committed
Revert "Get rid of vscode-engineering template in the npm publish pipeline (microsoft#1328)"
This reverts commit b837aa1.
1 parent b837aa1 commit 2410bea

File tree

3 files changed

+62
-111
lines changed

3 files changed

+62
-111
lines changed

build/azure-pipeline.npm.yml

Lines changed: 36 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -5,124 +5,49 @@ pr: none
55

66
resources:
77
repositories:
8-
- repository: MicroBuildTemplate
9-
type: git
10-
name: 1ESPipelineTemplates/MicroBuildTemplate
11-
ref: refs/tags/release
8+
- repository: templates
9+
type: github
10+
name: microsoft/vscode-engineering
11+
ref: main
12+
endpoint: Monaco
1213

1314
parameters:
1415
- name: quality
15-
displayName: 📦 Release Quality
16+
displayName: Quality
1617
type: string
17-
default: stable
18+
default: latest
1819
values:
19-
- stable
20-
- preview
21-
22-
- name: publishPackage
23-
displayName: 🚀 Publish to npm
20+
- latest
21+
- next
22+
- name: publishPythonEnvsApi
23+
displayName: 🚀 Publish @vscode/python-environments
2424
type: boolean
2525
default: false
2626

27-
- name: buildSteps
28-
type: stepList
29-
default:
30-
- task: NodeTool@0
31-
inputs:
32-
versionSpec: '22.21.1'
33-
displayName: Select Node version
34-
35-
- script: npm ci
36-
workingDirectory: $(Build.SourcesDirectory)/pythonEnvironmentsApi
37-
displayName: Install package dependencies
38-
39-
- script: npm run compile
40-
workingDirectory: $(Build.SourcesDirectory)/pythonEnvironmentsApi
41-
displayName: Compile TypeScript
42-
43-
- script: npm pack --ignore-scripts
44-
workingDirectory: $(Build.SourcesDirectory)/pythonEnvironmentsApi
45-
displayName: Pack npm package
46-
47-
variables:
48-
- name: TeamName
49-
value: vscode-python-environments
50-
- name: PackageName
51-
value: '@vscode/python-environments'
52-
- name: PackageDir
53-
value: pythonEnvironmentsApi
54-
- name: npmTag
55-
${{ if eq(parameters.quality, 'preview') }}:
56-
value: next
57-
${{ else }}:
58-
value: latest
59-
6027
extends:
61-
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
28+
template: azure-pipelines/npm-package/pipeline.yml@templates
6229
parameters:
63-
sdl:
64-
sourceAnalysisPool: VSEngSS-MicroBuild2022-1ES
65-
codeSignValidation:
66-
enabled: true
67-
sbom:
68-
enabled: true
69-
pool:
70-
name: AzurePipelines-EO
71-
os: windows
72-
73-
customBuildTags:
74-
- ES365AIMigrationTooling
75-
76-
stages:
77-
- stage: Build
78-
displayName: Build & Pack
79-
jobs:
80-
- job: BuildPackage
81-
displayName: Build npm package
82-
steps:
83-
- ${{ each step in parameters.buildSteps }}:
84-
- ${{ step }}
85-
86-
- task: CopyFiles@2
87-
displayName: Copy package tarball to staging
88-
inputs:
89-
sourceFolder: $(Build.SourcesDirectory)/pythonEnvironmentsApi
90-
contents: '*.tgz'
91-
targetFolder: $(Build.ArtifactStagingDirectory)
92-
93-
- task: 1ES.PublishBuildArtifacts@1
94-
displayName: Publish build artifact
95-
inputs:
96-
pathToPublish: $(Build.ArtifactStagingDirectory)
97-
artifactName: npm-package
98-
99-
- stage: Publish
100-
displayName: Publish to npm
101-
dependsOn: Build
102-
condition: and(succeeded(), eq('${{ parameters.publishPackage }}', 'true'))
103-
jobs:
104-
- job: PublishPackage
105-
displayName: Publish $(PackageName)
106-
steps:
107-
- task: DownloadBuildArtifacts@1
108-
displayName: Download build artifact
109-
inputs:
110-
buildType: current
111-
downloadType: single
112-
artifactName: npm-package
113-
downloadPath: $(Build.ArtifactStagingDirectory)
114-
115-
- task: NodeTool@0
116-
inputs:
117-
versionSpec: '22.21.1'
118-
displayName: Select Node version
119-
120-
- bash: echo '//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}' > .npmrc
121-
workingDirectory: $(Build.SourcesDirectory)/pythonEnvironmentsApi
122-
displayName: Configure npm auth
123-
124-
- bash: npm publish $(Build.ArtifactStagingDirectory)/npm-package/*.tgz --tag $(npmTag) --access public
125-
displayName: Publish to npm (${{ parameters.quality }})
126-
workingDirectory: $(Build.SourcesDirectory)/pythonEnvironmentsApi
127-
env:
128-
NODE_AUTH_TOKEN: $(NpmAuthToken)
30+
npmPackages:
31+
- name: pythonEnvironmentsApi
32+
testPlatforms:
33+
- name: Linux
34+
nodeVersions:
35+
- 22.21.1
36+
- name: MacOS
37+
nodeVersions:
38+
- 22.21.1
39+
- name: Windows
40+
nodeVersions:
41+
- 22.21.1
42+
testSteps:
43+
- template: /build/templates/test-steps.yml@self
44+
parameters:
45+
package: pythonEnvironmentsApi
46+
buildSteps:
47+
- template: /build/templates/pack-steps.yml@self
48+
parameters:
49+
package: pythonEnvironmentsApi
50+
ghTagPrefix: release/pythonEnvironmentsApi/
51+
tag: ${{ parameters.quality }}
52+
publishPackage: ${{ parameters.publishPythonEnvsApi }}
53+
workingDirectory: $(Build.SourcesDirectory)/pythonEnvironmentsApi

build/templates/pack-steps.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
parameters:
2+
- name: package
3+
4+
steps:
5+
- script: npm install
6+
workingDirectory: $(Build.SourcesDirectory)/${{ parameters.package }}
7+
displayName: Install package dependencies

build/templates/test-steps.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
parameters:
2+
- name: package
3+
type: string
4+
- name: script
5+
type: string
6+
default: 'all:publish'
7+
8+
steps:
9+
- script: npm install
10+
workingDirectory: $(Build.SourcesDirectory)/${{ parameters.package }}
11+
displayName: Install package dependencies
12+
- bash: |
13+
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
14+
echo ">>> Started xvfb"
15+
displayName: Start xvfb
16+
condition: eq(variables['Agent.OS'], 'Linux')
17+
- script: npm run ${{ parameters.script }}
18+
workingDirectory: $(Build.SourcesDirectory)/${{ parameters.package }}
19+
displayName: Verify package

0 commit comments

Comments
 (0)