-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Create pipeline for exp insertions #9231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,127 @@ | ||
# Pipeline creates a dotnet with experimental msbuild dlls. | ||
|
||
trigger: none # Prevents this pipeline from triggering on check-ins | ||
pr: none # don't run this on PR as well | ||
|
||
parameters: | ||
# Dotnet installer channel from where to take the latest dotnet bits. | ||
- name: DotnetInstallerChannel | ||
displayName: Dotnet installer channel | ||
type: string | ||
# Branch from the MSBuild Build CI pipeline. Default: main | ||
# Top run for the branch would be used to create an experimental insertion. | ||
- name: MSBuildBranch | ||
displayName: MSBuild Branch | ||
type: string | ||
default: 'refs/heads/main' | ||
# BuildID from the MSBuild Build CI pipeline. Overrides the choice of MSBuildBranch parameter | ||
- name: MSBuildBuildID | ||
displayName: MSBuild CI Run Override | ||
type: string | ||
default: 'default' | ||
|
||
variables: | ||
- name: _MsBuildCiPipelineId | ||
value: 9434 | ||
|
||
pool: | ||
vmImage: windows-latest | ||
|
||
steps: | ||
- powershell: | | ||
mkdir '$(System.ArtifactsDirectory)/installer' | ||
|
||
$dotnetChannel = '${{parameters.DotnetInstallerChannel}}' | ||
$sdks = "dotnet-sdk-win-x64.zip", "dotnet-sdk-linux-x64.tar.gz" | ||
|
||
foreach ($sdk in $sdks) | ||
{ | ||
Write-Host "Downloading dotnet $sdk from channel $dotnetChannel" | ||
Invoke-WebRequest ` | ||
-Uri "https://aka.ms/dotnet/$dotnetChannel/daily/$sdk" ` | ||
-OutFile "$(System.ArtifactsDirectory)/installer/$sdk" | ||
} | ||
mkdir '$(Pipeline.Workspace)/artifacts' | ||
|
||
displayName: Download latest dotnet sdks | ||
|
||
# Download latest build artifacts for a branch from MSBuild Build CI | ||
- ${{ if eq(parameters.MSBuildBuildID, 'default') }}: | ||
- task: DownloadBuildArtifacts@1 | ||
inputs: | ||
buildType: specific | ||
project: DevDiv | ||
pipeline: $(_MsBuildCiPipelineId) | ||
buildVersionToDownload: latestFromBranch | ||
branchName: '${{parameters.MSBuildBranch}}' | ||
artifactName: bin | ||
downloadPath: '$(System.ArtifactsDirectory)/msbuild/artifacts/bin' | ||
itemPattern: "MSBuild.Bootstrap/**" | ||
displayName: Download latest msbuild from branch | ||
|
||
# Download build artifacts for MSBuild Build CI specific build | ||
- ${{ if ne(parameters.MSBuildBuildID, 'default') }}: | ||
- task: DownloadBuildArtifacts@1 | ||
inputs: | ||
buildType: specific | ||
project: DevDiv | ||
pipeline: $(_MsBuildCiPipelineId) | ||
buildVersionToDownload: specific | ||
buildId: ${{parameters.MSBuildBuildID}} | ||
artifactName: bin | ||
downloadPath: '$(System.ArtifactsDirectory)/msbuild/artifacts/bin' | ||
itemPattern: "MSBuild.Bootstrap/**" | ||
displayName: Download specified msbuild build | ||
|
||
- powershell: | | ||
$sdk = "dotnet-sdk-win-x64" | ||
|
||
Write-Host "Extracting $(System.ArtifactsDirectory)/installer/$sdk.zip" | ||
Expand-Archive "$(System.ArtifactsDirectory)/installer/$sdk.zip" -DestinationPath "$(Pipeline.Workspace)/exp-dotnet/$sdk" | ||
|
||
$dotnetDirectory = Get-ChildItem -Directory -Path "$(Pipeline.Workspace)/exp-dotnet/$sdk/sdk" | ||
$dotnetVersion = $dotnetDirectory.Name | ||
Write-Host "Detected dotnet version: $dotnetVersion" | ||
|
||
Write-Host "Updating MSBuild dlls." | ||
$(Build.SourcesDirectory)/scripts/Deploy-MSBuild.ps1 ` | ||
-destination "$(Pipeline.Workspace)/exp-dotnet/$sdk/sdk/$dotnetVersion" ` | ||
-bootstrapDirectory "$(System.ArtifactsDirectory)/msbuild/artifacts/bin/MSBuild.Bootstrap" ` | ||
-configuration Release ` | ||
-makeBackup $false | ||
|
||
Write-Host "Compressing dotnet sdk files" | ||
Get-ChildItem -Path "$(Pipeline.Workspace)/exp-dotnet/$sdk" | Compress-Archive -DestinationPath "$(Pipeline.Workspace)/artifacts/$sdk.zip" | ||
|
||
displayName: Dogfood msbuild dlls to dotnet sdk win-x64 | ||
|
||
- powershell: | | ||
$sdk = "dotnet-sdk-linux-x64" | ||
|
||
mkdir "$(Pipeline.Workspace)/exp-dotnet/$sdk" | ||
|
||
Write-Host "Extracting $(System.ArtifactsDirectory)/installer/$sdk.tar.gz" | ||
tar -xzvf "$(System.ArtifactsDirectory)/installer/$sdk.tar.gz" -C "$(Pipeline.Workspace)/exp-dotnet/$sdk" | ||
|
||
$dotnetDirectory = Get-ChildItem -Directory -Path $(Pipeline.Workspace)/exp-dotnet/$sdk/sdk | ||
$dotnetVersion = $dotnetDirectory.Name | ||
Write-Host "Detected dotnet version: $dotnetVersion" | ||
|
||
Write-Host "Updating MSBuild dlls." | ||
$(Build.SourcesDirectory)/scripts/Deploy-MSBuild.ps1 ` | ||
-destination "$(Pipeline.Workspace)/exp-dotnet/$sdk/sdk/$dotnetVersion" ` | ||
-bootstrapDirectory "$(System.ArtifactsDirectory)/msbuild/artifacts/bin/MSBuild.Bootstrap" ` | ||
-configuration Release ` | ||
-makeBackup $false | ||
|
||
Write-Host "Compressing dotnet sdk files" | ||
tar -czvf "$(Pipeline.Workspace)/artifacts/$sdk.tar.gz" -C "$(Pipeline.Workspace)/exp-dotnet/$sdk" . | ||
displayName: Dogfood msbuild dlls to dotnet sdk linux-x64 | ||
|
||
- task: PublishPipelineArtifact@1 | ||
inputs: | ||
targetPath: '$(Pipeline.Workspace)/artifacts' | ||
artifactName: ExperimentalDotnet | ||
parallel: true | ||
condition: always() | ||
displayName: Publish crank assests artifacts |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.