vscode-dotnet-runtime/azure-pipelines.yml

153 строки
4.7 KiB
YAML
Исходник Обычный вид История

2019-11-09 01:30:11 +03:00
trigger:
batch: true
2019-11-09 01:30:11 +03:00
branches:
include:
2021-03-17 00:06:33 +03:00
- main
tags:
include:
2021-02-18 21:35:49 +03:00
- SDK-v*
- Runtime-v*
2019-11-09 01:30:11 +03:00
pr:
autoCancel: false
branches:
include:
- '*'
2019-11-09 01:30:11 +03:00
variables:
- name: is-runtime-release
value: $[startsWith(variables['Build.SourceBranch'], 'refs/tags/Runtime-v')]
- name: is-sdk-release
value: $[startsWith(variables['Build.SourceBranch'], 'refs/tags/SDK-v')]
- name: Codeql.Enabled
value: true
stages:
##### Test and Build #####
- stage: Build
jobs:
##### Build #####
- job: Build
displayName: 'Build and Test'
pool:
vmImage: $(imageName)
strategy:
matrix:
Linux:
imageName: 'ubuntu-latest'
Mac:
imageName: 'macOS-latest'
Windows:
imageName: 'windows-latest'
steps:
- task: NodeTool@0
inputs:
versionSpec: '16.10.0'
displayName: 'Install Node.js'
- script: build.cmd
displayName: Build Windows
condition: eq(variables['Agent.OS'], 'Windows_NT')
- script: test.cmd
displayName: Test Windows
condition: eq(variables['Agent.OS'], 'Windows_NT')
- bash: |
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
echo ">>> Started xvfb"
displayName: Start xvfb
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- script: ./build.sh
displayName: Build Mac and Linux
condition: or(eq(variables['Agent.OS'], 'Darwin'), eq(variables['Agent.OS'], 'Linux'))
- script: ./test.sh
displayName: Test Mac and Linux
env: { DISPLAY: ':99.0' }
condition: or(eq(variables['Agent.OS'], 'Darwin'), eq(variables['Agent.OS'], 'Linux'))
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.SourcesDirectory)/vscode-dotnet-runtime-extension/dist/test/functional/logs'
artifactName: 'logs'
displayName: Publish Logs
condition: always()
##### TSLint #####
2019-12-09 20:27:55 +03:00
- job: TSLint
displayName: 'TSLint'
pool:
vmImage: 'windows-latest'
2019-12-09 20:27:55 +03:00
steps:
- task: NodeTool@0
inputs:
versionSpec: '16.10.0'
displayName: 'Install Node.js'
- bash: |
2022-10-14 22:03:08 +03:00
npm install --cache /temp/empty-cache
2022-10-21 01:15:30 +03:00
npm install tslint --reg https://registry.npmjs.org/ --verbose
npm run lint
displayName: Run Lint
2022-10-06 19:59:38 +03:00
##### Verify NPM and Yarn are in sync #####
- job: SyncPackageManagers
displayName: 'Verify NPM & Yarn In-Sync [Local Copy of Target Branch Must Be Up to Date]'
2022-10-06 19:59:38 +03:00
pool:
vmImage: 'windows-latest'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
addToPath: true
architecture: 'x64'
- task: PythonScript@0
continueOnError: true
2022-10-06 19:59:38 +03:00
inputs:
scriptSource: 'filePath'
scriptPath: 'dependency-verifier.py'
2022-10-06 20:59:20 +03:00
arguments: '$(System.PullRequest.TargetBranch)'
##### Package and Publish #####
- job: Package
displayName: 'Package and Publish'
dependsOn:
- Build
- TSLint
condition: succeeded()
pool:
vmImage: 'windows-latest'
strategy:
matrix:
Runtime:
dir-name: 'vscode-dotnet-runtime-extension'
package-name: 'vscode-dotnet-runtime'
SDK:
dir-name: 'vscode-dotnet-sdk-extension'
package-name: 'vscode-dotnet-sdk'
steps:
- task: NodeTool@0
inputs:
versionSpec: '16.10.0'
displayName: 'Install Node.js'
- bash: |
if ([ $(is-sdk-release) = 'True' ] && [ $(package-name) = 'vscode-dotnet-sdk' ]) || ([ $(is-runtime-release) = 'True' ] && [ $(package-name) = 'vscode-dotnet-runtime' ]); then
VERSION=`node -p "require('./package.json').version"`
else
VERSION_NUM=`node -p "require('./package.json').version"`
VERSION="$VERSION_NUM-alpha-$(Build.BuildId)"
fi
npm version $VERSION --allow-same-version
echo "##vso[task.setvariable variable=version;isOutput=true]$VERSION"
name: GetVersion
displayName: 'Get Version'
workingDirectory: $(dir-name)
- bash: |
2022-10-14 00:53:09 +03:00
npm install rimraf --reg https://registry.npmjs.org/ --verbose
npm install vsce -g --reg https://registry.npmjs.org/ --verbose
vsce package -o $(package-name)-$(GetVersion.version).vsix --ignoreFile ../.vscodeignore --yarn
displayName: Package Artifact
workingDirectory: $(dir-name)
- task: CopyFiles@2
displayName: 'Copy Artifact'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: '**\*.vsix'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
flattenFolders: true
- task: PublishPipelineArtifact@0
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifactName: '$(dir-name)'