Files
DevOpsExamples/azure-pipelines.yml
Lance McCarthy 82e0ef17e9
ASP.NET AJAX / build_web_app (push) Waiting to run
Angular / build_angular (push) Waiting to run
ASP.NET Core (with Reporting) / build_windows (push) Waiting to run
Blazor (with Reporting) / build_windows (push) Waiting to run
Blazor (with Reporting) / build_linux (push) Waiting to run
Console (.NET) / build_console (arm64, linux) (push) Waiting to run
Console (.NET) / build_console (arm64, win) (push) Waiting to run
Console (.NET) / build_console (x64, linux) (push) Waiting to run
Console (.NET) / build_console (x64, win) (push) Waiting to run
MAUI / Windows Smoketest (push) Waiting to run
MAUI / Android Smoketest (push) Waiting to run
MAUI / iOS Smoketest (push) Waiting to run
MAUI / MacCatalyst Smoketest (push) Waiting to run
WinForms (.NET Framework) / build_desktop (Release, x64) (push) Waiting to run
WinForms (.NET Framework) / build_desktop (Release, x86) (push) Waiting to run
WinUI3 / build-windows (push) Waiting to run
WPF (.NET Framework) / build_desktop (Release, x64) (push) Waiting to run
WPF (.NET Framework) / build_desktop (Release, x86) (push) Waiting to run
ASP.NET Core (with Reporting) - Docker / Microsoft Base - Publish to Docker Hub (push) Waiting to run
ASP.NET Core (with Reporting) - Docker / CentOS Base - Publish to Docker Hub (push) Waiting to run
Blazor (with Reporting) - Docker / Dockerfile Build and Publish (push) Waiting to run
First push
2026-05-21 15:10:03 -04:00

407 lines
16 KiB
YAML

