diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 3fcfb3856..0b3eee353 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -335,11 +335,9 @@ stages: # Never run tests on arm64 _TestArg: '' - - template: /eng/common/templates/job/source-build.yml - parameters: - platform: - name: 'Managed' - container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-3e800f1-20190501005343' + - template: /eng/common/templates/jobs/source-build.yml + + - template: /src/SourceBuild/Arcade/eng/common/templates/job/source-build-tarball-creation.yml # https://github.com/dotnet/core-sdk/issues/248 # - template: /eng/build.yml @@ -361,6 +359,8 @@ stages: - Windows_NT - Linux - Darwin + - Source_Build_Managed + - Source_Build_Tarball_Creation publishUsingPipelines: true pool: vmImage: vs2017-win2016 diff --git a/src/SourceBuild/Arcade/eng/common/templates/job/source-build-tarball-creation.yml b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-tarball-creation.yml new file mode 100644 index 000000000..98b47a62c --- /dev/null +++ b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-tarball-creation.yml @@ -0,0 +1,53 @@ +jobs: + - job: Source_Build_Tarball_Creation + displayName: Source-Build Tarball Creation + pool: + vmImage: ubuntu-20.04 + container: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-32-20210222183556-031e7d2 + workspace: + clean: all + + steps: + - script: | + set -x + df -h + + buildConfig=Release + # Check if AzDO substitutes in a build config from a variable, and use it if so. + if [ '$(_BuildConfig)' != '$''(_BuildConfig)' ]; then + buildConfig='$(_BuildConfig)' + fi + + officialBuildArgs= + if [ '${{ and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}' = 'True' ]; then + officialBuildArgs='/p:DotNetPublishUsingPipelines=true /p:OfficialBuildId=$(BUILD.BUILDNUMBER)' + fi + + ./build.sh \ + --ci \ + --configuration $buildConfig \ + --publish \ + -bl \ + $officialBuildArgs \ + /p:ArcadeBuildTarball=true + displayName: Create Tarball + + - task: CopyFiles@2 + displayName: Prepare BuildLogs staging directory + inputs: + SourceFolder: '$(Build.SourcesDirectory)' + Contents: | + **/*.log + **/*.binlog + TargetFolder: '$(Build.StagingDirectory)/BuildLogs' + CleanTargetFolder: true + continueOnError: true + condition: succeededOrFailed() + + - task: PublishPipelineArtifact@1 + displayName: Publish BuildLogs + inputs: + targetPath: '$(Build.StagingDirectory)/BuildLogs' + artifactName: BuildLogs_SourceBuild_TarballCreation_Attempt$(System.JobAttempt) + continueOnError: true + condition: succeededOrFailed() diff --git a/src/SourceBuild/Arcade/tools/SourceBuildArcadeTarball.targets b/src/SourceBuild/Arcade/tools/SourceBuildArcadeTarball.targets index 914cf1ad3..49a2b57a5 100644 --- a/src/SourceBuild/Arcade/tools/SourceBuildArcadeTarball.targets +++ b/src/SourceBuild/Arcade/tools/SourceBuildArcadeTarball.targets @@ -6,16 +6,6 @@ - - - - $(RepoRoot)artifacts/tarball/ $([MSBuild]::EnsureTrailingSlash('$(TarballDir)')) @@ -24,6 +14,26 @@ quiet + + + + $([System.IO.Path]::GetDirectoryName('$(TarballFilePath)')) + + + + + + + + + + @@ -61,6 +71,7 @@ @(RootRepoCommitSha) @(RootRepoUri) $(GitHubRepositoryName) + true @@ -72,6 +83,7 @@ %(SourceBuildRepos.SourceBuildRepoName) %(SourceBuildRepos.Uri) %(SourceBuildRepos.Sha) + %(SourceBuildRepos.IsRootRepo) @@ -82,7 +94,7 @@ - + $(SourceBuildRepoName).$(RepoSha)/ @@ -92,16 +104,24 @@ -q - + + - + - + + diff --git a/src/SourceBuild/tarball/BuildSourceBuildTarball.proj b/src/SourceBuild/tarball/BuildSourceBuildTarball.proj index 147239862..7b5becb77 100644 --- a/src/SourceBuild/tarball/BuildSourceBuildTarball.proj +++ b/src/SourceBuild/tarball/BuildSourceBuildTarball.proj @@ -1,6 +1,10 @@ + + $(ArtifactsShippingPackagesDir)dotnet-sdk-source-$(Version).tar.gz + + - \ No newline at end of file +