wslg/azure-pipelines.yml

414 строки
14 KiB
YAML

resources:
repositories:
- repository: FreeRDP
type: github
endpoint: GitHub connection 1
name: microsoft/FreeRDP-mirror
ref: working
- repository: weston
type: github
endpoint: GitHub connection 1
name: microsoft/weston-mirror
ref: working
- repository: pulseaudio
type: github
endpoint: GitHub connection 1
name: microsoft/pulseaudio-mirror
ref: working
trigger:
- main
stages:
- stage: Build_SystemDistro
displayName: "Build System Distro (x64 and ARM64)"
jobs:
- job: 'Build_Ubuntu_x64'
displayName: 'Build x64 system distro'
timeoutInMinutes: 200
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: FreeRDP
- checkout: weston
- checkout: pulseaudio
- checkout: self
- template: devops/common-linux.yml
- script: wget https://cblmarinerstorage.blob.core.windows.net/sources/core/mesa-23.1.0.tar.xz &&
tar -xvf mesa-23.1.0.tar.xz
displayName: 'Download Mesa from CBL Mariner'
- script: wget https://github.com/microsoft/DirectX-Headers/archive/refs/tags/v1.608.0.tar.gz &&
tar -xvf v1.608.0.tar.gz
displayName: 'Download DirectX-Headers from GitHub'
- script: mv FreeRDP-mirror/ wslg/vendor/FreeRDP &&
mv weston-mirror/ wslg/vendor/weston &&
mv pulseaudio-mirror/ wslg/vendor/pulseaudio &&
mv mesa-23.1.0/ wslg/vendor/mesa &&
mv DirectX-Headers-1.608.0/ wslg/vendor/DirectX-Headers-1.0
displayName: 'Move sub projects (FreeRDP, Weston, PulseAudio, Mesa, DirectX-Headers)'
- script: docker build -f ./wslg/Dockerfile -t system-distro-x64
./wslg
--build-arg WSLG_VERSION=`gitversion /targetpath ./wslg /showvariable InformationalVersion`
--build-arg WSLG_ARCH=x86_64
displayName: 'Create System Distro Docker image Mariner-x64'
- script: docker export `docker create system-distro-x64` > $(Agent.BuildDirectory)/system_x64.tar
displayName: 'Create system_x64.tar'
- script: docker build -f ./wslg/Dockerfile -t system-distro-dev-x64
./wslg
--build-arg WSLG_VERSION=`gitversion /targetpath ./wslg /showvariable InformationalVersion`
--build-arg WSLG_ARCH=x86_64
--target dev
displayName: 'Create System Distro Dev Docker image Mariner-x64'
- script: docker cp `docker create system-distro-dev-x64 /bin/bash`:/work/debuginfo/system-debuginfo.tar.gz $(Agent.BuildDirectory)/system-debuginfo_x64.tar.gz
displayName: 'Copy system-debuginfo_x64.tar.gz'
- task: Go@0
inputs:
command: 'custom'
customCommand: 'run'
arguments: 'tar2ext4.go -vhd -i $(Agent.BuildDirectory)/system_x64.tar -o $(Agent.BuildDirectory)/system_x64.vhd'
workingDirectory: 'hcsshim/cmd/tar2ext4'
displayName: 'Create system_x64.vhd'
- task: PublishPipelineArtifact@1
displayName: 'Publish system_x64.vhd artifact'
inputs:
targetPath: $(Agent.BuildDirectory)/system_x64.vhd
artifact: 'system_x64.vhd'
publishLocation: 'pipeline'
- task: PublishPipelineArtifact@1
displayName: 'Publish system-debuginfo_x64.tar.gz artifact'
inputs:
targetPath: $(Agent.BuildDirectory)/system-debuginfo_x64.tar.gz
artifact: 'system-debuginfo_x64.tar.gz'
publishLocation: 'pipeline'
- job: 'Build_Windows_x64'
dependsOn: 'Build_Ubuntu_x64'
displayName: 'Build WSLDCV (x64) Plugin'
pool:
vmImage: 'windows-2019'
demands:
- msbuild
- visualstudio
steps:
- checkout: self
- template: devops/common-win.yml
- task: PowerShell@2
displayName: 'Update WSLDVCPlugin version'
inputs:
targetType: filePath
workingDirectory: './WSLDVCPlugin'
filePath: .\WSLDVCPlugin\UpdateRCVersion.ps1
pwsh: true
- task: MSBuild@1
displayName: 'Build RDP Plugin (x64)'
inputs:
solution: './WSLDVCPlugin/WSLDVCPlugin.sln'
platform: 'x64'
configuration: 'Release'
- task: PublishSymbols@2
displayName: Publish symbols
inputs:
SymbolServerType: 'TeamServices'
TreatNotIndexedAsWarning: true
SymbolsProduct: wslg
SearchPattern: |
WSLDVCPlugin/x64/Release/*.pdb
WSLDVCPlugin/x64/Release/*.dll
- script: 'MOVE WSLDVCPlugin\x64\Release\WSLDVCPlugin.pdb package\WSLDVCPlugin_x64.pdb'
displayName: 'Move plugin PDB to package (x64)'
- task: PublishPipelineArtifact@1
displayName: 'Publish WSLDVCPlugin PDB (x64)'
inputs:
targetPath: package\WSLDVCPlugin_x64.pdb
artifact: 'WSLDVCPlugin.x64.pdb'
publishLocation: 'pipeline'
- script: 'MOVE WSLDVCPlugin\x64\Release\WSLDVCPlugin.dll package\WSLDVCPlugin_x64.dll'
displayName: 'Move plugin DLL to package (x64)'
- task: PublishPipelineArtifact@1
displayName: 'Publish WSLDVCPlugin DLL (x64)'
inputs:
targetPath: package\WSLDVCPlugin_x64.dll
artifact: 'WSLDVCPlugin.x64.dll'
publishLocation: 'pipeline'
- job: 'Build_Ubuntu_ARM64'
displayName: 'Build ARM64 system distro'
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
timeoutInMinutes: 200
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: FreeRDP
- checkout: weston
- checkout: pulseaudio
- checkout: self
- template: devops/common-linux.yml
- bash: |
curl -L -o ~/.docker/cli-plugins/docker-buildx --create-dirs ${BUILDX_URL}
chmod a+x ~/.docker/cli-plugins/docker-buildx
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
~/.docker/cli-plugins/docker-buildx create --use
~/.docker/cli-plugins/docker-buildx inspect --bootstrap
displayName: Prepare buildx
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
env:
BUILDX_URL: https://github.com/docker/buildx/releases/download/v0.5.1/buildx-v0.5.1.linux-amd64
- script: |
echo '{ "experimental": true }' | sudo tee /etc/docker/daemon.json
sudo service docker restart
displayName: 'Enable Docker Engine experimental '
- script: wget https://cblmarinerstorage.blob.core.windows.net/sources/core/mesa-23.1.0.tar.xz &&
tar -xvf mesa-23.1.0.tar.xz
displayName: 'Download Mesa from CBL Mariner'
- script: wget https://github.com/microsoft/DirectX-Headers/archive/refs/tags/v1.608.0.tar.gz &&
tar -xvf v1.608.0.tar.gz
displayName: 'Download DirectX-Headers from GitHub'
- script: mv FreeRDP-mirror/ wslg/vendor/FreeRDP &&
mv weston-mirror/ wslg/vendor/weston &&
mv pulseaudio-mirror/ wslg/vendor/pulseaudio &&
mv mesa-23.1.0/ wslg/vendor/mesa &&
mv DirectX-Headers-1.608.0/ wslg/vendor/DirectX-Headers-1.0
displayName: 'Move sub projects (FreeRDP, Weston, PulseAudio, Mesa, DirectX-Headers)'
- script: ~/.docker/cli-plugins/docker-buildx build -f ./wslg/Dockerfile
--output type=tar,dest=$(Agent.BuildDirectory)/system_arm64.tar
--platform=linux/arm64
./wslg
--build-arg WSLG_VERSION=`gitversion /targetpath ./wslg /showvariable InformationalVersion`
--build-arg WSLG_ARCH=aarch64
displayName: 'Create system_arm64.tar'
- task: Go@0
inputs:
command: 'custom'
customCommand: 'run'
arguments: 'tar2ext4.go -vhd -i $(Agent.BuildDirectory)/system_arm64.tar -o $(Agent.BuildDirectory)/system_arm64.vhd'
workingDirectory: 'hcsshim/cmd/tar2ext4'
displayName: 'Create system_arm64.vhd'
- task: PublishPipelineArtifact@1
displayName: 'Publish system_arm64.vhd artifact'
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
inputs:
targetPath: $(Agent.BuildDirectory)/system_arm64.vhd
artifact: 'system_arm64.vhd'
publishLocation: 'pipeline'
- script: mkdir ./dev &&
~/.docker/cli-plugins/docker-buildx build -f ./wslg/Dockerfile
--output type=tar,dest=./dev/dev_build.tar
--target=dev
--platform=linux/arm64
./wslg
--build-arg WSLG_VERSION=`gitversion /targetpath ./wslg /showvariable InformationalVersion`
--build-arg WSLG_ARCH=aarch64 &&
tar -xvf ./dev/dev_build.tar -C ./dev/ &&
mv ./dev/work/debuginfo/system-debuginfo.tar.gz $(Agent.BuildDirectory)/system-debuginfo_arm64.tar.gz
displayName: 'Copy system-debuginfo_arm64.tar.gz'
- task: PublishPipelineArtifact@1
displayName: 'Publish system-debuginfo_arm64.tar.gz artifact'
inputs:
targetPath: $(Agent.BuildDirectory)/system-debuginfo_arm64.tar.gz
artifact: 'system-debuginfo_arm64.tar.gz'
publishLocation: 'pipeline'
- job: 'Build_Windows_ARM64'
dependsOn: 'Build_Ubuntu_ARM64'
displayName: 'Build WSLDCV (ARM64) Plugin'
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
pool:
vmImage: 'windows-2019'
demands:
- msbuild
- visualstudio
steps:
- checkout: self
- template: devops/common-win.yml
- task: PowerShell@2
displayName: 'Update WSLDVCPlugin version'
inputs:
targetType: filePath
workingDirectory: './WSLDVCPlugin'
filePath: .\WSLDVCPlugin\UpdateRCVersion.ps1
pwsh: true
- task: MSBuild@1
displayName: 'Build RDP Plugin (ARM64)'
inputs:
solution: './WSLDVCPlugin/WSLDVCPlugin.sln'
platform: 'ARM64'
configuration: 'Release'
- task: PublishSymbols@2
displayName: Publish symbols
inputs:
SymbolServerType: 'TeamServices'
TreatNotIndexedAsWarning: true
SymbolsProduct: wslg
SearchPattern: |
WSLDVCPlugin/arm64/Release/*.pdb
WSLDVCPlugin/arm64/Release/*.dll
- script: 'MOVE WSLDVCPlugin\ARM64\Release\WSLDVCPlugin.pdb package\WSLDVCPlugin_ARM64.pdb'
displayName: 'Move plugin PDB to package (ARM64)'
- task: PublishPipelineArtifact@1
displayName: 'Publish WSLDVCPlugin PDB (ARM64)'
inputs:
targetPath: package\WSLDVCPlugin_ARM64.pdb
artifact: 'WSLDVCPlugin.ARM64.pdb'
publishLocation: 'pipeline'
- script: 'MOVE WSLDVCPlugin\ARM64\Release\WSLDVCPlugin.dll package\WSLDVCPlugin_ARM64.dll'
displayName: 'Move plugin to package (ARM64)'
- task: PublishPipelineArtifact@1
displayName: 'Publish WSLDVCPlugin DLL (ARM64)'
inputs:
targetPath: package\WSLDVCPlugin_ARM64.dll
artifact: 'WSLDVCPlugin.ARM64.dll'
publishLocation: 'pipeline'
- stage: PublishPackage
displayName: "Publish WSLg NuGet Package"
jobs:
- job: 'Publish_UniversalPackage'
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
displayName: 'Download artifact and push NuGet package'
pool:
vmImage: 'windows-2019'
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download system_x64.vhd'
inputs:
buildType: 'current'
artifactName: 'system_x64.vhd'
targetPath: 'package/'
- task: DownloadPipelineArtifact@2
displayName: 'Download system-debuginfo_x64.tar.gz'
inputs:
buildType: 'current'
artifactName: 'system-debuginfo_x64.tar.gz'
targetPath: 'package/'
- task: DownloadPipelineArtifact@2
displayName: 'Download WSLDVCPlugin DLL (x64)'
inputs:
buildType: 'current'
artifactName: 'WSLDVCPlugin.x64.dll'
targetPath: 'package/'
- task: DownloadPipelineArtifact@2
displayName: 'Download WSLDVCPlugin PDB (x64)'
inputs:
buildType: 'current'
artifactName: 'WSLDVCPlugin.x64.pdb'
targetPath: 'package/'
- task: DownloadPipelineArtifact@2
displayName: 'Download system_arm64.vhd'
inputs:
buildType: 'current'
artifactName: 'system_arm64.vhd'
targetPath: 'package/'
- task: DownloadPipelineArtifact@2
displayName: 'Download system-debuginfo_arm64.tar.gz'
inputs:
buildType: 'current'
artifactName: 'system-debuginfo_arm64.tar.gz'
targetPath: 'package/'
- task: DownloadPipelineArtifact@2
displayName: 'Download WSLDVCPlugin DLL (ARM64)'
inputs:
buildType: 'current'
artifactName: 'WSLDVCPlugin.ARM64.dll'
targetPath: 'package/'
- task: DownloadPipelineArtifact@2
displayName: 'Download WSLDVCPlugin PDB (ARM64)'
inputs:
buildType: 'current'
artifactName: 'WSLDVCPlugin.ARM64.pdb'
targetPath: 'package/'
- task: PowerShell@2
displayName: 'Update Microsoft.WSLg.nuspec version'
inputs:
targetType: filePath
filePath: .\devops\updateversion.ps1
arguments: .\Microsoft.WSLg.nuspec "package.metadata.version" "" "-beta"
pwsh: true
- task: PowerShell@2
displayName: 'Update Microsoft.WSLg.nuspec release notes'
inputs:
targetType: filePath
filePath: .\devops\updateversion.ps1
arguments: .\Microsoft.WSLg.nuspec "package.metadata.releaseNotes" "" "-beta" "hash"
pwsh: true
- script: 'nuget pack .\Microsoft.WSLg.nuspec'
displayName: 'Package NuGet'
- script: 'rename *.nupkg Microsoft.WSLg.nupkg'
displayName: 'Rename Nuget Package'
- task: PublishPipelineArtifact@1
displayName: 'Save Microsoft.WSLg.nupkg artifact'
inputs:
targetPath: Microsoft.WSLg.nupkg
artifact: 'Microsoft.WSLg.nupkg'
publishLocation: 'pipeline'
- task: '333b11bd-d341-40d9-afcf-b32d5ce6f23b@2'
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
inputs:
command: 'push'
packagesToPush: 'Microsoft.WSLg.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: 'wsl'
allowPackageConflicts: true
verbosityPush: 'Normal'