74 строки
2.4 KiB
YAML
74 строки
2.4 KiB
YAML
# CI and PR build script
|
|
#
|
|
# There should be no deep magic here. The developer experience and CI experience
|
|
# must remain as close to one another as possible.
|
|
#
|
|
# Developer experience:
|
|
# npm install
|
|
# (make changes)
|
|
# npm test
|
|
# vsce package
|
|
# (give VSIX to someone for buddy testing)
|
|
|
|
# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool.
|
|
# This pipeline will be extended to the OneESPT template
|
|
trigger:
|
|
- main
|
|
|
|
# no `pr` keyword because we want all PRs to run this
|
|
resources:
|
|
repositories:
|
|
- repository: 1ESPipelineTemplates
|
|
type: git
|
|
name: 1ESPipelineTemplates/1ESPipelineTemplates
|
|
ref: refs/tags/release
|
|
extends:
|
|
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
|
|
parameters:
|
|
settings:
|
|
skipBuildTagsForGitHubPullRequests: true
|
|
# featureFlags:
|
|
# autoBaseline: false
|
|
sdl:
|
|
baseline:
|
|
baselineSet: default
|
|
baselineFile: $(Build.SourcesDirectory)/.gdn/.gdnbaselines
|
|
sourceAnalysisPool:
|
|
name: 1ES-ABTT-Shared-Pool
|
|
image: abtt-windows-2022
|
|
os: windows
|
|
pool:
|
|
name: 1ES-ABTT-Shared-Pool
|
|
image: abtt-ubuntu-2204
|
|
os: linux
|
|
customBuildTags:
|
|
- ES365AIMigrationTooling
|
|
stages:
|
|
- stage: stage
|
|
jobs:
|
|
- job: job
|
|
templateContext:
|
|
outputs:
|
|
- output: pipelineArtifact
|
|
displayName: 'Publish VSIX'
|
|
artifactName: azure-pipelines-vscode
|
|
targetPath: $(Build.ArtifactStagingDirectory)
|
|
steps:
|
|
# for convenience, we tag CI-produced packages with a version number
|
|
# pointing to the commit which was built. for PRs, also include the PR #.
|
|
- bash: |
|
|
PACKAGE_VERSION=$(node -p "require('./package.json').version")
|
|
|
|
if [ -n "$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" ]; then
|
|
VERSION_STRING=${PACKAGE_VERSION}-pr-${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}-$(git rev-parse --short HEAD)
|
|
else
|
|
VERSION_STRING=${PACKAGE_VERSION}-ci-$(git rev-parse --short HEAD)
|
|
fi
|
|
|
|
npm --no-git-tag-version version $VERSION_STRING
|
|
echo "##vso[build.updatebuildnumber]${VERSION_STRING}_${BUILD_BUILDID}"
|
|
echo "$PACKAGE_VERSION" > version.txt
|
|
displayName: Set version number of package and build
|
|
|
|
- template: /.azure-pipelines/common-steps.yml@self
|