Skip to content

Commit

Permalink
Update build-steps-template.yml
Browse files Browse the repository at this point in the history
cleanup of steps
  • Loading branch information
IGvaleries authored Dec 16, 2024
1 parent 36a4a48 commit f827f4a
Showing 1 changed file with 21 additions and 82 deletions.
103 changes: 21 additions & 82 deletions azure-pipelines/templates/build-steps-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,59 +37,6 @@ steps:
version: '9.0.101' # we are currently building a 8.0 app. TODO: Try upgrading to 8.x in the future
performMultiLevelLookup: false


- task: PowerShell@2
displayName: 'Generate NuGet.config for IG ProGet NuGet feed and u'
enabled: false
inputs:
targetType: 'inline'
script: |
dotnet new nugetconfig --force
# The name of the source doesn't currently matter as the credentials are attached thanks to URL matching - according to MS docs
dotnet nuget add source ${{ parameters.igNuGetFeedUrl }} --name "IG ProGet NuGet" --allow-insecure-connections
# Manually add the allowInsecureConnections attribute to the nuget.config file
$nugetConfigPath = "$(Build.SourcesDirectory)\NuGet.config"
[xml]$nugetConfig = Get-Content $nugetConfigPath
$nugetConfig.configuration.packageSources.add | Where-Object { $_.name -eq "IG ProGet NuGet" } | ForEach-Object { $_.allowInsecureConnections = "true" }
$nugetConfig.Save($nugetConfigPath)
failOnStderr: true
showWarnings: true
workingDirectory: '$(Build.SourcesDirectory)'

- task: PowerShell@2
displayName: 'Identify trial packages and use licensed ones instead'
inputs:
targetType: 'inline'
script: |
$xml = [XML](Get-Content '.\IgBlazorSamples.${{ parameters.projectToBuild }}.csproj');
$nodes = $xml.SelectNodes("//PackageReference[starts-with(@Include,'IgniteUI')]") |
ForEach-Object {
$_.SetAttribute("Include",$_.Include.Replace(".Trial",""));
$_.SetAttribute("Version", "${{ parameters.igVersion }}");
Write-Host $_.Version
}
$xml.Save('.\IgBlazorSamples.${{ parameters.projectToBuild }}.csproj')
failOnStderr: true
showWarnings: true
workingDirectory: '$(Build.SourcesDirectory)\browser\IgBlazorSamples.${{ parameters.projectToBuild }}'

- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
enabled: false
continueOnError: true
inputs:
command: 'restore'
projects: '$(Build.SourcesDirectory)\browser\IgBlazorSamples.${{ parameters.projectToBuild }}'
# We want the dependency tree to be evaluated each time and to be sure that the dependencies are freshly downloaded
restoreArguments: '--ignore-failed-sources --no-cache --force'
feedsToUse: 'config'
nugetConfigPath: '$(Build.SourcesDirectory)\nuget.config'
# This task cannot use an apiKey directly (yet) so use any other service connection not based on an api key
externalFeedCredentials: 'IG ProGet IgniteUINuGet - Staging'
verbosityRestore: 'Diagnostic'


- task: PowerShell@2
displayName: 'Generate NuGet.config for IG ProGet NuGet feed'
continueOnError: true
Expand Down Expand Up @@ -139,48 +86,40 @@ steps:
showWarnings: true
workingDirectory: '$(Build.SourcesDirectory)'

- task: DotNetCoreCLI@2
displayName: 'dotnet restore B'
continueOnError: true
enabled: true
- task: PowerShell@2
displayName: 'Identify trial packages and use licensed ones instead'
inputs:
command: 'restore'
projects: '$(Build.SourcesDirectory)\browser\IgBlazorSamples.${{ parameters.projectToBuild }}'
# We want the dependency tree to be evaluated each time and to be sure that the dependencies are freshly downloaded
restoreArguments: '--ignore-failed-sources --no-cache --force'
feedsToUse: 'config'
nugetConfigPath: '$(Build.SourcesDirectory)\nuget.config'
# This task cannot use an apiKey directly (yet) so use any other service connection not based on an api key
verbosityRestore: 'Diagnostic'

targetType: 'inline'
script: |
$xml = [XML](Get-Content '.\IgBlazorSamples.${{ parameters.projectToBuild }}.csproj');
$nodes = $xml.SelectNodes("//PackageReference[starts-with(@Include,'IgniteUI')]") |
ForEach-Object {
$_.SetAttribute("Include",$_.Include.Replace(".Trial",""));
$_.SetAttribute("Version", "${{ parameters.igVersion }}");
Write-Host $_.Version
}
$xml.Save('.\IgBlazorSamples.${{ parameters.projectToBuild }}.csproj')
failOnStderr: true
showWarnings: true
workingDirectory: '$(Build.SourcesDirectory)\browser\IgBlazorSamples.${{ parameters.projectToBuild }}'

- task: DotNetCoreCLI@2
displayName: 'dotnet restore 2'
continueOnError: true
displayName: 'dotnet restore'
enabled: true
inputs:
command: 'restore'
projects: '$(Build.SourcesDirectory)\browser\IgBlazorSamples.${{ parameters.projectToBuild }}'
# We want the dependency tree to be evaluated each time and to be sure that the dependencies are freshly downloaded
restoreArguments: '--ignore-failed-sources --no-cache --force --configfile $(Build.SourcesDirectory)\nuget.config'
# This task cannot use an apiKey directly (yet) so use any other service connection not based on an api key
externalFeedCredentials: 'IG ProGet IgniteUINuGet - Staging'
verbosityRestore: 'Diagnostic'

- task: NuGetCommand@2
inputs:
command: 'restore'
restoreSolution: '$(Build.SourcesDirectory)\browser\IgBlazorSamples.${{ parameters.projectToBuild }}\IgBlazorSamples.Client.csproj'
restoreArguments: '--ignore-failed-sources --no-cache --force'
feedsToUse: 'config'
nugetConfigPath: '$(Build.SourcesDirectory)\nuget.config'
externalFeedCredentials: 'IG ProGet IgniteUINuGet - Staging'



# This task cannot use an apiKey directly (yet) so use any other service connection not based on an api key
verbosityRestore: 'Diagnostic'

- task: DeleteFiles@1
displayName: 'Delete NuGet.config file - used only at build time'
enabled: false
enabled: true
inputs:
SourceFolder: '$(Build.SourcesDirectory)\'
Contents: '**/nuget.config'
Expand Down

0 comments on commit f827f4a

Please sign in to comment.