diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 0000000..f9ea139 --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,73 @@ +name: CI + +on: + push: + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: macOS-latest + env: + TRAVIS_OS_NAME: "osx" + steps: + - uses: actions/checkout@v2 + + - name: Setup Node.js environment + uses: actions/setup-node@v1.4.3 + with: + node-version: 12.14.1 + + - name: Clone VSCode repo + run: | + . get_repo.sh + echo "::set-env name=LATEST_MS_TAG::$LATEST_MS_TAG" + echo "::set-env name=LATEST_MS_COMMIT::$LATEST_MS_COMMIT" + + - name: Check existing VSCodium tags/releases + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + . check_tags.sh + echo "::set-env name=SHOULD_BUILD::$SHOULD_BUILD" + + - name: Build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: ./build.sh + + - name: Sign binary + run: ./sign_mac_app.sh + env: + CERTIFICATE_OSX_P12: ${{ secrets.CERTIFICATE_OSX_P12 }} + CERTIFICATE_OSX_PASSWORD: ${{ secrets.CERTIFICATE_OSX_PASSWORD }} + CERTIFICATE_OSX_ID: ${{ secrets.CERTIFICATE_OSX_ID }} + + - name: Zip release + run: ./create_zip.sh + + - name: DMG the release + run: ./create_dmg.sh + + - name: Generate shasums + run: ./sum.sh + + - name: Release + uses: softprops/action-gh-release@v1 + if: env.SHOULD_BUILD == 'yes' + with: + tag_name: ${{ env.LATEST_MS_TAG }} + files: | + ./*.zip + ./*.dmg + ./*.sha256 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Update versions repo + if: env.SHOULD_BUILD == 'yes' + run: ./update_version.sh + env: + GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }} + GITHUB_USERNAME: ${{ github.repository_owner }} + diff --git a/.travis.yml b/.travis.yml index 09a98df..98b58e1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,23 +1,19 @@ -matrix: +jobs: include: - os: linux - sudo: required env: BUILDARCH=x64 dist: trusty - os: linux - sudo: required env: BUILDARCH=arm64 dist: trusty - os: linux - sudo: required env: BUILDARCH=arm dist: trusty -# - os: osx language: node_js -node_js: "12" +node_js: "12.14.1" -before_install: +install: - curl -o- -L https://yarnpkg.com/install.sh | bash - export PATH="$HOME/.yarn/bin:$PATH" - . install_deps.sh @@ -28,9 +24,7 @@ script: - ./build.sh before_deploy: - - ./sign_mac_app.sh - ./create_zip.sh - - ./create_dmg.sh - ./sum.sh deploy: @@ -38,13 +32,12 @@ deploy: skip_cleanup: true overwrite: true name: $LATEST_MS_TAG - api_key: $GITHUB_TOKEN + token: $GITHUB_TOKEN file_glob: true file: - ./*.sha256 - ./*.zip - ./*.tar.gz - - ./*.dmg - ./*.deb - ./*.rpm - ./*.AppImage diff --git a/build.sh b/build.sh index d662114..4492f65 100755 --- a/build.sh +++ b/build.sh @@ -1,60 +1,35 @@ #!/bin/bash -function keep_alive_small() { - while true; do - echo . - read -t 60 < /proc/self/fd/1 > /dev/null 2>&1 - done -} - -function keep_alive() { - while true; do - date - sleep 60 - done -} +set -ex if [[ "$SHOULD_BUILD" == "yes" ]]; then + npm config set scripts-prepend-node-path true + export BUILD_SOURCEVERSION=$LATEST_MS_COMMIT echo "LATEST_MS_COMMIT: ${LATEST_MS_COMMIT}" echo "BUILD_SOURCEVERSION: ${BUILD_SOURCEVERSION}" - export npm_config_arch="$BUILDARCH" - export npm_config_target_arch="$BUILDARCH" + if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then + export npm_config_arch="$BUILDARCH" + export npm_config_target_arch="$BUILDARCH" + fi - ./prepare_vscode.sh + . prepare_vscode.sh cd vscode || exit - export NODE_ENV=production - - # these tasks are very slow, so using a keep alive to keep travis alive - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - keep_alive_small & - else - keep_alive & - fi - - KA_PID=$! + yarn monaco-compile-check + yarn valid-layers-check yarn gulp compile-build yarn gulp compile-extensions-build - yarn gulp minify-vscode - yarn gulp minify-vscode-reh - yarn gulp minify-vscode-reh-web - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - npm install --global create-dmg yarn gulp vscode-darwin-min-ci - yarn gulp vscode-reh-darwin-min-ci - yarn gulp vscode-reh-web-darwin-min-ci elif [[ "$CI_WINDOWS" == "True" ]]; then cp LICENSE.txt LICENSE.rtf # windows build expects rtf license yarn gulp "vscode-win32-${BUILDARCH}-min-ci" - yarn gulp "vscode-reh-win32-${BUILDARCH}-min-ci" - yarn gulp "vscode-reh-web-win32-${BUILDARCH}-min-ci" yarn gulp "vscode-win32-${BUILDARCH}-code-helper" yarn gulp "vscode-win32-${BUILDARCH}-inno-updater" yarn gulp "vscode-win32-${BUILDARCH}-archive" @@ -62,8 +37,6 @@ if [[ "$SHOULD_BUILD" == "yes" ]]; then yarn gulp "vscode-win32-${BUILDARCH}-user-setup" else # linux yarn gulp vscode-linux-${BUILDARCH}-min-ci - yarn gulp vscode-reh-linux-${BUILDARCH}-min-ci - yarn gulp vscode-reh-web-linux-${BUILDARCH}-min-ci yarn gulp "vscode-linux-${BUILDARCH}-build-deb" if [[ "$BUILDARCH" == "x64" ]]; then @@ -72,7 +45,5 @@ if [[ "$SHOULD_BUILD" == "yes" ]]; then . ../create_appimage.sh fi - kill $KA_PID - cd .. fi diff --git a/check_tags.sh b/check_tags.sh index b1e0c05..b5e383d 100755 --- a/check_tags.sh +++ b/check_tags.sh @@ -1,10 +1,14 @@ #!/bin/bash -REPOSITORY=${TRAVIS_REPO_SLUG:-"VSCodium/vscodium"} +set -e + +if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + REPOSITORY=$GITHUB_REPOSITORY +else + REPOSITORY=${TRAVIS_REPO_SLUG:-"VSCodium/vscodium"} +fi GITHUB_RESPONSE=$(curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/$REPOSITORY/releases/tags/$LATEST_MS_TAG) -echo "Github response: ${GITHUB_RESPONSE}" VSCODIUM_ASSETS=$(echo $GITHUB_RESPONSE | jq '.assets') -echo "VSCodium assets: ${VSCODIUM_ASSETS}" # if we just don't have the github token, get out fast if [ "$GITHUB_TOKEN" != "" ]; then diff --git a/create_dmg.sh b/create_dmg.sh index 07106df..c100ebf 100755 --- a/create_dmg.sh +++ b/create_dmg.sh @@ -1,8 +1,10 @@ #!/bin/bash +set -x + if [[ "$SHOULD_BUILD" == "yes" ]]; then if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cd VSCode-darwin - create-dmg VSCodium.app .. + npx create-dmg VSCodium.app .. mv "../VSCodium ${LATEST_MS_TAG}.dmg" "../VSCodium.${LATEST_MS_TAG}.dmg" fi cd .. diff --git a/create_zip.sh b/create_zip.sh index a207531..98eb22b 100755 --- a/create_zip.sh +++ b/create_zip.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -ex + if [[ "$SHOULD_BUILD" == "yes" ]]; then if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cd VSCode-darwin diff --git a/get_repo.sh b/get_repo.sh index d859e01..047cf33 100755 --- a/get_repo.sh +++ b/get_repo.sh @@ -1,15 +1,10 @@ #!/bin/bash -if [ -d vscode ]; then - cd vscode - git fetch --all -else - git clone https://github.com/Microsoft/vscode.git - cd vscode -fi - -export LATEST_MS_COMMIT=$(git rev-list --tags --max-count=1) -export LATEST_MS_TAG=$(git describe --tags ${LATEST_MS_COMMIT}) +# figure out latest tag by calling MS update API +UPDATE_INFO=$(curl https://update.code.visualstudio.com/api/update/darwin/stable/lol) +export LATEST_MS_COMMIT=$(echo $UPDATE_INFO | jq -r '.version') +export LATEST_MS_TAG=$(echo $UPDATE_INFO | jq -r '.name') echo "Got the latest MS tag: ${LATEST_MS_TAG}" -git checkout $LATEST_MS_TAG -cd .. + +git clone https://github.com/Microsoft/vscode.git --branch $LATEST_MS_TAG --depth 1 + diff --git a/install_deps.sh b/install_deps.sh index b36f5bd..0d4f945 100755 --- a/install_deps.sh +++ b/install_deps.sh @@ -1,13 +1,9 @@ #!/bin/bash -if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - brew update - brew install jq zip -else - sudo apt-get update - sudo apt-get install -y fakeroot jq - triplet= - case $BUILDARCH in +sudo apt-get update +sudo apt-get install -y fakeroot jq +triplet= +case $BUILDARCH in arm) arch=armhf triplet=arm-linux-gnueabihf @@ -17,25 +13,24 @@ else arch=arm64 triplet=aarch64-linux-gnu ;; - esac +esac - if [[ -n "$triplet" ]]; then - sed 's/^deb /deb [arch=amd64] '/g -i /etc/apt/sources.list - echo "deb [arch=$arch] http://ports.ubuntu.com/ubuntu-ports/ trusty main" | sudo tee -a /etc/apt/sources.list.d/$arch.list >/dev/null - sudo dpkg --add-architecture $arch - sudo apt-get update - sudo apt-get install libc6-dev-$arch-cross gcc-$triplet g++-$triplet `apt-cache search x11proto | grep ^x11proto | cut -f 1 -d ' '` xz-utils pkg-config - mkdir -p dl - cd dl - apt-get download libx11-dev:$arch libx11-6:$arch libxkbfile-dev:$arch libxkbfile1:$arch libxau-dev:$arch libxdmcp-dev:$arch libxcb1-dev:$arch libsecret-1-dev:$arch libsecret-1-0:$arch libpthread-stubs0-dev:$arch libglib2.0-dev:$arch libglib2.0-0:$arch libffi-dev:$arch libffi6:$arch zlib1g:$arch libpcre3-dev:$arch libpcre3:$arch - for i in *.deb; do ar x $i; sudo tar -C / -xf data.tar.*; rm -f data.tar.*; done - cd .. - export CC=/usr/bin/$triplet-gcc - export CXX=/usr/bin/$triplet-g++ - export CC_host=/usr/bin/gcc - export CXX_host=/usr/bin/g++ - export PKG_CONFIG_LIBDIR=/usr/lib/$triplet/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig - else - sudo apt-get install libx11-dev libxkbfile-dev libsecret-1-dev rpm - fi +if [[ -n "$triplet" ]]; then + sed 's/^deb /deb [arch=amd64] '/g -i /etc/apt/sources.list + echo "deb [arch=$arch] http://ports.ubuntu.com/ubuntu-ports/ trusty main" | sudo tee -a /etc/apt/sources.list.d/$arch.list >/dev/null + sudo dpkg --add-architecture $arch + sudo apt-get update + sudo apt-get install libc6-dev-$arch-cross gcc-$triplet g++-$triplet `apt-cache search x11proto | grep ^x11proto | cut -f 1 -d ' '` xz-utils pkg-config + mkdir -p dl + cd dl + apt-get download libx11-dev:$arch libx11-6:$arch libxkbfile-dev:$arch libxkbfile1:$arch libxau-dev:$arch libxdmcp-dev:$arch libxcb1-dev:$arch libsecret-1-dev:$arch libsecret-1-0:$arch libpthread-stubs0-dev:$arch libglib2.0-dev:$arch libglib2.0-0:$arch libffi-dev:$arch libffi6:$arch zlib1g:$arch libpcre3-dev:$arch libpcre3:$arch + for i in *.deb; do ar x $i; sudo tar -C / -xf data.tar.*; rm -f data.tar.*; done + cd .. + export CC=/usr/bin/$triplet-gcc + export CXX=/usr/bin/$triplet-g++ + export CC_host=/usr/bin/gcc + export CXX_host=/usr/bin/g++ + export PKG_CONFIG_LIBDIR=/usr/lib/$triplet/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig +else + sudo apt-get install libx11-dev libxkbfile-dev libsecret-1-dev rpm fi diff --git a/prepare_vscode.sh b/prepare_vscode.sh index 0cce3bd..70488a1 100755 --- a/prepare_vscode.sh +++ b/prepare_vscode.sh @@ -1,7 +1,11 @@ #!/bin/bash -export npm_config_arch="$BUILDARCH" -export npm_config_target_arch="$BUILDARCH" +set -e + +if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then + export npm_config_arch="$BUILDARCH" + export npm_config_target_arch="$BUILDARCH" +fi cp -rp src/* vscode/ cd vscode || exit @@ -11,8 +15,13 @@ cd vscode || exit # apply patches patch -u src/vs/platform/update/electron-main/updateService.win32.ts -i ../patches/update-cache-path.patch -yarn --frozen-lockfile -yarn postinstall +if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + CHILD_CONCURRENCY=1 yarn --frozen-lockfile --ignore-optional + npm_config_argv='{"original":["--ignore-optional"]}' yarn postinstall +else + CHILD_CONCURRENCY=1 yarn --frozen-lockfile + yarn postinstall +fi if [[ "$BUILDARCH" == *"arm"* ]]; then sed -i -z 's/,\n[^\n]*arm[^\n]*//' node_modules/vscode-sqlite3/binding.gyp @@ -66,3 +75,5 @@ if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then # we need to edit a line in the post install template sed -i "s/code-oss/codium/" resources/linux/debian/postinst.template fi + +cd .. diff --git a/src/vs/base/test/node/encoding/fixtures/some.json.png b/src/vs/base/test/node/encoding/fixtures/some.json.png deleted file mode 100644 index 995a327..0000000 --- a/src/vs/base/test/node/encoding/fixtures/some.json.png +++ /dev/null @@ -1,11 +0,0 @@ -{ - "type": "typescript", - - "sources": [ - "examples/company.ts", - "examples/conway.ts", - "examples/employee.ts", - "examples/large.ts", - "examples/small.ts" - ] -} \ No newline at end of file diff --git a/src/vs/base/test/node/encoding/fixtures/some.xml.png b/src/vs/base/test/node/encoding/fixtures/some.xml.png deleted file mode 100644 index 1a5b8e2..0000000 --- a/src/vs/base/test/node/encoding/fixtures/some.xml.png +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/vs/workbench/browser/parts/titlebar/media/code-icon.svg b/src/vs/workbench/browser/parts/titlebar/media/code-icon.svg deleted file mode 100644 index cff7b8a..0000000 --- a/src/vs/workbench/browser/parts/titlebar/media/code-icon.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/src/vs/workbench/contrib/update/browser/media/code-icon.svg b/src/vs/workbench/contrib/update/browser/media/code-icon.svg deleted file mode 100644 index cff7b8a..0000000 --- a/src/vs/workbench/contrib/update/browser/media/code-icon.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/src/vs/workbench/contrib/welcome/code-icon.svg b/src/vs/workbench/contrib/welcome/code-icon.svg deleted file mode 100644 index cff7b8a..0000000 --- a/src/vs/workbench/contrib/welcome/code-icon.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/update_version.sh b/update_version.sh index 4610ecf..ff0aef5 100755 --- a/update_version.sh +++ b/update_version.sh @@ -34,7 +34,7 @@ if [[ "$CI_WINDOWS" == "True" ]]; then git config --global core.autocrlf true else # TRAVIS_REPO_SLUG = e.g. VSCodium/vscodium - VERSIONS_REPO=$(echo ${TRAVIS_REPO_SLUG} | awk -F"/" '{ print $1 }')/versions + VERSIONS_REPO=$(echo ${TRAVIS_REPO_SLUG:-${GITHUB_REPOSITORY}} | awk -F"/" '{ print $1 }')/versions fi # generateJson diff --git a/win32-build.yml b/win32-build.yml index a2d9287..e67939f 100644 --- a/win32-build.yml +++ b/win32-build.yml @@ -1,12 +1,7 @@ steps: - task: NodeTool@0 inputs: - versionSpec: "12.13.0" -- script: | - choco install jq - displayName: 'install jq from choco' -- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2 - displayName: 'Install Yarn' + versionSpec: "12.14.1" - task: UsePythonVersion@0 displayName: 'Use Python 2.x' inputs: @@ -27,9 +22,6 @@ steps: filePath: 'check_tags.ps1' env: MAPPED_GITHUB_TOKEN: $(GITHUB_TOKEN) -- script: | - git -C vscode status - displayName: 'vscode status' - powershell: | bash ./build.sh displayName: 'go build it!'