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

70 строки
1.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"
- 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: npm run unittest
displayName: Run unit tests
- script: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
displayName: Start xvfb
- script: npm run test
displayName: Run integration tests
env:
DISPLAY: ':99.0'
2018-11-16 16:53:08 +03:00
# Acquire the `vsce` tool and use it to package
- script: |
npm install -g vsce
2021-01-21 16:44:02 +03:00
vsce package --githubBranch main
2018-11-16 16:53:08 +03:00
displayName: Create VSIX
- 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: |-
*.vsix
version.txt
branch.txt
minichangelog.txt
targetFolder: $(Build.ArtifactStagingDirectory)
# Publish files as an artifact
- task: PublishPipelineArtifact@1
2018-11-16 16:53:08 +03:00
displayName: Publish VSIX
inputs:
artifact: azure-pipelines-vscode
targetPath: $(Build.ArtifactStagingDirectory)