2018-11-16 16:53:08 +03:00
|
|
|
# Common steps template
|
|
|
|
#
|
|
|
|
# Things which happen regardless of CI, PR, or release builds
|
|
|
|
steps:
|
2021-11-20 01:07:13 +03:00
|
|
|
- task: NodeTool@0
|
|
|
|
displayName: Install Node 16 LTS or greater
|
|
|
|
inputs:
|
|
|
|
versionSpec: ">=16.13.0"
|
|
|
|
|
2024-09-09 13:17:32 +03:00
|
|
|
- task: NpmAuthenticate@0
|
|
|
|
inputs:
|
|
|
|
workingFile: .npmrc
|
|
|
|
|
2021-11-20 01:07:13 +03:00
|
|
|
- script: npm ci
|
|
|
|
displayName: npm ci
|
2018-11-16 16:53:08 +03:00
|
|
|
|
|
|
|
- script: npm run compile
|
|
|
|
displayName: Build extension
|
|
|
|
|
2019-01-31 16:00:26 +03:00
|
|
|
# TODO: call the schema endpoint to generate the shipped schema file
|
|
|
|
# - script: |
|
|
|
|
# echo no-op
|
2019-05-13 18:35:48 +03:00
|
|
|
# displayName: Generate service-schema.json
|
2018-11-16 16:53:08 +03:00
|
|
|
|
2021-11-28 19:53:08 +03:00
|
|
|
- script: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
|
|
|
|
displayName: Start xvfb
|
|
|
|
|
|
|
|
- script: npm run test
|
2023-11-18 11:41:05 +03:00
|
|
|
displayName: Run tests
|
2021-11-28 19:53:08 +03:00
|
|
|
env:
|
|
|
|
DISPLAY: ':99.0'
|
|
|
|
|
2023-11-20 04:26:09 +03:00
|
|
|
- script: npm run lint
|
|
|
|
displayName: Lint
|
|
|
|
|
2018-11-16 16:53:08 +03:00
|
|
|
# Acquire the `vsce` tool and use it to package
|
|
|
|
- script: |
|
2024-10-01 18:02:55 +03:00
|
|
|
npm install -g @vscode/vsce
|
2024-10-18 09:29:23 +03:00
|
|
|
displayName: Install VSCE
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
npx @vscode/vsce package -o extension.vsix
|
2018-11-16 16:53:08 +03:00
|
|
|
displayName: Create VSIX
|
|
|
|
|
2024-10-18 09:29:23 +03:00
|
|
|
- script: |
|
|
|
|
npx @vscode/vsce generate-manifest -i extension.vsix -o extension.manifest
|
|
|
|
displayName: Create VSIX Manifest
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
cp extension.manifest 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.SourcesDirectory)'
|
|
|
|
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
|
|
|
|
|
2018-11-16 16:53:08 +03:00
|
|
|
- script: |
|
|
|
|
npm run vscode:prepublish
|
|
|
|
cat /home/vsts/.npm/_logs/*.log
|
|
|
|
displayName: Echo npm error logs on failure
|
|
|
|
condition: failed()
|
|
|
|
|
|
|
|
# For releasable builds, we'll want the branch and the changelog
|
|
|
|
# Expects that a 'version.txt' has been laid down by a previous step
|
|
|
|
- bash: |
|
2018-11-16 17:22:46 +03:00
|
|
|
echo $(Build.SourceBranch) | sed "s|refs/[^/]*/||" > branch.txt
|
2018-11-16 16:53:08 +03:00
|
|
|
PACKAGE_VERSION=$(cat version.txt)
|
|
|
|
VERSION_REGEX="## $(echo $PACKAGE_VERSION | sed 's/\./\\./g')"
|
|
|
|
sed -n "/$VERSION_REGEX/,/## 1\..*/p" CHANGELOG.md | head -n -2 > minichangelog.txt
|
|
|
|
displayName: Get branch and mini-changelog
|
|
|
|
|
|
|
|
# Choose files to publish
|
|
|
|
- task: CopyFiles@2
|
|
|
|
displayName: Stage VSIX for publishing
|
|
|
|
inputs:
|
|
|
|
contents: |-
|
2024-10-18 09:29:23 +03:00
|
|
|
extension.vsix
|
2018-11-16 16:53:08 +03:00
|
|
|
version.txt
|
|
|
|
branch.txt
|
|
|
|
minichangelog.txt
|
2024-10-18 09:29:23 +03:00
|
|
|
extension.signature.p7s
|
|
|
|
extension.manifest
|
2018-11-16 16:53:08 +03:00
|
|
|
targetFolder: $(Build.ArtifactStagingDirectory)
|