2019-11-09 01:30:11 +03:00
|
|
|
trigger:
|
2019-11-12 23:05:49 +03:00
|
|
|
batch: true
|
2019-11-09 01:30:11 +03:00
|
|
|
branches:
|
2019-11-12 23:05:49 +03:00
|
|
|
include:
|
2021-03-17 00:06:33 +03:00
|
|
|
- main
|
2019-12-17 20:02:28 +03:00
|
|
|
tags:
|
|
|
|
include:
|
2021-02-18 21:35:49 +03:00
|
|
|
- SDK-v*
|
|
|
|
- Runtime-v*
|
2019-11-09 01:30:11 +03:00
|
|
|
pr:
|
2019-11-12 23:05:49 +03:00
|
|
|
autoCancel: false
|
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- '*'
|
2019-11-09 01:30:11 +03:00
|
|
|
|
2019-12-17 20:02:28 +03:00
|
|
|
variables:
|
2022-11-04 01:42:41 +03:00
|
|
|
- name: is-runtime-release
|
2022-11-04 19:36:57 +03:00
|
|
|
value: $[startsWith(variables['Build.SourceBranch'], 'refs/tags/Runtime-v')]
|
2022-11-04 01:42:41 +03:00
|
|
|
- name: is-sdk-release
|
2022-11-04 19:36:57 +03:00
|
|
|
value: $[startsWith(variables['Build.SourceBranch'], 'refs/tags/SDK-v')]
|
2022-11-04 01:42:41 +03:00
|
|
|
- name: Codeql.Enabled
|
2022-11-04 19:36:57 +03:00
|
|
|
value: true
|
2019-12-17 20:02:28 +03:00
|
|
|
|
2019-12-20 21:24:41 +03:00
|
|
|
stages:
|
|
|
|
##### Test and Build #####
|
2022-08-26 21:56:28 +03:00
|
|
|
- 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:
|
2023-08-29 01:14:16 +03:00
|
|
|
versionSpec: '16.10.0'
|
2022-08-26 21:56:28 +03:00
|
|
|
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()
|
2019-12-20 21:24:41 +03:00
|
|
|
##### TSLint #####
|
2019-12-09 20:27:55 +03:00
|
|
|
- job: TSLint
|
|
|
|
displayName: 'TSLint'
|
|
|
|
pool:
|
2022-06-29 19:26:21 +03:00
|
|
|
vmImage: 'windows-latest'
|
2019-12-09 20:27:55 +03:00
|
|
|
steps:
|
2022-08-26 20:58:54 +03:00
|
|
|
- task: NodeTool@0
|
2022-07-14 21:20:17 +03:00
|
|
|
inputs:
|
2023-08-29 01:14:16 +03:00
|
|
|
versionSpec: '16.10.0'
|
2022-08-26 20:58:54 +03:00
|
|
|
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
|
2022-08-26 20:58:54 +03:00
|
|
|
npm run lint
|
|
|
|
displayName: Run Lint
|
2022-10-06 19:59:38 +03:00
|
|
|
##### Verify NPM and Yarn are in sync #####
|
|
|
|
- job: SyncPackageManagers
|
2022-10-07 01:10:31 +03:00
|
|
|
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
|
2023-09-20 23:58:41 +03:00
|
|
|
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)'
|
2019-12-20 21:24:41 +03:00
|
|
|
##### Package and Publish #####
|
2022-08-26 21:56:28 +03:00
|
|
|
- job: Package
|
|
|
|
displayName: 'Package and Publish'
|
2023-08-29 01:14:16 +03:00
|
|
|
dependsOn:
|
2022-08-26 21:56:28 +03:00
|
|
|
- Build
|
|
|
|
- TSLint
|
2022-09-16 21:58:22 +03:00
|
|
|
condition: succeeded()
|
2022-08-26 21:56:28 +03:00
|
|
|
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:
|
2023-08-29 01:14:16 +03:00
|
|
|
versionSpec: '16.10.0'
|
2022-08-26 21:56:28 +03:00
|
|
|
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
|
2022-08-26 21:56:28 +03:00
|
|
|
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)'
|