-
Notifications
You must be signed in to change notification settings - Fork 515
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Allow to choose nuget publishing feeds based in the repo id. (#1…
…2909) Co-authored-by: Alex Soto <[email protected]>
- Loading branch information
1 parent
ee14ab7
commit 08b6dfe
Showing
3 changed files
with
59 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
tools/devops/automation/templates/release/publish-nugets.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# all steps that are required to publish the nugets, the template takes the parameters to decide in which feed should the nugets | ||
# be published | ||
steps: | ||
|
||
# based on the build, decide if we are used a feed or the other and export it | ||
- bash: | | ||
set -x | ||
set -e | ||
make | ||
var=$(make -C $(Build.SourcesDirectory)/xamarin-macios/tools/devops print-variable VARIABLE=$VAR_NAME) | ||
var=${var#*=} | ||
echo "##vso[task.setvariable variable=Credential]$var" | ||
displayName: 'Retrieve nuget feed' | ||
name: ConfigureNuget | ||
env: | ||
${{ if not(contains (variables['Build.DefinitionName'], 'private')) }}: | ||
VAR_NAME=NUGET_PUBLIC_FEED | ||
${{ if contains (variables['Build.DefinitionName'], 'private') }}: | ||
VAR_NAME=NUGET_PRIVATE_FEED | ||
|
||
- task: NuGetAuthenticate@0 | ||
displayName: 'Authenticate dotnet-tool feed' | ||
inputs: | ||
nuGetServiceConnections: $(ConfigureNuget.Credential) | ||
condition: contains (variables['Build.DefinitionName'], 'private') | ||
|
||
- task: DownloadPipelineArtifact@2 | ||
inputs: | ||
artifactName: nuget-signed | ||
downloadPath: $(Build.SourcesDirectory)/package | ||
patterns: | | ||
*.nupkg | ||
- task: NuGetCommand@2 | ||
displayName: Publish Nugets to dotnet6 | ||
inputs: | ||
command: push | ||
packagesToPush: $(Build.SourcesDirectory)/package/*.nupkg | ||
nuGetFeedType: external | ||
publishFeedCredentials: $(ConfigureNuget.Credential) | ||
|
||
- task: DownloadPipelineArtifact@2 | ||
inputs: | ||
artifactName: vs-msi-nugets | ||
downloadPath: $(Build.SourcesDirectory)/vs-msi-nugets | ||
patterns: | | ||
*.nupkg | ||
- task: NuGetCommand@2 | ||
displayName: Publish Nugets to dotnet6 | ||
inputs: | ||
command: push | ||
packagesToPush: $(Build.SourcesDirectory)/vs-msi-nugets/*.nupkg | ||
nuGetFeedType: external | ||
publishFeedCredentials: $(ConfigureNuget.Credential) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters