From 213baf865109eec82893f46c1ea1ed7f4c6ae146 Mon Sep 17 00:00:00 2001 From: Peter Squicciarini Date: Tue, 30 Oct 2018 10:54:21 -0400 Subject: [PATCH 1/4] Add -X -y to zip command --- create_zip.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/create_zip.sh b/create_zip.sh index 5942670..5f84f16 100755 --- a/create_zip.sh +++ b/create_zip.sh @@ -3,7 +3,7 @@ if [[ "$SHOULD_BUILD" == "yes" ]]; then if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cd VSCode-darwin - zip -r ../VSCode-darwin-${LATEST_MS_TAG}.zip ./* + zip -r -X -y ../VSCode-darwin-${LATEST_MS_TAG}.zip ./* elif [[ "$BUILDARCH" == "ia32" ]]; then cd VSCode-linux-ia32 tar czf ../VSCode-linux-ia32-${LATEST_MS_TAG}.tar.gz . From d408fcc06026cc9bad362e6b25bf61f8f8f28b73 Mon Sep 17 00:00:00 2001 From: Peter Squicciarini Date: Tue, 13 Nov 2018 11:58:05 -0500 Subject: [PATCH 2/4] Use latest yarn (#57) --- .travis.yml | 2 ++ install_deps.sh | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 445d374..7ac53d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,8 @@ language: node_js node_js: "8" before_install: + - curl -o- -L https://yarnpkg.com/install.sh | bash + - export PATH="$HOME/.yarn/bin:$PATH" - ./install_deps.sh - . get_repo.sh - . check_tags.sh diff --git a/install_deps.sh b/install_deps.sh index 63839cb..9027ffb 100755 --- a/install_deps.sh +++ b/install_deps.sh @@ -2,7 +2,6 @@ if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update - brew install yarn --without-node brew install jq zip else sudo apt-get update From dc649ff25990a28cea4e1f5ce5cb1a153dd081c9 Mon Sep 17 00:00:00 2001 From: Peter Squicciarini Date: Thu, 22 Nov 2018 09:08:28 -0500 Subject: [PATCH 3/4] Add gitter badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index bff0ac8..3657274 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ [![build status](https://travis-ci.com/VSCodium/vscodium.svg?branch=master)](https://travis-ci.com/VSCodium/vscodium) [![current release](https://img.shields.io/github/release/vscodium/vscodium.svg)](https://github.com/vscodium/vscodium/releases) [![license](https://img.shields.io/github/license/VSCodium/vscodium.svg)](https://github.com/VSCodium/vscodium/blob/master/LICENSE) +[![Gitter](https://img.shields.io/gitter/room/vscodium/vscodium.svg)](https://gitter.im/VSCodium/Lobby) + ## Table of Contents - [Download/Install](#download-install) From 098cab67bd45e356a93a7149c17b1271e1633b2e Mon Sep 17 00:00:00 2001 From: Pavan Agrawal Date: Tue, 27 Nov 2018 08:19:34 -0600 Subject: [PATCH 4/4] Windows builds with Azure Pipelines (#58) --- .gitignore | 1 + azure-pipelines.yml | 65 +++++++++++++++++++++++++++++++++++++++++++++ build.sh | 25 ++++++++++------- check_tags.ps1 | 32 ++++++++++++++++++++++ 4 files changed, 114 insertions(+), 9 deletions(-) create mode 100644 azure-pipelines.yml create mode 100644 check_tags.ps1 diff --git a/.gitignore b/.gitignore index 1b86f26..5e516d2 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ vscode +VS*/* \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..075c262 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,65 @@ +# 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' + +steps: +- script: | + choco install jq + displayName: 'install jq from choco' +- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2 + displayName: 'Install Yarn' +- task: UsePythonVersion@0 + displayName: 'Use Python 2.x' + inputs: + versionSpec: 2.x +- task: ShellScript@2 + 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" + displayName: 'set env LATEST_MS_TAG' +- task: PowerShell@2 + inputs: + filePath: 'check_tags.ps1' + env: + GITHUB_TOKEN: $(GITHUB_TOKEN) +- script: | + git -C vscode status + displayName: 'vscode status' +- powershell: | + bash ./build.sh + displayName: 'go build it!' +- bash: | + mv vscode\\.build\\win32-x64\\system-setup\\VSCodeSetup.exe VSCodiumSetup-x64-${LATEST_MS_TAG}.exe + displayName: 'move the system setup' +- bash: | + mv vscode\\.build\\win32-x64\\user-setup\\VSCodeSetup.exe VSCodiumUserSetup-x64-${LATEST_MS_TAG}.exe + displayName: 'move the user setup' +- bash: | + mv vscode\\.build\\win32-x64\\archive\\VSCode-win32-x64.zip VSCodium-win32-x64-${LATEST_MS_TAG}.zip + displayName: 'move the zip folder' +- task: PublishBuildArtifacts@1 + displayName: 'Publish artifacts: system-setup' + inputs: + PathtoPublish: 'VSCodiumSetup-x64-$(LATEST_MS_TAG).exe' + ArtifactName: 'system_setup' +- task: PublishBuildArtifacts@1 + displayName: 'Publish artifacts: user-setup' + inputs: + PathtoPublish: 'VSCodiumUserSetup-x64-$(LATEST_MS_TAG).exe' + ArtifactName: 'user_setup' +- task: PublishBuildArtifacts@1 + displayName: 'Publish artifacts: archive' + inputs: + PathtoPublish: 'VSCodium-win32-x64-$(LATEST_MS_TAG).zip' + ArtifactName: 'archive' diff --git a/build.sh b/build.sh index ddef3d2..6344e85 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,4 @@ #!/bin/bash - if [[ "$SHOULD_BUILD" == "yes" ]]; then cp -rp src/* vscode/ cd vscode @@ -7,7 +6,6 @@ if [[ "$SHOULD_BUILD" == "yes" ]]; then if [[ "$BUILDARCH" == "ia32" ]]; then export npm_config_arch=ia32 fi - ../update_settings.sh yarn @@ -18,28 +16,37 @@ if [[ "$SHOULD_BUILD" == "yes" ]]; then export NODE_ENV=production - if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then # microsoft adds their apt repo to sources # unless the app name is code-oss # as we are renaming the application to vscodium # we need to edit a line in the post install template sed -i "s/code-oss/vscodium/" resources/linux/debian/postinst.template - fi + fi if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then npm run gulp vscode-darwin-min elif [[ "$BUILDARCH" == "ia32" ]]; then - npm run gulp vscode-linux-ia32-min - npm run gulp vscode-linux-ia32-build-deb - npm run gulp vscode-linux-ia32-build-rpm - unset npm_config_arch + npm run gulp vscode-linux-ia32-min + npm run gulp vscode-linux-ia32-build-deb + npm run gulp vscode-linux-ia32-build-rpm + unset npm_config_arch elif [[ "$BUILDARCH" == "arm64" ]]; then npm run gulp vscode-linux-arm64-min npm run gulp vscode-linux-arm64-build-deb # npm run gulp vscode-linux-arm64-build-rpm + elif [[ "$CI_WINDOWS" == "True" ]]; then + npx gulp vscode-win32-x64-min + npx gulp vscode-win32-x64-copy-inno-updater + npx gulp vscode-win32-x64-inno-updater + npx gulp vscode-win32-x64-system-setup + npx gulp vscode-win32-x64-user-setup + npx gulp vscode-win32-x64-archive else npm run gulp vscode-linux-x64-min npm run gulp vscode-linux-x64-build-deb npm run gulp vscode-linux-x64-build-rpm - fi + fi + + cd .. fi diff --git a/check_tags.ps1 b/check_tags.ps1 new file mode 100644 index 0000000..5613f7b --- /dev/null +++ b/check_tags.ps1 @@ -0,0 +1,32 @@ +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" +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) { + return +} +if (!$VSCODIUM_ASSETS) { + echo "Release assets do not exist at all, continuing build" + $SHOULD_BUILD = 'yes' +} + +$WindowsAssets = ($VSCODIUM_ASSETS | ConvertFrom-Json) | Where-Object { $_.name.Contains('exe') } +$SYSTEM_SETUP = $WindowsAssets | Where-Object { $_.name.Contains('Setup') } +$USER_SETUP = $WindowsAssets | Where-Object { $_.name.Contains('User') } +if (!$SYSTEM_SETUP) { + echo "Building on Windows because we have no system-setup.exe"; + $SHOULD_BUILD = 'yes' +} +elseif (!$USER_SETUP) { + echo "Building on Windows because we have no user-setup.exe"; + $SHOULD_BUILD = 'yes' +} +else { + echo "Already have all the Windows builds" +} + +Write-Host "##vso[task.setvariable variable=SHOULD_BUILD]$SHOULD_BUILD" \ No newline at end of file