From 33bc3b2f8be18a2fe426fab9769bacf6f916d2a2 Mon Sep 17 00:00:00 2001 From: Peter Squicciarini Date: Fri, 12 Apr 2019 15:11:27 -0700 Subject: [PATCH] Compute and upload sha256 sums for build artifacts --- .travis.yml | 2 ++ sum.sh | 28 ++++++++++++++++++++++++++++ win32-build.yml | 31 ++++++++++++++++--------------- 3 files changed, 46 insertions(+), 15 deletions(-) create mode 100755 sum.sh diff --git a/.travis.yml b/.travis.yml index 77535d6..f5f7719 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,7 @@ script: before_deploy: - ./create_zip.sh + - ./sum.sh deploy: provider: releases @@ -36,6 +37,7 @@ deploy: api_key: $GITHUB_TOKEN file_glob: true file: + - ./*.sha256 - ./*.zip - ./*.tar.gz - vscode/.build/linux/deb/i386/deb/*.deb diff --git a/sum.sh b/sum.sh new file mode 100755 index 0000000..e80717f --- /dev/null +++ b/sum.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +sum_file () { + if [[ -f "$1" ]]; then + shasum -a 256 $1 > $1.sha256 + fi +} + +if [[ "$SHOULD_BUILD" == "yes" ]]; then + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + sum_file VSCodium-darwin-*.zip + elif [[ "$CI_WINDOWS" == "True" ]]; then + sum_file VSCodium-win32*.zip + sum_file VSCodiumSetup*.exe + sum_file VSCodiumUserSetup*.exe + else # linux + if [[ "$BUILDARCH" == "x64" ]]; then + deb_arch=amd64 + rpm_arch=x86_64 + elif [[ "$BUILDARCH" == "ia32" ]]; then + deb_arch=i386 + rpm_arch=i386 + fi + sum_file VSCodium-linux*.tar.gz + sum_file vscode/.build/linux/deb/$(arch)/deb/*.deb + sum_file vscode/.build/linux/rpm/$(arch_alt)/*.rpm + fi +fi diff --git a/win32-build.yml b/win32-build.yml index 2fd391f..f426d83 100644 --- a/win32-build.yml +++ b/win32-build.yml @@ -39,21 +39,22 @@ steps: - bash: | if [[ "$SHOULD_BUILD" == "yes" ]]; then mv vscode\\.build\\win32-$(BUILDARCH)\\archive\\VSCode-win32-$(BUILDARCH).zip VSCodium-win32-$(BUILDARCH)-${LATEST_MS_TAG}.zip; fi displayName: 'move the zip folder' +- powershell: | + bash ./sum.sh + displayName: 'compute sums' +- task: CopyFiles@2 + inputs: + contents: | + VSCodium*.zip + VSCodiumUserSetup*.exe + VSCodiumSetup*.exe + *.sha256 + targetFolder: $(Build.ArtifactStagingDirectory) + condition: eq(variables['SHOULD_BUILD'], 'yes') + displayName: 'copy artifacts to staging directory' - task: PublishBuildArtifacts@1 - displayName: 'Publish artifacts: system-setup' + displayName: 'Publish artifacts' condition: eq(variables['SHOULD_BUILD'], 'yes') inputs: - PathtoPublish: 'VSCodiumSetup-$(BUILDARCH)-$(LATEST_MS_TAG).exe' - ArtifactName: 'system_setup' -- task: PublishBuildArtifacts@1 - displayName: 'Publish artifacts: user-setup' - condition: eq(variables['SHOULD_BUILD'], 'yes') - inputs: - PathtoPublish: 'VSCodiumUserSetup-$(BUILDARCH)-$(LATEST_MS_TAG).exe' - ArtifactName: 'user_setup' -- task: PublishBuildArtifacts@1 - displayName: 'Publish artifacts: archive' - condition: eq(variables['SHOULD_BUILD'], 'yes') - inputs: - PathtoPublish: 'VSCodium-win32-$(BUILDARCH)-$(LATEST_MS_TAG).zip' - ArtifactName: 'archive' + PathtoPublish: $(Build.ArtifactStagingDirectory) + ArtifactName: 'everything'