From bc07f4b0523b035dcc4fc37eea0d6f5adeb8d30b Mon Sep 17 00:00:00 2001 From: ras0219 <533828+ras0219@users.noreply.github.com> Date: Mon, 13 Jul 2020 12:14:51 -0700 Subject: [PATCH] [vcpkg-ci] Always publish file lists (#12384) Co-authored-by: Robert Schumacher --- scripts/azure-pipelines/linux/azure-pipelines.yml | 4 ++-- scripts/azure-pipelines/osx/azure-pipelines.yml | 4 ++-- scripts/azure-pipelines/windows/azure-pipelines.yml | 4 ++-- scripts/file_script.py | 13 ++++++++----- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/scripts/azure-pipelines/linux/azure-pipelines.yml b/scripts/azure-pipelines/linux/azure-pipelines.yml index e32f983317..4d4eada627 100644 --- a/scripts/azure-pipelines/linux/azure-pipelines.yml +++ b/scripts/azure-pipelines/linux/azure-pipelines.yml @@ -51,11 +51,11 @@ jobs: - bash: | python3 scripts/file_script.py /mnt/vcpkg-ci/installed/vcpkg/info/ displayName: 'Build a file list for all packages' - condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) + condition: always() - task: PublishBuildArtifacts@1 displayName: 'Upload file lists for all packages' - condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) + condition: always() inputs: PathtoPublish: scripts/list_files diff --git a/scripts/azure-pipelines/osx/azure-pipelines.yml b/scripts/azure-pipelines/osx/azure-pipelines.yml index 580eeac50f..f90cc5c305 100644 --- a/scripts/azure-pipelines/osx/azure-pipelines.yml +++ b/scripts/azure-pipelines/osx/azure-pipelines.yml @@ -55,11 +55,11 @@ jobs: - bash: | python3 scripts/file_script.py /Users/vagrant/Data/installed/vcpkg/info/ displayName: 'Build a file list for all packages' - condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) + condition: always() - task: PublishBuildArtifacts@1 displayName: 'Upload file lists for all packages' - condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) + condition: always() inputs: PathtoPublish: scripts/list_files diff --git a/scripts/azure-pipelines/windows/azure-pipelines.yml b/scripts/azure-pipelines/windows/azure-pipelines.yml index 4136615c72..5ec0b300c2 100644 --- a/scripts/azure-pipelines/windows/azure-pipelines.yml +++ b/scripts/azure-pipelines/windows/azure-pipelines.yml @@ -63,7 +63,7 @@ jobs: condition: failed() - task: PowerShell@2 displayName: "Generating all packages files" - condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) + condition: always() inputs: targetType: inline @@ -73,7 +73,7 @@ jobs: & $(.\vcpkg fetch python3) .\scripts\file_script.py D:\installed\vcpkg\info\ - task: PublishBuildArtifacts@1 displayName: 'Upload file lists for all packages' - condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) + condition: always() inputs: PathtoPublish: scripts/list_files ArtifactName: "${{ parameters.triplet }} package file lists" diff --git a/scripts/file_script.py b/scripts/file_script.py index 1170c643f4..de57f27209 100644 --- a/scripts/file_script.py +++ b/scripts/file_script.py @@ -28,11 +28,14 @@ def main(path): except FileExistsError: print("Path already exists, continuing...") - headers = open("scripts/list_files/VCPKGHeadersDatabase.txt", mode='w') - output = open("scripts/list_files/VCPKGDatabase.txt", mode='w') - gen_all_file_strings(path, getFiles(path), headers, output) - headers.close() - output.close() + try: + headers = open("scripts/list_files/VCPKGHeadersDatabase.txt", mode='w') + output = open("scripts/list_files/VCPKGDatabase.txt", mode='w') + gen_all_file_strings(path, getFiles(path), headers, output) + headers.close() + output.close() + except e: + print("Failed to generate file lists") if __name__ == "__main__": main(sys.argv[1])