94 строки
3.5 KiB
YAML
94 строки
3.5 KiB
YAML
parameters:
|
|
pool: ''
|
|
SignType: ''
|
|
|
|
jobs:
|
|
- job: ${{ parameters.pool.os }}_Package
|
|
pool:
|
|
${{ if eq(parameters.useOneEngineeringPool, 'true') }}:
|
|
${{ parameters.pool }}
|
|
${{ else }}:
|
|
vmImage: ${{ parameters.pool.vmImage }}
|
|
displayName: '📦 Package and Publish'
|
|
dependsOn:
|
|
- ${{ parameters.pool.os }}_Build
|
|
- TSLint
|
|
condition: and(succeeded(), eq('${{ parameters.useOneEngineeringPool }}', 'true'))
|
|
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'
|
|
templateContext:
|
|
outputs:
|
|
- output: pipelineArtifact
|
|
displayName: '📂 Publish .VSIX'
|
|
targetPath: '$(Build.ArtifactStagingDirectory)'
|
|
artifactName: '$(dir-name)'
|
|
steps:
|
|
- template: install-node.yaml
|
|
- 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"
|
|
fi
|
|
npm version $VERSION --allow-same-version
|
|
echo "##vso[task.setvariable variable=version;isOutput=true]$VERSION"
|
|
name: GetVersion
|
|
displayName: '❓ Get Version'
|
|
workingDirectory: $(dir-name)
|
|
- task: UseDotNet@2
|
|
displayName: 🔮 Use .NET SDK
|
|
inputs:
|
|
packageType: sdk
|
|
useGlobalJson: true
|
|
# This is necessary whenever we want to publish/restore to an AzDO private feed
|
|
# otherwise it'll complain about accessing a private feed.
|
|
- task: NuGetAuthenticate@1
|
|
displayName: '🔏 Authenticate to AzDO Feeds'
|
|
- task: MicroBuildSigningPlugin@4
|
|
displayName: 🔧 Install MicroBuild Signing Plugin
|
|
inputs:
|
|
signType: ${{ parameters.SignType }}
|
|
zipSources: false
|
|
feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json
|
|
env:
|
|
SignType: ${{ parameters.SignType }}
|
|
TeamName: DotNetCore
|
|
- bash: |
|
|
npm install rimraf --reg https://registry.npmjs.org/ --verbose
|
|
npm install @vscode/vsce@latest -g --reg https://registry.npmjs.org/ --verbose
|
|
vsce package -o $(package-name)-$(GetVersion.version).vsix --ignoreFile ../.vscodeignore --yarn
|
|
cp $(package-name)-$(GetVersion.version).vsix ../packages/$(package-name)-$(GetVersion.version).vsix
|
|
displayName: 📦 Package Artifact
|
|
workingDirectory: $(dir-name)
|
|
env:
|
|
SignType: ${{ parameters.SignType }}
|
|
- script: dotnet build msbuild/signVsix -v:normal
|
|
displayName: 🖊️ Sign VSIXes
|
|
env:
|
|
SignType: ${{ parameters.SignType }}
|
|
- task: CmdLine@2
|
|
displayName: 🤌 Rename Signed VSIX
|
|
|
|
inputs:
|
|
script: rename ".\packages\$(package-name)-$(GetVersion.version).vsix" $(package-name)-$(GetVersion.version)-signed.vsix
|
|
- task: CopyFiles@2
|
|
displayName: '📩 Copy Artifact'
|
|
inputs:
|
|
SourceFolder: '$(Build.SourcesDirectory)'
|
|
Contents: '**\*.vsix'
|
|
TargetFolder: '$(Build.ArtifactStagingDirectory)'
|
|
flattenFolders: true
|
|
- task: CopyFiles@2
|
|
displayName: '🏗️ Copy Binlog'
|
|
inputs:
|
|
SourceFolder: '$(Build.SourcesDirectory)'
|
|
Contents: '**\*.binlog'
|
|
TargetFolder: '$(Build.ArtifactStagingDirectory)'
|
|
flattenFolders: false |