From 5734f91c1ec7cca32e6dc044b3740c859c742958 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Fri, 26 Mar 2021 15:13:23 +0300 Subject: [PATCH] [ci] attach archives with complete source code of the repo to releases (#4111) * attach archives with complete source code of the repo to releases * restore missed conditions --- .vsts-ci.yml | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 3169d2a50280..5a7472511020 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -288,6 +288,26 @@ jobs: pool: vmImage: 'ubuntu-latest' steps: + # Create archives with complete source code included (with git submodules) + - task: ArchiveFiles@2 + displayName: Create zip archive + condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v')) + inputs: + rootFolderOrFile: $(Build.SourcesDirectory) + includeRootFolder: false + archiveType: zip + archiveFile: '$(Build.ArtifactStagingDirectory)/archives/LightGBM-complete_source_code_zip.zip' + replaceExistingArchive: true + - task: ArchiveFiles@2 + displayName: Create tar.gz archive + condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v')) + inputs: + rootFolderOrFile: $(Build.SourcesDirectory) + includeRootFolder: false + archiveType: tar + tarCompression: gz + archiveFile: '$(Build.ArtifactStagingDirectory)/archives/LightGBM-complete_source_code_tar_gz.tar.gz' + replaceExistingArchive: true # Download all agent packages from all previous phases - task: DownloadBuildArtifacts@0 displayName: Download package assets @@ -301,10 +321,10 @@ jobs: inputs: command: pack packagesToPack: '$(Build.SourcesDirectory)/.nuget/*.nuspec' - packDestination: '$(Build.ArtifactStagingDirectory)' + packDestination: '$(Build.ArtifactStagingDirectory)/nuget' - task: PublishBuildArtifacts@1 inputs: - pathtoPublish: '$(Build.ArtifactStagingDirectory)' + pathtoPublish: '$(Build.ArtifactStagingDirectory)/nuget' artifactName: NuGet artifactType: container - task: GitHubRelease@0 @@ -319,7 +339,8 @@ jobs: title: '$(Build.SourceBranchName)' assets: | $(Build.SourcesDirectory)/binaries/PackageAssets/* - $(Build.ArtifactStagingDirectory)/*.nupkg + $(Build.ArtifactStagingDirectory)/nuget/*.nupkg + $(Build.ArtifactStagingDirectory)/archives/* assetUploadMode: 'delete' isDraft: true isPreRelease: false