Skip to content

Commit

Permalink
Squashed Commits
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaMankal-MS committed Oct 14, 2024
1 parent 6c788db commit 28e823a
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 12 deletions.
42 changes: 41 additions & 1 deletion .azure-pipelines/common-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,47 @@ steps:
# Acquire the `vsce` tool and use it to package
- script: |
npm install -g @vscode/vsce
vsce package
displayName: Install VSCE

- script: |
vsce package -o $(Build.ArtifactStagingDirectory)/extension.vsix
displayName: Create VSIX

- script: |
vsce generate-manifest -i $(Build.ArtifactStagingDirectory)/extension.vsix -o $(Build.ArtifactStagingDirectory)/extension.manifest
displayName: Create VSIX Manifest

- script: |
cp $(Build.ArtifactStagingDirectory)/extension.manifest $(Build.ArtifactStagingDirectory)/extension.signature.p7s
displayName: Prepare Manifest Signature

- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
inputs:
ConnectedServiceName: PipelinesAgentAndTasksESRP
AppRegistrationClientId: $(AppRegistrationClientId)
AppRegistrationTenantId: $(AppRegistrationTenantId)
AuthAKVName: $(AuthAKVName)
AuthCertName: $(AuthCertName)
AuthSignCertName: $(AuthSignCertName)
FolderPath: '$(Build.ArtifactStagingDirectory)'
Pattern: 'extension.signature.p7s'
signConfigType: inlineSignParams
inlineOperation: |
[
{
"keyCode": "CP-401405",
"operationSetCode": "VSCodePublisherSign",
"parameters" : [],
"toolName": "sign",
"toolVersion": "1.0"
}
]
SessionTimeout: 90
MaxConcurrency: 25
MaxRetryAttempts: 5
PendingAnalysisWaitTimeoutMinutes: 5
displayName: Sign Extension

- script: |
npm run vscode:prepublish
cat /home/vsts/.npm/_logs/*.log
Expand All @@ -63,4 +101,6 @@ steps:
version.txt
branch.txt
minichangelog.txt
extension.signature.p7s
extension.manifest
targetFolder: $(Build.ArtifactStagingDirectory)
51 changes: 47 additions & 4 deletions .azure-pipelines/github-release/github-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ const DEBUG_LOGGING = process.env.SYSTEM_DEBUG && process.env.SYSTEM_DEBUG == 't
let vsixName = process.argv[2] || null;
let version = process.argv[3] || null;
let token = process.argv[4] || null
let signature = process.argv[5] || null
let manifest = process.argv[6] || null

if (token === null) {
console.log(`Usage:
Expand Down Expand Up @@ -59,12 +62,12 @@ async function createRelease() {
console.log(createReleaseResult);
}

// Upload the VSIX
const vsixSize = fs.statSync(vsixName).size;

console.log('Uploading VSIX...');
let uploadResult;
let vsixUploadResult;
try {
uploadResult = await octokit.repos.uploadAsset({
vsixUploadResult = await octokit.repos.uploadAsset({
url: createReleaseResult.data.upload_url,
headers: {
'content-length': vsixSize,
Expand All @@ -78,8 +81,48 @@ async function createRelease() {
}
console.log('Uploaded VSIX.');

// Upload the Manifest
const manifestSize = fs.statSync(manifest).size;
console.log('Uploading Manifest...');
let manifestUploadResult;
try {
manifestUploadResult = await octokit.repos.uploadAsset({
url: createReleaseResult.data.upload_url,
headers: {
'content-length': manifestSize,
'content-type': application/xml,
},
name: manifest,
file: fs.createReadStream(manifest)
});
} catch (e) {
throw e;
}
console.log('Uploaded Manifest.');

// Upload the Signature
const signatureSize = fs.statSync(signature).size;
console.log('Uploading Signature...');
let signatureUploadResult;
try {
signatureUploadResult = await octokit.repos.uploadAsset({
url: createReleaseResult.data.upload_url,
headers: {
'content-length': signatureSize,
'content-type': application/pkcs7-signature,
},
name: signature,
file: fs.createReadStream(signature)
});
} catch (e) {
throw e;
}
console.log('Uploaded Signature.');

if (DEBUG_LOGGING) {
console.log(uploadResult);
console.log("VISX Upload Result:" + vsixUploadResult);
console.log("Manifest Upload Result:" + manifestUploadResult);
console.log("Signature Upload Result:" + signatureUploadResult);
}
}

Expand Down
13 changes: 9 additions & 4 deletions .azure-pipelines/release-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

# Only trigger manually

# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool.
# This pipeline will be extended to the OneESPT template

trigger: none

pr: none

resources:
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release

extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
Expand All @@ -36,6 +36,7 @@ extends:
os: linux
customBuildTags:
- ES365AIMigrationTooling

stages:
- stage: stage
jobs:
Expand All @@ -46,6 +47,7 @@ extends:
displayName: 'Publish VSIX'
artifactName: azure-pipelines-vscode
targetPath: $(Build.ArtifactStagingDirectory)

steps:
# release version should be correctly set in package.json
- bash: |
Expand All @@ -72,11 +74,14 @@ extends:
npm install
displayName: Prepare to create GitHub Release
workingDirectory: '$(Build.SourcesDirectory)/.azure-pipelines/github-release'
- bash: |
SCRIPT=.azure-pipelines/github-release/github-release.js
VSIX=*.vsix
VERSION=$(node -p "require('./package.json').version")
node $SCRIPT $VSIX $VERSION $GITHUB_TOKEN
VSIX_SIGNATURE=extension.signature.p7s
VSIX_MANIFEST=extension.manifest
node $SCRIPT $VSIX $VERSION $GITHUB_TOKEN $VSIX_SIGNATURE $VSIX_MANIFEST
displayName: Create GitHub Release
env:
GITHUB_TOKEN: $(GitHubSecret)
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,9 @@ All of the material changes in this version were courtesy of @50Wliu. Thanks!
- Initial release
- Syntax highlighting for Azure Pipelines files
- Intellisense for Azure Pipelines files

## 1.247.1-beta-0.6
### Added
- Added ESRP Esrp CodeSigning step
- Updated build generation to sign the VSIX
- Updated upload steps to upload VSIX, signature & manifest
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "azure-pipelines",
"displayName": "Azure Pipelines",
"description": "Syntax highlighting, IntelliSense, and more for Azure Pipelines YAML",
"version": "1.237.0",
"version": "1.247.1-beta-0.6",
"publisher": "ms-azure-devops",
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
"repository": {
Expand Down

0 comments on commit 28e823a

Please sign in to comment.