From 83cfe077eef42d2a50cc46a03204b711e3c995c3 Mon Sep 17 00:00:00 2001 From: Peter Squicciarini Date: Mon, 3 Dec 2018 14:16:48 -0500 Subject: [PATCH] Cleanup Windows build process (#62) --- azure-pipelines.yml | 20 +++++++------------- check_tags.ps1 | 6 +++--- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 075c262..b81c5ae 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,8 +1,3 @@ -# Node.js with Grunt -# Build a Node.js project using the Grunt task runner. -# Add steps that analyze code, save build artifacts, deploy, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript - pool: vmImage: 'vs2017-win2016' @@ -20,10 +15,6 @@ steps: displayName: 'get VSCode sources' inputs: scriptPath: get_repo.sh - #args: '' # Optional - #disableAutoCwd: false # Optional - #cwd: '' # Optional - #failOnStandardError: false - powershell: | $LATEST_MS_TAG="$(git -C vscode describe --tags)" Write-Host "##vso[task.setvariable variable=LATEST_MS_TAG]$LATEST_MS_TAG" @@ -32,7 +23,7 @@ steps: inputs: filePath: 'check_tags.ps1' env: - GITHUB_TOKEN: $(GITHUB_TOKEN) + MAPPED_GITHUB_TOKEN: $(GITHUB_TOKEN) - script: | git -C vscode status displayName: 'vscode status' @@ -40,26 +31,29 @@ steps: bash ./build.sh displayName: 'go build it!' - bash: | - mv vscode\\.build\\win32-x64\\system-setup\\VSCodeSetup.exe VSCodiumSetup-x64-${LATEST_MS_TAG}.exe + if [[ "$SHOULD_BUILD" == "yes" ]]; then mv vscode\\.build\\win32-x64\\system-setup\\VSCodeSetup.exe VSCodiumSetup-x64-${LATEST_MS_TAG}.exe; fi displayName: 'move the system setup' - bash: | - mv vscode\\.build\\win32-x64\\user-setup\\VSCodeSetup.exe VSCodiumUserSetup-x64-${LATEST_MS_TAG}.exe + if [[ "$SHOULD_BUILD" == "yes" ]]; then mv vscode\\.build\\win32-x64\\user-setup\\VSCodeSetup.exe VSCodiumUserSetup-x64-${LATEST_MS_TAG}.exe; fi displayName: 'move the user setup' - bash: | - mv vscode\\.build\\win32-x64\\archive\\VSCode-win32-x64.zip VSCodium-win32-x64-${LATEST_MS_TAG}.zip + if [[ "$SHOULD_BUILD" == "yes" ]]; then mv vscode\\.build\\win32-x64\\archive\\VSCode-win32-x64.zip VSCodium-win32-x64-${LATEST_MS_TAG}.zip; fi displayName: 'move the zip folder' - task: PublishBuildArtifacts@1 displayName: 'Publish artifacts: system-setup' + condition: eq(variables['SHOULD_BUILD'], 'yes') inputs: PathtoPublish: 'VSCodiumSetup-x64-$(LATEST_MS_TAG).exe' ArtifactName: 'system_setup' - task: PublishBuildArtifacts@1 displayName: 'Publish artifacts: user-setup' + condition: eq(variables['SHOULD_BUILD'], 'yes') inputs: PathtoPublish: 'VSCodiumUserSetup-x64-$(LATEST_MS_TAG).exe' ArtifactName: 'user_setup' - task: PublishBuildArtifacts@1 displayName: 'Publish artifacts: archive' + condition: eq(variables['SHOULD_BUILD'], 'yes') inputs: PathtoPublish: 'VSCodium-win32-x64-$(LATEST_MS_TAG).zip' ArtifactName: 'archive' diff --git a/check_tags.ps1 b/check_tags.ps1 index 5613f7b..8ef3027 100644 --- a/check_tags.ps1 +++ b/check_tags.ps1 @@ -1,14 +1,14 @@ -echo "token: $env:GITHUB_TOKEN" echo "tag: $env:LATEST_MS_TAG" -$GITHUB_RESPONSE = curl.exe -s -H "Authorization: token $env:GITHUB_TOKEN" "https://api.github.com/repos/vscodium/vscodium/releases/tags/$env:LATEST_MS_TAG" +$GITHUB_RESPONSE = curl.exe -s -H "Authorization: token $env:MAPPED_GITHUB_TOKEN" "https://api.github.com/repos/vscodium/vscodium/releases/tags/$env:LATEST_MS_TAG" echo "Github response: ${GITHUB_RESPONSE}" $VSCODIUM_ASSETS= $GITHUB_RESPONSE | jq '.assets' echo "VSCodium assets: ${VSCODIUM_ASSETS}" # if we just don't have the github token, get out fast -if (!$env:GITHUB_TOKEN) { +if (!$env:MAPPED_GITHUB_TOKEN.length -le 15) { return } + if (!$VSCODIUM_ASSETS) { echo "Release assets do not exist at all, continuing build" $SHOULD_BUILD = 'yes'