Skip to content

Commit

Permalink
[CI] Allow to choose nuget publishing feeds based in the repo id. (#1…
Browse files Browse the repository at this point in the history
…2909)


Co-authored-by: Alex Soto <[email protected]>
  • Loading branch information
mandel-macaque and dalexsoto authored Oct 4, 2021
1 parent ee14ab7 commit 08b6dfe
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 28 deletions.
3 changes: 3 additions & 0 deletions tools/devops/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,7 @@ all check:
print-abspath-variable:
@echo $(VARIABLE)=$(abspath $($(VARIABLE)))

print-variable:
@echo $(VARIABLE)=$($(VARIABLE))

provisioning: build-provisioning.csx device-tests-provisioning.csx provision-xcode.csx
55 changes: 55 additions & 0 deletions tools/devops/automation/templates/release/publish-nugets.yml
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)
29 changes: 1 addition & 28 deletions tools/devops/automation/templates/release/vs-insertion-prep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,35 +38,8 @@ stages:
pool:
vmImage: macOS-10.15
steps:
- task: DownloadPipelineArtifact@2
inputs:
artifactName: nuget-signed
downloadPath: $(Build.SourcesDirectory)/package
patterns: |
*.nupkg
- template: publish-nugets.yml

- task: NuGetCommand@2
displayName: Publish Nugets to dotnet6
inputs:
command: push
packagesToPush: $(Build.SourcesDirectory)/package/*.nupkg
nuGetFeedType: external
publishFeedCredentials: dnceng-dotnet6

- 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: dnceng-dotnet6

# Check - "xamarin-macios (VS Insertion Wait For Approval)"
# Check - "xamarin-macios (VS Insertion Create VS Drop and Open PR)"
Expand Down

0 comments on commit 08b6dfe

Please sign in to comment.