trigger:
branches:
include:
- main
paths:
include:
- 'azure-pipelines.yml'
- 'src/Kendo/angular_demo/**/*'
- 'src/Console/**/*'
- 'src/Ajax/**/*'
- 'src/Blazor/**/*'
- 'src/AspNetCore/**/*'
- 'src/WinUI/**/*'
- 'src/MAUI/**/*'
- 'src/Wpf/**/*'
variables:
DOTNET_SDK_VERSION: '10.0.x'
buildConfiguration: 'Release'
nugetConfigPath: 'src/NuGet.Config'
consoleProjectPath: 'src/Console/MyDocProcApp/MyDocProcApp.csproj'
ajaxProjectPath: 'src/Ajax/MySite.sln'
blazorProjectPath: 'src/Blazor/MyBlazorApp.sln'
aspnetProjectPath: 'src/AspNetCore/MyAspNetCoreApp.sln'
winuiProjectPath: 'src/WinUI/MyDemo.sln'
mauiProjectPath: 'src/MAUI/MauiDemo.csproj'
wpfProjectPath: 'src/Wpf/MyWpfApp/MyWpfApp.csproj'
# These pipeline variables (secrets) have been set using the AzDO yaml editor at dev.azure.com.
# AKEYLESS_ACCESS_ID
# MY_TELERIK_NUGET_KEY
# MY_TELERIK_LICENSE_KEY
jobs:
# *************************************************************** #
# * KENDO ANGULAR (env var) * #
# *************************************************************** #
- job: BuildAngularAppWithVariables
pool:
vmImage: 'ubuntu-latest'
steps:
- powershell: |
# 1. Clean the angular cache, to avoid using any expired keys
rm -rf .angular/cache
# 2. Install your project dependencies
npm install
# npm install --save @progress/kendo-licensing; # if missing from package.json
#3. Activate
npx kendo-ui-license activate
#4. Build the project
npm run build
workingDirectory: "src/Kendo/angular_demo"
displayName: "Install Dependencies and Activate Kendo"
env:
# AzDO pipeline secret variable. Note: YAML variable editor supports 14k string values, classic pipelines do not!
TELERIK_LICENSE: $(MY_TELERIK_LICENSE_KEY)
# *************************************************************** #
# * KENDO ANGULAR (secure file) * #
# *************************************************************** #
- job: BuildAngularAppWithSecureFile
pool:
vmImage: 'ubuntu-latest'
steps:
# Download the license key file (this MUST have a 'name' so it can be referenced later).
- task: DownloadSecureFile@1
name: GetLicenseFileTask
displayName: 'Download SecureFile'
inputs:
secureFile: 'telerik-license.txt'
- powershell: |
# 1. Clean the angular cache, to avoid using any expired keys
rm -rf .angular/cache
# 2. Install your project dependencies
npm install
# npm install --save @progress/kendo-licensing; # if missing from package.json
#3. Activate
npx kendo-ui-license activate
#4. Build the project
npm run build
workingDirectory: "src/Kendo/angular_demo"
displayName: "Install Dependencies and Activate Kendo"
env:
TELERIK_LICENSE_PATH: $(GetLicenseFileTask.secureFilePath)
# *************************************************************** #
# * CONSOLE (without nuget.config) * #
# *************************************************************** #
- job: BuildConsoleApp_Akeyless
pool:
vmImage: 'windows-latest'
steps:
# Get an authentication token from Azure so we can authenticate with Akeyless
- task: AzureCLI@2
name: 'AzureCLI'
displayName: 'Get JWT from Azure Service Principal'
inputs:
azureSubscription: 'Azure MSA Account'
scriptType: ps
scriptLocation: inlineScript
inlineScript: |
$JWT=$(az account get-access-token --query accessToken --output tsv)
echo "##vso[task.setvariable variable=azure_jwt;isoutput=true;issecret=true]$JWT"
# Uses LanceMcCarthy/akeyless-extension-azdo to get a secret (uses azureJwt, see https://github.com/LanceMcCarthy/akeyless-extension-azdo/blob/main/docs/getting-started.md)
- task: akeyless-secrets@1
name: 'Akeyless1'
displayName: 'Get Secrets from Akeyless'
inputs:
accessid: 'p-sxfgaph9urt4om' # Auth Method ID (see https://github.com/LanceMcCarthy/akeyless-extension-azdo/blob/main/docs/getting-started.md#akeyless-setup)
azureJwt: '$(AzureCLI.azure_jwt)' # Output variable from the previous step
staticSecrets: '{"/progress/TELERIK_NUGET_KEY":"NUGET_KEY"}'
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: $(DOTNET_SDK_VERSION)
- powershell: dotnet nuget update source 'Telerik_v3_Feed' --source 'https://nuget.telerik.com/v3/index.json' --username 'api-key' --password '$(Akeyless1.NUGET_KEY)' --configfile $(nugetConfigPath) --store-password-in-clear-text
displayName: 'Update package source credentials'
- powershell: dotnet restore $(consoleProjectPath) --configfile $(nugetConfigPath)
displayName: 'restore packages'
- powershell: dotnet publish $(consoleProjectPath) -o /app/publish /p:UseAppHost=false --no-restore
displayName: 'Publish the project'
env:
# AzDO pipeline secret variable. Note: YAML variable editor supports 14k string values, classic pipelines do not!
TELERIK_LICENSE: $(MY_TELERIK_LICENSE_KEY)
# *************************************************************** #
# * CONSOLE (uses Service connection) * #
# *************************************************************** #
- job: BuildConsoleApp_ServiceConnection
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: $(DOTNET_SDK_VERSION)
# Using Service connection for credentials
- task: DotNetCoreCLI@2
displayName: 'NuGet restore MyDocProcApp'
inputs:
command: 'restore'
projects: $(consoleProjectPath)
feedsToUse: 'config'
nugetConfigPath: $(nugetConfigPath)
externalFeedCredentials: 'Telerik_v3'
# Build the project
- task: DotNetCoreCLI@2
displayName: 'Build MyDocProcApp'
inputs:
command: 'build'
projects: $(consoleProjectPath)
configuration: $(buildConfiguration)
env:
# AzDO pipeline secret variable. Note: YAML variable editor supports 14k string values, classic pipelines do not!
TELERIK_LICENSE: $(MY_TELERIK_LICENSE_KEY)
# ************************************************************* #
# * BLAZOR * #
# ************************************************************* #
- job: BuildBlazorApp
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: $(DOTNET_SDK_VERSION)
- powershell: dotnet nuget update source 'Telerik_v3_Feed' -s 'https://nuget.telerik.com/v3/index.json' -u 'api-key' -p '$(MY_TELERIK_NUGET_KEY)' --store-password-in-clear-text --configfile $(nugetConfigPath)
displayName: 'Update Package Source Credentials'
- powershell: dotnet restore $(blazorProjectPath) --configfile $(nugetConfigPath)
displayName: 'Restore NuGet Packages'
- powershell: dotnet build $(blazorProjectPath) --no-restore
displayName: 'Build and publish'
env:
# AzDO pipeline secret variable. Note: YAML variable editor supports 14k string values, classic pipelines do not!
TELERIK_LICENSE: $(MY_TELERIK_LICENSE_KEY)
# ************************************************************* #
# * ASPNET Core * #
# ************************************************************* #
- job: BuildAspNetCoreApp
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: $(DOTNET_SDK_VERSION)
- powershell: dotnet nuget update source 'Telerik_v3_Feed' -s 'https://nuget.telerik.com/v3/index.json' -u 'api-key' -p '$(MY_TELERIK_NUGET_KEY)' --store-password-in-clear-text --configfile $(nugetConfigPath)
displayName: 'Update Package Source Credentials'
- powershell: dotnet restore $(aspnetProjectPath) --configfile $(nugetConfigPath)
displayName: 'Restore NuGet Packages'
- powershell: dotnet build $(aspnetProjectPath) --no-restore
displayName: 'Build the project'
env:
# AzDO pipeline secret variable. Note: YAML variable editor supports 14k string values, classic pipelines do not!
TELERIK_LICENSE: $(MY_TELERIK_LICENSE_KEY)
# *************************************************************** #
# * ASP.NET AJAX (.NET Framework - SecureFile) * #
# *************************************************************** #
- job: BuildAjaxApp
pool:
vmImage: 'windows-latest'
steps:
- task: DownloadSecureFile@1
name: DownloadTelerikLicenseFile # Note 1: Make sure a name value is set, it's referenced later.
displayName: 'Download Telerik License Key File'
inputs:
secureFile: 'telerik-license.txt'
- task: NuGetToolInstaller@1
displayName: 'Use NuGet.exe'
inputs:
versionSpec: '4.x'
# You could also use nuget.exe's update command to set the credentials of the 'Telerik_v3_Feed' source defined in the nuget.config
# - task: PowerShell@2
# displayName: 'Set Package Source Credentials'
# inputs:
# targetType: 'inline'
# script: nuget sources update -Name 'Telerik_v3_Feed' -Source 'https://nuget.telerik.com/v3/index.json' -Username 'api-key' -Password '$(MY_TELERIK_NUGET_KEY)' -ConfigFile '$(nugetConfigPath)' -StorePasswordInClearText
- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
restoreSolution: $(ajaxProjectPath)
feedsToUse: config
nugetConfigPath: $(nugetConfigPath)
externalFeedCredentials: 'Telerik_v3'
- task: MSBuild@1
displayName: 'Build AJAX Project'
inputs:
solution: '$(ajaxProjectPath)'
platform: Any CPU
configuration: Release
msbuildArguments: '/t:Restore /p:Configuration=Release /p:RuntimeIdentifier=any'
env:
TELERIK_LICENSE_PATH: $(DownloadTelerikLicenseFile.secureFilePath) # Note 2: We use the name to reference the secureFilePath value
# ************************************************************* #
# * WinUI 3 * #
# ************************************************************* #
- job: BuildWinUI
pool:
vmImage: 'windows-latest'
steps:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: $(DOTNET_SDK_VERSION)
- powershell: dotnet nuget update source 'Telerik_v3_Feed' -s 'https://nuget.telerik.com/v3/index.json' -u 'api-key' -p '$(MY_TELERIK_NUGET_KEY)' --store-password-in-clear-text --configfile $(nugetConfigPath)
displayName: 'Update Package Source Credentials'
- powershell: dotnet restore $(winuiProjectPath) --configfile $(nugetConfigPath)
displayName: 'Restore NuGet Packages'
- task: MSBuild@1
displayName: 'Restore RIDs'
inputs:
solution: '$(winuiProjectPath)'
platform: x64
configuration: Release
msbuildArguments: '/t:Restore /p:Configuration=Release /p:RestorePackages=true /p:RestoreRIDs=true /p:RestoreProjectStyle=PackageReference'
# Note: PFX thumbprint is intentionally set to an empty string, this overrides any previous thumbprint from the project
- task: MSBuild@1
displayName: 'Build and Create MSIX'
inputs:
solution: '$(winuiProjectPath)'
platform: x64
configuration: Release
msbuildArguments: '/p:AppxBundlePlatforms="x64|arm64"
/p:UapAppxPackageBuildMode=CI
/p:AppxBundle=Never
/p:PackageCertificateKeyFile="$(PfxDownloadStep.secureFilePath)"
/p:PackageCertificatePassword="$(PfxPassword)"
/p:PackageCertificateThumbprint=""
/p:AppxPackageDir="$(Build.ArtifactStagingDirectory)/AppPackages"
/p:GenerateAppxPackageOnBuild=true
/p:AppxPackageSigningEnabled=false
/p:SelfContained=true'
env:
TELERIK_LICENSE: $(MY_TELERIK_LICENSE_KEY)
# ************************************************************* #
# * .NET MAUI * #
# ************************************************************* #
# https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=windows-images%2Cyaml#software
- job: BuildMauiApp
strategy:
matrix:
android:
TFM: 'net10.0-android'
imageName: 'windows-2025' # windows-2025
windows:
TFM: 'net10.0-windows10.0.19041.0'
imageName: 'windows-latest' # windows-2025
ios:
TFM: 'net10.0-ios'
imageName: 'macOS-latest' # macOS-15
maccatalyst:
TFM: 'net10.0-maccatalyst'
imageName: 'macOS-latest' # macOS-15
maxParallel: 4
pool:
vmImage: $(imageName)
steps:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: $(DOTNET_SDK_VERSION)
- task: CmdLine@2
displayName: 'Set Xcode to v26.1.0'
condition: eq(variables['Agent.OS'], 'Darwin') # Only run this step on macOS
inputs:
script: |
echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_26.1.app
sudo xcode-select --switch /Applications/Xcode_26.1.app/Contents/Developer
- powershell: dotnet workload install maui --source https://api.nuget.org/v3/index.json
displayName: 'Install maui workloads'
- powershell: dotnet nuget update source 'Telerik_v3_Feed' -s 'https://nuget.telerik.com/v3/index.json' -u 'api-key' -p '$(MY_TELERIK_NUGET_KEY)' --store-password-in-clear-text --configfile $(nugetConfigPath)
displayName: 'Update Package Source Credentials'
- powershell: dotnet restore $(mauiProjectPath) --configfile $(nugetConfigPath)
displayName: 'Restore NuGet Packages'
- powershell: dotnet build $(mauiProjectPath) -f $(TFM) -c Debug --no-restore
displayName: 'Build $(TFM)'
env:
# AzDO pipeline secret variable. Note: YAML variable editor supports 14k string values, classic pipelines do not!
TELERIK_LICENSE: $(MY_TELERIK_LICENSE_KEY)
# ************************************************************* #
# * WPF * #
# ************************************************************* #
- job: BuildWpfApp
pool:
vmImage: windows-2025
steps:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: $(DOTNET_SDK_VERSION)
- task: NuGetToolInstaller@1
displayName: 'Use NuGet.exe'
inputs:
versionSpec: '4.x'
- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
restoreSolution: $(wpfProjectPath)
feedsToUse: config
nugetConfigPath: $(nugetConfigPath)
externalFeedCredentials: 'Telerik_v3'
- task: MSBuild@1
displayName: 'Build WPF'
inputs:
solution: $(wpfProjectPath)
platform: 'x86'
configuration: 'Release'
msbuildArguments: '/p:RestorePackages=true /p:OutputPath=$(Build.artifactStagingDirectory)'
env:
# AzDO pipeline secret variable. Note: YAML variable editor supports 14k string values, classic pipelines do not!
TELERIK_LICENSE: $(MY_TELERIK_LICENSE_KEY)
# - task: PublishBuildArtifacts@1
# inputs:
# PathtoPublish: '$(Build.ArtifactStagingDirectory)'
# ArtifactName: 'wpf_drop'
# publishLocation: 'Container'