azure-pipelines-vscode/.azure-pipelines/common-steps.yml

107 строки
2.8 KiB
YAML
Исходник Постоянная ссылка Обычный вид История

2018-11-16 16:53:08 +03:00
# Common steps template
#
# Things which happen regardless of CI, PR, or release builds
steps:
- task: NodeTool@0
displayName: Install Node 16 LTS or greater
inputs:
versionSpec: ">=16.13.0"
- task: NpmAuthenticate@0
inputs:
workingFile: .npmrc
- 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
- script: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
displayName: Start xvfb
- script: npm run test
displayName: Run tests
env:
DISPLAY: ':99.0'
- script: npm run lint
displayName: Lint
2018-11-16 16:53:08 +03:00
# Acquire the `vsce` tool and use it to package
- script: |
npm install -g @vscode/vsce
displayName: Install VSCE
- script: |
npx @vscode/vsce package -o extension.vsix
2018-11-16 16:53:08 +03:00
displayName: Create VSIX
- 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: |-
extension.vsix
2018-11-16 16:53:08 +03:00
version.txt
branch.txt
minichangelog.txt
extension.signature.p7s
extension.manifest
2018-11-16 16:53:08 +03:00
targetFolder: $(Build.ArtifactStagingDirectory)