From 75cf88c222d4b6a1a957e0de504909212dd08286 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Fri, 26 Mar 2021 03:36:25 +0300 Subject: [PATCH 1/2] attach archives with complete source code of the repo to releases --- .vsts-ci.yml | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 3169d2a50280..1a91f49d496e 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -288,6 +288,24 @@ jobs: pool: vmImage: 'ubuntu-latest' steps: + # Create archives with complete source code included (with git submodules) + - task: ArchiveFiles@2 + displayName: Create zip archive + 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 + 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 +319,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 +337,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 From 2c41b90059c175f9fbbc4fd61defcedb57ad5c86 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Fri, 26 Mar 2021 03:49:43 +0300 Subject: [PATCH 2/2] restore missed conditions --- .vsts-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 1a91f49d496e..5a7472511020 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -291,6 +291,7 @@ jobs: # 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 @@ -299,6 +300,7 @@ jobs: 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