Skip to content

Commit 06118d4

Browse files
Squashed Commits
1 parent 6c788db commit 06118d4

File tree

7 files changed

+31868
-30124
lines changed

7 files changed

+31868
-30124
lines changed

.azure-pipelines/common-steps.yml

+42-2
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,47 @@ steps:
3636
# Acquire the `vsce` tool and use it to package
3737
- script: |
3838
npm install -g @vscode/vsce
39-
vsce package
39+
displayName: Install VSCE
40+
41+
- script: |
42+
npx @vscode/vsce package -o extension.vsix
4043
displayName: Create VSIX
4144

45+
- script: |
46+
npx @vscode/vsce generate-manifest -i extension.vsix -o extension.manifest
47+
displayName: Create VSIX Manifest
48+
49+
- script: |
50+
cp extension.manifest extension.signature.p7s
51+
displayName: Prepare Manifest Signature
52+
53+
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
54+
inputs:
55+
ConnectedServiceName: PipelinesAgentAndTasksESRP
56+
AppRegistrationClientId: $(AppRegistrationClientId)
57+
AppRegistrationTenantId: $(AppRegistrationTenantId)
58+
AuthAKVName: $(AuthAKVName)
59+
AuthCertName: $(AuthCertName)
60+
AuthSignCertName: $(AuthSignCertName)
61+
FolderPath: '$(Build.SourcesDirectory)'
62+
Pattern: 'extension.signature.p7s'
63+
signConfigType: inlineSignParams
64+
inlineOperation: |
65+
[
66+
{
67+
"keyCode": "CP-401405",
68+
"operationSetCode": "VSCodePublisherSign",
69+
"parameters" : [],
70+
"toolName": "sign",
71+
"toolVersion": "1.0"
72+
}
73+
]
74+
SessionTimeout: 90
75+
MaxConcurrency: 25
76+
MaxRetryAttempts: 5
77+
PendingAnalysisWaitTimeoutMinutes: 5
78+
displayName: Sign Extension
79+
4280
- script: |
4381
npm run vscode:prepublish
4482
cat /home/vsts/.npm/_logs/*.log
@@ -59,8 +97,10 @@ steps:
5997
displayName: Stage VSIX for publishing
6098
inputs:
6199
contents: |-
62-
*.vsix
100+
extension.vsix
63101
version.txt
64102
branch.txt
65103
minichangelog.txt
104+
extension.signature.p7s
105+
extension.manifest
66106
targetFolder: $(Build.ArtifactStagingDirectory)

.azure-pipelines/github-release/github-release.js

+47-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ const DEBUG_LOGGING = process.env.SYSTEM_DEBUG && process.env.SYSTEM_DEBUG == 't
1111
let vsixName = process.argv[2] || null;
1212
let version = process.argv[3] || null;
1313
let token = process.argv[4] || null
14+
let signature = process.argv[5] || null
15+
let manifest = process.argv[6] || null
16+
1417
if (token === null) {
1518
console.log(`Usage:
1619
@@ -59,12 +62,12 @@ async function createRelease() {
5962
console.log(createReleaseResult);
6063
}
6164

65+
// Upload the VSIX
6266
const vsixSize = fs.statSync(vsixName).size;
63-
6467
console.log('Uploading VSIX...');
65-
let uploadResult;
68+
let vsixUploadResult;
6669
try {
67-
uploadResult = await octokit.repos.uploadAsset({
70+
vsixUploadResult = await octokit.repos.uploadAsset({
6871
url: createReleaseResult.data.upload_url,
6972
headers: {
7073
'content-length': vsixSize,
@@ -78,8 +81,48 @@ async function createRelease() {
7881
}
7982
console.log('Uploaded VSIX.');
8083

84+
// Upload the Manifest
85+
const manifestSize = fs.statSync(manifest).size;
86+
console.log('Uploading Manifest...');
87+
let manifestUploadResult;
88+
try {
89+
manifestUploadResult = await octokit.repos.uploadAsset({
90+
url: createReleaseResult.data.upload_url,
91+
headers: {
92+
'content-length': manifestSize,
93+
'content-type': 'application/xml',
94+
},
95+
name: manifest,
96+
file: fs.createReadStream(manifest)
97+
});
98+
} catch (e) {
99+
throw e;
100+
}
101+
console.log('Uploaded Manifest.');
102+
103+
// Upload the Signature
104+
const signatureSize = fs.statSync(signature).size;
105+
console.log('Uploading Signature...');
106+
let signatureUploadResult;
107+
try {
108+
signatureUploadResult = await octokit.repos.uploadAsset({
109+
url: createReleaseResult.data.upload_url,
110+
headers: {
111+
'content-length': signatureSize,
112+
'content-type': 'application/pkcs7-signature',
113+
},
114+
name: signature,
115+
file: fs.createReadStream(signature)
116+
});
117+
} catch (e) {
118+
throw e;
119+
}
120+
console.log('Uploaded Signature.');
121+
81122
if (DEBUG_LOGGING) {
82-
console.log(uploadResult);
123+
console.log("VISX Upload Result:" + vsixUploadResult);
124+
console.log("Manifest Upload Result:" + manifestUploadResult);
125+
console.log("Signature Upload Result:" + signatureUploadResult);
83126
}
84127
}
85128

.azure-pipelines/release-pipeline.yml

+10-5
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44

55
# Only trigger manually
66

7-
# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool.
8-
# This pipeline will be extended to the OneESPT template
9-
107
trigger: none
8+
119
pr: none
10+
1211
resources:
1312
repositories:
1413
- repository: 1ESPipelineTemplates
1514
type: git
1615
name: 1ESPipelineTemplates/1ESPipelineTemplates
1716
ref: refs/tags/release
17+
1818
extends:
1919
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
2020
parameters:
@@ -36,6 +36,7 @@ extends:
3636
os: linux
3737
customBuildTags:
3838
- ES365AIMigrationTooling
39+
3940
stages:
4041
- stage: stage
4142
jobs:
@@ -46,6 +47,7 @@ extends:
4647
displayName: 'Publish VSIX'
4748
artifactName: azure-pipelines-vscode
4849
targetPath: $(Build.ArtifactStagingDirectory)
50+
4951
steps:
5052
# release version should be correctly set in package.json
5153
- bash: |
@@ -72,11 +74,14 @@ extends:
7274
npm install
7375
displayName: Prepare to create GitHub Release
7476
workingDirectory: '$(Build.SourcesDirectory)/.azure-pipelines/github-release'
77+
7578
- bash: |
7679
SCRIPT=.azure-pipelines/github-release/github-release.js
77-
VSIX=*.vsix
80+
VSIX=extension.vsix
7881
VERSION=$(node -p "require('./package.json').version")
79-
node $SCRIPT $VSIX $VERSION $GITHUB_TOKEN
82+
VSIX_SIGNATURE=extension.signature.p7s
83+
VSIX_MANIFEST=extension.manifest
84+
node $SCRIPT $VSIX $VERSION $GITHUB_TOKEN $VSIX_SIGNATURE $VSIX_MANIFEST
8085
displayName: Create GitHub Release
8186
env:
8287
GITHUB_TOKEN: $(GitHubSecret)

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ All notable changes to the Azure Pipelines extension will be documented in this
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/). Versioning follows an internal Azure DevOps format that is not compatible with SemVer.
55

6+
## 1.247.2
7+
### Added
8+
- Added ESRP Esrp CodeSigning step
9+
- Updated build generation to sign the VSIX
10+
- Updated upload steps to upload VSIX, signature & manifest
11+
612
## 1.237.0
713
### Added
814
- Added go-to-definition support for local templates (thanks @Stuart-Wilcox!)

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "azure-pipelines",
33
"displayName": "Azure Pipelines",
44
"description": "Syntax highlighting, IntelliSense, and more for Azure Pipelines YAML",
5-
"version": "1.237.0",
5+
"version": "1.247.2",
66
"publisher": "ms-azure-devops",
77
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
88
"repository": {

0 commit comments

Comments
 (0)