diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 000000000..649a77433 --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "microsoft.dotnet.darc": { + "version": "1.1.0-beta.22527.1", + "commands": [ + "darc" + ] + } + } +} diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index b112998bf..abc01a6a6 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -206,9 +206,13 @@ https://github.com/dotnet/arcade c5dd6a1da2e6d9b3423ab809fcda8af2927a408b - + https://github.com/dotnet/arcade-services - f599f273949253b9826abb99f1bb12fabdb5bb00 + 96b70240e35894921b5bf33acb16590f0067fb52 + + + https://github.com/dotnet/arcade-services + 96b70240e35894921b5bf33acb16590f0067fb52 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 6f3f7b192..17753dc26 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -30,7 +30,7 @@ - 1.1.0-beta.22519.1 + 1.1.0-beta.22527.1 diff --git a/eng/pipelines/templates/jobs/vmr-synchronization.yml b/eng/pipelines/templates/jobs/vmr-synchronization.yml new file mode 100644 index 000000000..4d1fa202d --- /dev/null +++ b/eng/pipelines/templates/jobs/vmr-synchronization.yml @@ -0,0 +1,76 @@ +### These steps synchronize code from product repositories into the VMR (https://github.com/dotnet/dotnet) + +parameters: +- name: targetRef + displayName: Target revision in dotnet/installer to synchronize + type: string + default: $(Build.SourceVersion) + +- name: vmrBranch + displayName: dotnet/dotnet branch to use + type: string + default: $(Build.SourceBranchName) + +- name: vmrToken + displayName: PAT that allows pushing to dotnet/dotnet + type: string + +jobs: +- job: Synchronize + displayName: Synchronize dotnet/dotnet + timeoutInMinutes: 120 + + pool: + ${{ if eq(variables['System.TeamProject'], 'public') }}: + name: NetCore-Public + demands: + - ImageOverride -equals Build.Ubuntu.2004.Amd64.Open + ${{ else }}: + name: NetCore1ESPool-Internal + demands: + - ImageOverride -equals Build.Ubuntu.2004.Amd64 + + steps: + - checkout: self + clean: true + displayName: Checkout dotnet/installer + fetchDepth: 0 + path: installer + + - checkout: vmr + clean: true + displayName: Checkout dotnet/dotnet + fetchDepth: 0 + path: vmr + + - script: |- + source ./eng/common/tools.sh + InitializeDotNetCli true + ./.dotnet/dotnet tool restore + displayName: Restore toolset + workingDirectory: $(Agent.BuildDirectory)/installer + + # TODO (https://github.com/dotnet/arcade/issues/11386): Remove this step + # This step is here so that darc can find the PR commit (which might be in some fork) + # We need to make darc understand that it needs to look in the fork from this PR + - ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: + - script: |- + cp -r $(Agent.BuildDirectory)/installer $(Agent.TempDirectory)/installer + displayName: '[PR Only] Prepare dotnet/installer clone' + + - script: |- + $(Agent.BuildDirectory)/installer/.dotnet/dotnet darc vmr update --vmr $(Agent.BuildDirectory)/vmr --tmp $(Agent.TempDirectory) --azdev-pat $(System.AccessToken) --github-pat ${{ parameters.vmrToken }} --recursive --verbose installer:${{ parameters.targetRef }} + displayName: Synchronize dotnet/dotnet + workingDirectory: $(Agent.BuildDirectory)/installer + + - ${{ if and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'internal')) }}: + - script: |- + set -x + git config --global user.email 'dotnet-maestro[bot]@users.noreply.github.com' && git config --global user.name 'dotnet-maestro[bot]' + git remote add dotnet 'https://${{ parameters.vmrToken }}@github.com/dotnet/dotnet.git' + git fetch dotnet + git branch ${{ parameters.vmrBranch }} + git branch --set-upstream-to=dotnet/${{ parameters.vmrBranch }} ${{ parameters.vmrBranch }} || echo 'Branch ${{ parameters.vmrBranch }} not found in remote' + git push dotnet ${{ parameters.vmrBranch }} + displayName: Push changes to dotnet/dotnet + workingDirectory: $(Agent.BuildDirectory)/vmr diff --git a/eng/vmr-synchronization.yml b/eng/vmr-synchronization.yml new file mode 100644 index 000000000..488c087e1 --- /dev/null +++ b/eng/vmr-synchronization.yml @@ -0,0 +1,41 @@ +### This pipeline synchronizes code from product repositories into the VMR (https://github.com/dotnet/dotnet) + +parameters: +- name: targetRef + displayName: Target revision in dotnet/installer to synchronize + type: string + default: $(Build.SourceVersion) + +- name: vmrBranch + displayName: dotnet/dotnet branch to use + type: string + default: $(Build.SourceBranchName) + +trigger: + branches: + include: + - main + +pr: none + +resources: + repositories: + - repository: vmr + type: github + name: dotnet/dotnet + endpoint: dotnet + +variables: +- ${{ if eq(variables['System.TeamProject'], 'internal') }}: + - group: DotNetBot-GitHub + +- ${{ else }}: + - name: BotAccount-dotnet-bot-repo-PAT + value: N/A + +jobs: +- template: ./pipelines/templates/jobs/vmr-synchronization.yml + parameters: + targetRef: ${{ parameters.targetRef }} + vmrBranch: ${{ parameters.vmrBranch }} + vmrToken: $(BotAccount-dotnet-bot-repo-PAT) diff --git a/src/VirtualMonoRepo/Tasks/VirtualMonoRepo_Initialize.cs b/src/VirtualMonoRepo/Tasks/VirtualMonoRepo_Initialize.cs index ed3cbbf30..7a28720d9 100644 --- a/src/VirtualMonoRepo/Tasks/VirtualMonoRepo_Initialize.cs +++ b/src/VirtualMonoRepo/Tasks/VirtualMonoRepo_Initialize.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -48,6 +49,9 @@ public class VirtualMonoRepo_Initialize : Build.Utilities.Task, ICancelableTask private async Task ExecuteAsync() { + VmrPath = Path.GetFullPath(VmrPath); + TmpPath = Path.GetFullPath(TmpPath); + var vmrInitializer = _serviceProvider.Value.GetRequiredService(); await vmrInitializer.InitializeRepository(Repository, Revision, PackageVersion, Recursive, _cancellationToken.Token); return true;