Compare commits

...

12 Commits

Author SHA1 Message Date
Pavlo Rudy
b0ff3b4f34 re-disable telemetry; closes #872 (#883) 2021-10-19 20:55:44 +02:00
Baptiste Augrain
ca2dc5fcaf feat: remove use of lfs (#881) 2021-10-17 02:20:08 +02:00
Simon Sobisch
962326e182 Merge pull request #871 from GitMensch/msi
license conversion txt2rtf
2021-10-16 21:04:01 +02:00
Simon Sobisch
d3371f8aab license conversion txt2rtf
directly via shell as neither special escaping nor conversion are necessary
2021-10-16 21:01:37 +02:00
Baptiste Augrain
0f5a7d4a1b fix(1.61): update github authentication patch (#866) 2021-10-08 23:14:50 +02:00
Baptiste Augrain
02cc193086 fix: check of armhf's rpm is corrected (#860) 2021-10-01 19:21:07 +02:00
Baptiste Augrain
e564685c1e feat: selective publish (#858) 2021-10-01 18:47:10 +02:00
Baptiste Augrain
85cbd0b0f2 fix: remove macos arm64 build (#851) 2021-09-20 09:25:00 +02:00
Baptiste Augrain
b748657b09 feat: add arm64 on macos build (#848) 2021-09-18 10:12:10 +02:00
Baptiste Augrain
db02ad1133 feat: remove CORS validation patch (#845) 2021-09-17 23:25:34 +02:00
Baptiste Augrain
573c0230c5 fix(linux): add shell attribute to the AppImage can be copied (#844) 2021-09-15 23:04:58 +02:00
Baptiste Augrain
bb483f44e2 fix(linux): correctly check if the AppImage has been built (#843) 2021-09-15 22:28:27 +02:00
17 changed files with 564 additions and 490 deletions

22
.editorconfig Normal file
View File

@@ -0,0 +1,22 @@
root = true
[*]
indent_style = space
indent_size = 2
tab_width = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.sh]
indent_style = space
indent_size = 2
[*.{yml,yaml}]
indent_style = space
indent_size = 2
[*.patch]
trim_trailing_whitespace = false
insert_final_newline = false

1
.gitattributes vendored
View File

@@ -1 +0,0 @@
*.zip filter=lfs diff=lfs merge=lfs -text

View File

@@ -20,7 +20,6 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
vscode_arch: [x64, arm64, armhf]
include: include:
- vscode_arch: x64 - vscode_arch: x64
npm_arch: x64 npm_arch: x64
@@ -35,6 +34,9 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install GH
run: ./install_gh.sh
- name: Setup Node.js environment - name: Setup Node.js environment
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
@@ -43,12 +45,12 @@ jobs:
- name: Install Yarn - name: Install Yarn
run: npm install -g yarn run: npm install -g yarn
- name: Check PR or cron
run: ./check_cron_or_pr.sh
- name: Clone VSCode repo - name: Clone VSCode repo
run: ./get_repo.sh run: ./get_repo.sh
- name: Check PR or cron
run: ./check_cron_or_pr.sh
- name: Check existing VSCodium tags/releases - name: Check existing VSCodium tags/releases
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -80,41 +82,15 @@ jobs:
run: ./build.sh run: ./build.sh
if: env.SHOULD_BUILD == 'yes' if: env.SHOULD_BUILD == 'yes'
- name: Zip release - name: Prepare artifacts
run: | run: ./prepare_artifacts.sh
cd VSCode-linux-${VSCODE_ARCH}
tar czf ../VSCodium-linux-${VSCODE_ARCH}-${MS_TAG}.tar.gz .
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
- name: Move/rename build artifacts
run: |
cp vscode/.build/linux/deb/*/deb/*.deb .
cp vscode/.build/linux/rpm/*/*.rpm .
if [[ "${VSCODE_ARCH}" == "x64" ]]; then
cp build/linux/appimage/out/*.AppImage* .
fi
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
- name: Generate shasums
run: ./sum.sh
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
- name: Release - name: Release
uses: softprops/action-gh-release@v1
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
with:
tag_name: ${{ env.MS_TAG }}
files: |
./*.sha256
./*.zip
./*.tar.gz
./*.deb
./*.rpm
./VSCodium-*.AppImage
./VSCodium-*.AppImage.zsync
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_CLI_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./release.sh
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
- name: Update versions repo - name: Update versions repo
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'

View File

@@ -10,10 +10,21 @@ on:
jobs: jobs:
build: build:
runs-on: macOS-latest runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- vscode_arch: x64
os: macOS-10.15
# - vscode_arch: arm64
# os: macOS-11
env: env:
OS_NAME: "osx" OS_NAME: "osx"
VSCODE_ARCH: "x64" VSCODE_ARCH: ${{ matrix.vscode_arch }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@@ -22,19 +33,16 @@ jobs:
with: with:
node-version: 14 node-version: 14
- name: Check PR or cron
run: |
. check_cron_or_pr.sh
- name: Clone VSCode repo - name: Clone VSCode repo
run: | run: . get_repo.sh
. get_repo.sh
- name: Check PR or cron
run: . check_cron_or_pr.sh
- name: Check existing VSCodium tags/releases - name: Check existing VSCodium tags/releases
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: . check_tags.sh
. check_tags.sh
if: env.SHOULD_DEPLOY == 'yes' if: env.SHOULD_DEPLOY == 'yes'
- name: Compute cache key - name: Compute cache key
@@ -81,35 +89,15 @@ jobs:
codesign --deep --force --verbose --sign "$CERTIFICATE_OSX_ID" VSCodium.app codesign --deep --force --verbose --sign "$CERTIFICATE_OSX_ID" VSCodium.app
fi fi
- name: Zip release - name: Prepare artifacts
run: | run: ./prepare_artifacts.sh
cd "VSCode-darwin-${VSCODE_ARCH}"
zip -r -X -y ../VSCodium-darwin-${VSCODE_ARCH}-${MS_TAG}.zip ./*.app
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
- name: DMG the release
run: |
pushd "VSCode-darwin-${VSCODE_ARCH}"
npx create-dmg VSCodium.app ..
mv "../VSCodium ${MS_TAG}.dmg" "../VSCodium.${VSCODE_ARCH}.${MS_TAG}.dmg"
popd
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
- name: Generate shasums
run: ./sum.sh
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
- name: Release - name: Release
uses: softprops/action-gh-release@v1
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
with:
tag_name: ${{ env.MS_TAG }}
files: |
./*.zip
./*.dmg
./*.sha256
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_CLI_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./release.sh
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
- name: Update versions repo - name: Update versions repo
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'

View File

@@ -11,6 +11,9 @@ on:
jobs: jobs:
windows: windows:
runs-on: windows-2016 runs-on: windows-2016
defaults:
run:
shell: bash
env: env:
VSCODE_ARCH: ${{ matrix.vscode_arch }} VSCODE_ARCH: ${{ matrix.vscode_arch }}
OS_NAME: 'windows' OS_NAME: 'windows'
@@ -20,13 +23,7 @@ jobs:
vscode_arch: [x64, ia32, arm64] vscode_arch: [x64, ia32, arm64]
steps: steps:
- name: Checkout github repo (+ download lfs dependencies) - uses: actions/checkout@v2
uses: actions/checkout@v2
with:
lfs: true
- name: Checkout LFS objects
run: git lfs checkout
- name: Setup Node.js environment - name: Setup Node.js environment
uses: actions/setup-node@v1 uses: actions/setup-node@v1
@@ -41,19 +38,16 @@ jobs:
with: with:
python-version: '2.x' python-version: '2.x'
- name: Check PR or cron
run: ./check_cron_or_pr.sh
shell: bash
- name: Clone VSCode repo - name: Clone VSCode repo
run: ./get_repo.sh run: ./get_repo.sh
shell: bash
- name: Check PR or cron
run: ./check_cron_or_pr.sh
- name: Check existing VSCodium tags/releases - name: Check existing VSCodium tags/releases
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./check_tags.sh run: ./check_tags.sh
shell: bash
if: env.SHOULD_DEPLOY == 'yes' if: env.SHOULD_DEPLOY == 'yes'
- name: Compute cache key - name: Compute cache key
@@ -80,45 +74,21 @@ jobs:
npm_config_arch: ${{ matrix.vscode_arch }} npm_config_arch: ${{ matrix.vscode_arch }}
npm_config_target_arch: ${{ matrix.vscode_arch }} npm_config_target_arch: ${{ matrix.vscode_arch }}
run: ./build.sh run: ./build.sh
shell: bash
if: env.SHOULD_BUILD == 'yes' if: env.SHOULD_BUILD == 'yes'
- name: Move/rename build artifacts - name: Prepare artifacts
run: | run: ./prepare_artifacts.sh
mv vscode\\.build\\win32-${VSCODE_ARCH}\\system-setup\\VSCodeSetup.exe VSCodiumSetup-${VSCODE_ARCH}-${MS_TAG}.exe
mv vscode\\.build\\win32-${VSCODE_ARCH}\\user-setup\\VSCodeSetup.exe VSCodiumUserSetup-${VSCODE_ARCH}-${MS_TAG}.exe
mv vscode\\.build\\win32-${VSCODE_ARCH}\\archive\\VSCode-win32-${VSCODE_ARCH}.zip VSCodium-win32-${VSCODE_ARCH}-${MS_TAG}.zip
if [[ "${VSCODE_ARCH}" == "ia32" || "${VSCODE_ARCH}" == "x64" ]]; then
mv build\\windows\\msi\\releasedir\\VSCodium-${VSCODE_ARCH}-${MS_TAG}.msi .
mv build\\windows\\msi\\releasedir\\VSCodium-${VSCODE_ARCH}-updates-disabled-${MS_TAG}.msi .
fi
shell: bash
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
- name: Generate shasums
run: ./sum.sh
shell: bash
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
- name: Release - name: Release
uses: softprops/action-gh-release@v1
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
with:
tag_name: ${{ env.MS_TAG }}
files: |
./*.sha256
./VSCodium*.zip
./VSCodiumUserSetup*.exe
./VSCodiumSetup*.exe
./VSCodium*.msi
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_CLI_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./release.sh
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
- name: Update versions repo - name: Update versions repo
if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes' if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
run: ./update_version.sh run: ./update_version.sh
shell: bash
env: env:
GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }}
GITHUB_USERNAME: ${{ github.repository_owner }} GITHUB_USERNAME: ${{ github.repository_owner }}

View File

@@ -2,7 +2,7 @@
set -ex set -ex
if [[ "$SHOULD_BUILD" == "yes" ]]; then if [[ "${SHOULD_BUILD}" == "yes" ]]; then
npm config set scripts-prepend-node-path true npm config set scripts-prepend-node-path true
echo "MS_COMMIT: ${MS_COMMIT}" echo "MS_COMMIT: ${MS_COMMIT}"
@@ -19,31 +19,53 @@ if [[ "$SHOULD_BUILD" == "yes" ]]; then
yarn gulp compile-extensions-build yarn gulp compile-extensions-build
yarn gulp minify-vscode yarn gulp minify-vscode
if [[ "$OS_NAME" == "osx" ]]; then if [[ "${OS_NAME}" == "osx" ]]; then
yarn gulp "vscode-darwin-${VSCODE_ARCH}-min-ci" yarn gulp "vscode-darwin-${VSCODE_ARCH}-min-ci"
elif [[ "$OS_NAME" == "windows" ]]; then elif [[ "${OS_NAME}" == "windows" ]]; then
. ../build/windows/rtf/make.sh . ../build/windows/rtf/make.sh
yarn gulp "vscode-win32-${VSCODE_ARCH}-min-ci" yarn gulp "vscode-win32-${VSCODE_ARCH}-min-ci"
yarn gulp "vscode-win32-${VSCODE_ARCH}-code-helper" yarn gulp "vscode-win32-${VSCODE_ARCH}-code-helper"
yarn gulp "vscode-win32-${VSCODE_ARCH}-inno-updater" yarn gulp "vscode-win32-${VSCODE_ARCH}-inno-updater"
if [[ "${SHOULD_BUILD_ZIP}" != "no" ]]; then
yarn gulp "vscode-win32-${VSCODE_ARCH}-archive" yarn gulp "vscode-win32-${VSCODE_ARCH}-archive"
fi
if [[ "${SHOULD_BUILD_EXE_SYS}" != "no" ]]; then
yarn gulp "vscode-win32-${VSCODE_ARCH}-system-setup" yarn gulp "vscode-win32-${VSCODE_ARCH}-system-setup"
fi
if [[ "${SHOULD_BUILD_EXE_USR}" != "no" ]]; then
yarn gulp "vscode-win32-${VSCODE_ARCH}-user-setup" yarn gulp "vscode-win32-${VSCODE_ARCH}-user-setup"
fi
if [[ "${VSCODE_ARCH}" == "ia32" || "${VSCODE_ARCH}" == "x64" ]]; then if [[ "${VSCODE_ARCH}" == "ia32" || "${VSCODE_ARCH}" == "x64" ]]; then
if [[ "${SHOULD_BUILD_MSI}" != "no" ]]; then
. ../build/windows/msi/build.sh . ../build/windows/msi/build.sh
fi
if [[ "${SHOULD_BUILD_MSI_NOUP}" != "no" ]]; then
. ../build/windows/msi/build-updates-disabled.sh . ../build/windows/msi/build-updates-disabled.sh
fi fi
fi
else # linux else # linux
yarn gulp "vscode-linux-${VSCODE_ARCH}-min-ci" yarn gulp "vscode-linux-${VSCODE_ARCH}-min-ci"
if [[ "$SKIP_LINUX_PACKAGES" != "True" ]]; then
yarn gulp "vscode-linux-${VSCODE_ARCH}-build-deb"
yarn gulp "vscode-linux-${VSCODE_ARCH}-build-rpm"
if [[ "${SKIP_LINUX_PACKAGES}" != "True" ]]; then
if [[ "${SHOULD_BUILD_DEB}" != "no" || "${SHOULD_BUILD_APPIMAGE}" != "no" ]]; then
yarn gulp "vscode-linux-${VSCODE_ARCH}-build-deb"
fi
if [[ "${SHOULD_BUILD_RPM}" != "no" ]]; then
yarn gulp "vscode-linux-${VSCODE_ARCH}-build-rpm"
fi
if [[ "${SHOULD_BUILD_APPIMAGE}" != "no" ]]; then
. ../build/linux/appimage/build.sh . ../build/linux/appimage/build.sh
fi fi
fi fi
fi
cd .. cd ..
fi fi

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c3eac997fba9d3d5596c503a826fe5d54c87b1cf899a790b6d077e4d196bd5e9
size 373978

View File

@@ -1,15 +1,20 @@
#!/bin/bash #!/bin/bash
set -ex cd "$( dirname "${BASH_SOURCE[0]}" )"/../../../vscode
CALLER_DIR=$( pwd ) input=LICENSE.txt
target=LICENSE.rtf
cd "$( dirname "${BASH_SOURCE[0]}" )" cat - >$target <<_EOF
{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Consolas;}}
\viewkind4\uc1\pard\lang1033\f0\fs22
7z x -y TXT2RTF.zip _EOF
LICENSE=$( powershell.exe -Command "[System.IO.Path]::GetFullPath( '../../../vscode/LICENSE.txt' )" ) sed -zE -e 's/([A-Za-z,])\r?\n([A-Za-z])/\1 \2/g' -e 's/\r?\n\r?\n/\\par\n\n/g' -e 's/(\\par\n)/\\line\1/g' -e 's/\s*(Copyright)/\\line\n\1/g' -e 's/(\\par)\\line/\1\n/g' $input >> $target
"./TXT to RTF Converter.exe" "${LICENSE}"
cd "${CALLER_DIR}" cat - >>$target <<_EOF
\par
}
_EOF

View File

@@ -2,143 +2,259 @@
set -e set -e
if [[ -z "${GITHUB_TOKEN}" ]]; then
echo "Will not build because no GITHUB_TOKEN defined"
exit
fi
REPOSITORY="${GITHUB_REPOSITORY:-"VSCodium/vscodium"}" REPOSITORY="${GITHUB_REPOSITORY:-"VSCodium/vscodium"}"
GITHUB_RESPONSE=$( curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/$REPOSITORY/releases/tags/$MS_TAG) GITHUB_RESPONSE=$( curl -s -H "Authorization: token ${GITHUB_TOKEN}" https://api.github.com/repos/${REPOSITORY}/releases/tags/${MS_TAG})
VSCODIUM_ASSETS=$( echo $GITHUB_RESPONSE | jq -c '.assets | map(.name)?' ) VSCODIUM_ASSETS=$( echo "${GITHUB_RESPONSE}" | jq -c '.assets | map(.name)?' )
contains() { contains() {
# add " to match the end of a string so any hashs won't be matched by mistake # add " to match the end of a string so any hashs won't be matched by mistake
echo $VSCODIUM_ASSETS | grep "$1\"" echo "${VSCODIUM_ASSETS}" | grep "$1\""
} }
# if we just don't have the github token, get out fast if [ "${VSCODIUM_ASSETS}" != "null" ]; then
if [ "$GITHUB_TOKEN" != "" ]; then
if [ "$VSCODIUM_ASSETS" != "null" ]; then
# macos # macos
if [[ "$OS_NAME" == "osx" ]]; then if [[ "${OS_NAME}" == "osx" ]]; then
if [[ -z $( contains "darwin-$VSCODE_ARCH-$MS_TAG.zip" ) ]]; then if [[ -z $( contains "darwin-${VSCODE_ARCH}-${MS_TAG}.zip" ) ]]; then
echo "Building on Mac because we have no ZIP" echo "Building on MacOS because we have no ZIP"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_ZIP="no"
fi fi
elif [[ "$OS_NAME" == "windows" ]]; then
if [[ -z $( contains ".${VSCODE_ARCH}.${MS_TAG}.dmg" ) ]]; then
echo "Building on MacOS because we have no DMG"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_DMG="no"
fi
if [[ "${SHOULD_BUILD}" != "yes" ]]; then
echo "Already have all the MacOS builds"
fi
elif [[ "${OS_NAME}" == "windows" ]]; then
# windows-arm64 # windows-arm64
if [[ $VSCODE_ARCH == "arm64" ]]; then if [[ ${VSCODE_ARCH} == "arm64" ]]; then
if [[ -z $( contains "VSCodiumSetup-$VSCODE_ARCH-$MS_TAG.exe" ) ]]; then if [[ -z $( contains "VSCodiumSetup-${VSCODE_ARCH}-${MS_TAG}.exe" ) ]]; then
echo "Building on Windows arm64 because we have no system setup" echo "Building on Windows arm64 because we have no system setup"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_EXE_SYS="no"
fi fi
if [[ -z $( contains "UserSetup-$VSCODE_ARCH-$MS_TAG.exe" ) ]]; then
if [[ -z $( contains "UserSetup-${VSCODE_ARCH}-${MS_TAG}.exe" ) ]]; then
echo "Building on Windows arm64 because we have no user setup" echo "Building on Windows arm64 because we have no user setup"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_EXE_USR="no"
fi fi
if [[ -z $( contains "win32-$VSCODE_ARCH-$MS_TAG.zip" ) ]]; then
if [[ -z $( contains "win32-${VSCODE_ARCH}-${MS_TAG}.zip" ) ]]; then
echo "Building on Windows arm64 because we have no zip" echo "Building on Windows arm64 because we have no zip"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_ZIP="no"
fi fi
if [[ "$SHOULD_BUILD" != "yes" ]]; then
if [[ "${SHOULD_BUILD}" != "yes" ]]; then
echo "Already have all the Windows arm64 builds" echo "Already have all the Windows arm64 builds"
fi fi
# windows-ia32 # windows-ia32
elif [[ $VSCODE_ARCH == "ia32" ]]; then elif [[ ${VSCODE_ARCH} == "ia32" ]]; then
if [[ -z $( contains "VSCodiumSetup-$VSCODE_ARCH-$MS_TAG.exe" ) ]]; then if [[ -z $( contains "VSCodiumSetup-${VSCODE_ARCH}-${MS_TAG}.exe" ) ]]; then
echo "Building on Windows ia32 because we have no system setup" echo "Building on Windows ia32 because we have no system setup"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_EXE_SYS="no"
fi fi
if [[ -z $( contains "UserSetup-$VSCODE_ARCH-$MS_TAG.exe" ) ]]; then
if [[ -z $( contains "UserSetup-${VSCODE_ARCH}-${MS_TAG}.exe" ) ]]; then
echo "Building on Windows ia32 because we have no user setup" echo "Building on Windows ia32 because we have no user setup"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_EXE_USR="no"
fi fi
if [[ -z $( contains "win32-$VSCODE_ARCH-$MS_TAG.zip" ) ]]; then
if [[ -z $( contains "win32-${VSCODE_ARCH}-${MS_TAG}.zip" ) ]]; then
echo "Building on Windows ia32 because we have no zip" echo "Building on Windows ia32 because we have no zip"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_ZIP="no"
fi fi
if [[ -z $( contains "VSCodium-$VSCODE_ARCH-$MS_TAG.msi" ) ]]; then
if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-${MS_TAG}.msi" ) ]]; then
echo "Building on Windows ia32 because we have no msi" echo "Building on Windows ia32 because we have no msi"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_MSI="no"
fi fi
if [[ -z $( contains "VSCodium-$VSCODE_ARCH-updates-disabled-$MS_TAG.msi" ) ]]; then
if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-updates-disabled-${MS_TAG}.msi" ) ]]; then
echo "Building on Windows ia32 because we have no updates-disabled msi" echo "Building on Windows ia32 because we have no updates-disabled msi"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_MSI_NOUP="no"
fi fi
if [[ "$SHOULD_BUILD" != "yes" ]]; then
if [[ "${SHOULD_BUILD}" != "yes" ]]; then
echo "Already have all the Windows ia32 builds" echo "Already have all the Windows ia32 builds"
fi fi
# windows-x64 # windows-x64
else else
if [[ -z $( contains "VSCodiumSetup-$VSCODE_ARCH-$MS_TAG.exe" ) ]]; then if [[ -z $( contains "VSCodiumSetup-${VSCODE_ARCH}-${MS_TAG}.exe" ) ]]; then
echo "Building on Windows x64 because we have no system setup" echo "Building on Windows x64 because we have no system setup"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_EXE_SYS="no"
fi fi
if [[ -z $( contains "UserSetup-$VSCODE_ARCH-$MS_TAG.exe" ) ]]; then
if [[ -z $( contains "UserSetup-${VSCODE_ARCH}-${MS_TAG}.exe" ) ]]; then
echo "Building on Windows x64 because we have no user setup" echo "Building on Windows x64 because we have no user setup"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_EXE_USR="no"
fi fi
if [[ -z $( contains "win32-$VSCODE_ARCH-$MS_TAG.zip" ) ]]; then
if [[ -z $( contains "win32-${VSCODE_ARCH}-${MS_TAG}.zip" ) ]]; then
echo "Building on Windows x64 because we have no zip" echo "Building on Windows x64 because we have no zip"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_ZIP="no"
fi fi
if [[ -z $( contains "VSCodium-$VSCODE_ARCH-$MS_TAG.msi" ) ]]; then
if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-${MS_TAG}.msi" ) ]]; then
echo "Building on Windows x64 because we have no msi" echo "Building on Windows x64 because we have no msi"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_MSI="no"
fi fi
if [[ -z $( contains "VSCodium-$VSCODE_ARCH-updates-disabled-$MS_TAG.msi" ) ]]; then
if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-updates-disabled-${MS_TAG}.msi" ) ]]; then
echo "Building on Windows x64 because we have no updates-disabled msi" echo "Building on Windows x64 because we have no updates-disabled msi"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_MSI_NOUP="no"
fi fi
if [[ "$SHOULD_BUILD" != "yes" ]]; then
if [[ "${SHOULD_BUILD}" != "yes" ]]; then
echo "Already have all the Windows x64 builds" echo "Already have all the Windows x64 builds"
fi fi
fi fi
elif [[ "$OS_NAME" == "linux" ]]; then elif [[ "${OS_NAME}" == "linux" ]]; then
# linux-arm64 # linux-arm64
if [[ $VSCODE_ARCH == "arm64" ]]; then if [[ ${VSCODE_ARCH} == "arm64" ]]; then
if [[ -z $( contains "arm64.deb" ) ]]; then if [[ -z $( contains "arm64.deb" ) ]]; then
echo "Building on Linux arm64 because we have no DEB" echo "Building on Linux arm64 because we have no DEB"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_DEB="no"
fi fi
if [[ -z $( contains "arm64-$MS_TAG.tar.gz" ) ]]; then
if [[ -z $( contains "aarch64.rpm" ) ]]; then
echo "Building on Linux arm64 because we have no RPM"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_RPM="no"
fi
if [[ -z $( contains "arm64-${MS_TAG}.tar.gz" ) ]]; then
echo "Building on Linux arm64 because we have no TAR" echo "Building on Linux arm64 because we have no TAR"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_TAR="no"
fi fi
if [[ "$SHOULD_BUILD" != "yes" ]]; then
export SHOULD_BUILD_APPIMAGE="no"
if [[ "${SHOULD_BUILD}" != "yes" ]]; then
echo "Already have all the Linux arm64 builds" echo "Already have all the Linux arm64 builds"
fi fi
# linux-armhf # linux-armhf
elif [[ $VSCODE_ARCH == "armhf" ]]; then elif [[ ${VSCODE_ARCH} == "armhf" ]]; then
if [[ -z $( contains "armhf.deb" ) ]]; then if [[ -z $( contains "armhf.deb" ) ]]; then
echo "Building on Linux arm because we have no DEB" echo "Building on Linux arm because we have no DEB"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_DEB="no"
fi fi
if [[ -z $( contains "armv7hl.rpm" ) ]]; then
echo "Building on Linux arm because we have no RPM"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_RPM="no"
fi
if [[ -z $( contains "armhf-${MS_TAG}.tar.gz" ) ]]; then if [[ -z $( contains "armhf-${MS_TAG}.tar.gz" ) ]]; then
echo "Building on Linux arm because we have no TAR" echo "Building on Linux arm because we have no TAR"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_TAR="no"
fi fi
if [[ "$SHOULD_BUILD" != "yes" ]]; then
export SHOULD_BUILD_APPIMAGE="no"
if [[ "${SHOULD_BUILD}" != "yes" ]]; then
echo "Already have all the Linux arm builds" echo "Already have all the Linux arm builds"
fi fi
# linux-x64 # linux-x64
else else
if [[ -z $( contains "x86_64.rpm" ) ]]; then
echo "Building on Linux x64 because we have no RPM"
export SHOULD_BUILD="yes"
fi
if [[ -z $( contains "amd64.deb" ) ]]; then if [[ -z $( contains "amd64.deb" ) ]]; then
echo "Building on Linux x64 because we have no DEB" echo "Building on Linux x64 because we have no DEB"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_DEB="no"
fi fi
if [[ -z $( contains "x64-$MS_TAG.tar.gz" ) ]]; then
if [[ -z $( contains "x86_64.rpm" ) ]]; then
echo "Building on Linux x64 because we have no RPM"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_RPM="no"
fi
if [[ -z $( contains "x64-${MS_TAG}.tar.gz" ) ]]; then
echo "Building on Linux x64 because we have no TAR" echo "Building on Linux x64 because we have no TAR"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_TAR="no"
fi fi
if [[ "$SHOULD_BUILD" != "yes" ]]; then
if [[ -z $( contains "x86_64.AppImage" ) ]]; then
echo "Building on Linux x64 because we have no AppImage"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_APPIMAGE="no"
fi
if [[ "${SHOULD_BUILD}" != "yes" ]]; then
echo "Already have all the Linux x64 builds" echo "Already have all the Linux x64 builds"
fi fi
fi fi
fi fi
else else
echo "Release assets do not exist at all, continuing build" echo "Release assets do not exist at all, continuing build"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
fi
fi fi
echo "SHOULD_BUILD=$SHOULD_BUILD" >> $GITHUB_ENV echo "SHOULD_BUILD=${SHOULD_BUILD}" >> "${GITHUB_ENV}"
echo "SHOULD_BUILD_APPIMAGE=${SHOULD_BUILD_APPIMAGE}" >> "${GITHUB_ENV}"
echo "SHOULD_BUILD_DEB=${SHOULD_BUILD_DEB}" >> "${GITHUB_ENV}"
echo "SHOULD_BUILD_DMG=${SHOULD_BUILD_DMG}" >> "${GITHUB_ENV}"
echo "SHOULD_BUILD_EXE_SYS=${SHOULD_BUILD_EXE_SYS}" >> "${GITHUB_ENV}"
echo "SHOULD_BUILD_EXE_USR=${SHOULD_BUILD_EXE_USR}" >> "${GITHUB_ENV}"
echo "SHOULD_BUILD_MSI=${SHOULD_BUILD_MSI}" >> "${GITHUB_ENV}"
echo "SHOULD_BUILD_MSI_NOUP=${SHOULD_BUILD_MSI_NOUP}" >> "${GITHUB_ENV}"
echo "SHOULD_BUILD_RPM=${SHOULD_BUILD_RPM}" >> "${GITHUB_ENV}"
echo "SHOULD_BUILD_TAR=${SHOULD_BUILD_TAR}" >> "${GITHUB_ENV}"
echo "SHOULD_BUILD_ZIP=${SHOULD_BUILD_ZIP}" >> "${GITHUB_ENV}"

15
install_gh.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
set -e
GH_ARCH="amd64"
VERSION=`curl "https://api.github.com/repos/cli/cli/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/' | cut -c2-`
curl -sSL "https://github.com/cli/cli/releases/download/v${VERSION}/gh_${VERSION}_linux_${GH_ARCH}.tar.gz" -o "gh_${VERSION}_linux_${GH_ARCH}.tar.gz"
tar xf "gh_${VERSION}_linux_${GH_ARCH}.tar.gz"
cp "gh_${VERSION}_linux_${GH_ARCH}/bin/gh" /usr/local/bin/
gh --version

View File

@@ -1,144 +0,0 @@
diff --git a/src/bootstrap-window.js b/src/bootstrap-window.js
index 0cc92ec..8ba8fb0 100644
--- a/src/bootstrap-window.js
+++ b/src/bootstrap-window.js
@@ -24,6 +24,7 @@
const bootstrapLib = bootstrap();
const preloadGlobals = sandboxGlobals();
const safeProcess = preloadGlobals.process;
+ const useCustomProtocol = safeProcess.sandboxed;
/**
* @typedef {import('./vs/base/parts/sandbox/common/sandboxTypes').ISandboxConfiguration} ISandboxConfiguration
@@ -107,9 +108,9 @@
window['MonacoEnvironment'] = {};
const loaderConfig = {
- baseUrl: `${bootstrapLib.fileUriFromPath(configuration.appRoot, { isWindows: safeProcess.platform === 'win32', scheme: 'vscode-file', fallbackAuthority: 'vscode-app' })}/out`,
+ baseUrl: `${bootstrapLib.fileUriFromPath(configuration.appRoot, { isWindows: safeProcess.platform === 'win32' })}/out`,
'vs/nls': nlsConfig,
- preferScriptTags: true
+ preferScriptTags: useCustomProtocol
};
// use a trusted types policy when loading via script tags
@@ -143,6 +144,14 @@
loaderConfig.amdModulesPattern = /^vs\//;
}
+ // Cached data config (node.js loading only)
+ if (!useCustomProtocol && configuration.codeCachePath) {
+ loaderConfig.nodeCachedData = {
+ path: configuration.codeCachePath,
+ seed: modulePaths.join('')
+ };
+ }
+
// Signal before require.config()
if (typeof options?.beforeLoaderConfig === 'function') {
options.beforeLoaderConfig(loaderConfig);
diff --git a/src/vs/base/common/network.ts b/src/vs/base/common/network.ts
index 41a3fe9..bbb06e3 100644
--- a/src/vs/base/common/network.ts
+++ b/src/vs/base/common/network.ts
@@ -166,16 +166,7 @@ class FileAccessImpl {
}
// Convert to `vscode-file` resource..
- if (
- // ...only ever for `file` resources
- uri.scheme === Schemas.file &&
- (
- // ...and we run in native environments
- platform.isNative ||
- // ...or web worker extensions on desktop
- (typeof platform.globals.importScripts === 'function' && platform.globals.origin === `${Schemas.vscodeFileResource}://${FileAccessImpl.FALLBACK_AUTHORITY}`)
- )
- ) {
+ if (uri.scheme === Schemas.file && typeof platform.globals.importScripts === 'function' && platform.globals.origin === `${Schemas.vscodeFileResource}://${FileAccessImpl.FALLBACK_AUTHORITY}`) {
return uri.with({
scheme: Schemas.vscodeFileResource,
// We need to provide an authority here so that it can serve
diff --git a/src/vs/platform/protocol/electron-main/protocolMainService.ts b/src/vs/platform/protocol/electron-main/protocolMainService.ts
index bde08d8..3f09ad1 100644
--- a/src/vs/platform/protocol/electron-main/protocolMainService.ts
+++ b/src/vs/platform/protocol/electron-main/protocolMainService.ts
@@ -72,9 +72,24 @@ export class ProtocolMainService extends Disposable implements IProtocolMainServ
//#region file://
private handleFileRequest(request: Electron.ProtocolRequest, callback: ProtocolCallback) {
- const uri = URI.parse(request.url);
+ const fileUri = URI.parse(request.url);
+
+ // first check by validRoots
+ if (this.validRoots.findSubstr(fileUri)) {
+ return callback({
+ path: fileUri.fsPath
+ });
+ }
- this.logService.error(`Refused to load resource ${uri.fsPath} from ${Schemas.file}: protocol (original URL: ${request.url})`);
+ // then check by validExtensions
+ if (this.validExtensions.has(extname(fileUri))) {
+ return callback({
+ path: fileUri.fsPath
+ });
+ }
+
+ // finally block to load the resource
+ this.logService.error(`${Schemas.file}: Refused to load resource ${fileUri.fsPath} from ${Schemas.file}: protocol (original URL: ${request.url})`);
return callback({ error: -3 /* ABORTED */ });
}
diff --git a/src/vs/workbench/services/timer/electron-sandbox/timerService.ts b/src/vs/workbench/services/timer/electron-sandbox/timerService.ts
index 7cae207..1c54ac9 100644
--- a/src/vs/workbench/services/timer/electron-sandbox/timerService.ts
+++ b/src/vs/workbench/services/timer/electron-sandbox/timerService.ts
@@ -19,7 +19,7 @@ import { process } from 'vs/base/parts/sandbox/electron-sandbox/globals';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
import { IProductService } from 'vs/platform/product/common/productService';
-import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
+import { IStorageService } from 'vs/platform/storage/common/storage';
export class TimerService extends AbstractTimerService {
@@ -91,24 +91,23 @@ registerSingleton(ITimerService, TimerService);
//#region cached data logic
-const lastRunningCommitStorageKey = 'perf/lastRunningCommit';
-let _didUseCachedData: boolean | undefined = undefined;
-
export function didUseCachedData(productService: IProductService, storageService: IStorageService, environmentService: INativeWorkbenchEnvironmentService): boolean {
- // browser code loading: only a guess based on
- // this being the first start with the commit
- // or subsequent
- if (typeof _didUseCachedData !== 'boolean') {
- if (!environmentService.configuration.codeCachePath || !productService.commit) {
- _didUseCachedData = false; // we only produce cached data whith commit and code cache path
- } else if (storageService.get(lastRunningCommitStorageKey, StorageScope.GLOBAL) === productService.commit) {
- _didUseCachedData = true; // subsequent start on same commit, assume cached data is there
- } else {
- storageService.store(lastRunningCommitStorageKey, productService.commit, StorageScope.GLOBAL, StorageTarget.MACHINE);
- _didUseCachedData = false; // first time start on commit, assume cached data is not yet there
+ if (!Boolean((<any>window).require.getConfig().nodeCachedData)) {
+ return false;
+ }
+ // There are loader events that signal if cached data was missing, rejected,
+ // or used. The former two mean no cached data.
+ let cachedDataFound = 0;
+ for (const event of require.getStats()) {
+ switch (event.type) {
+ case LoaderEventType.CachedDataRejected:
+ return false;
+ case LoaderEventType.CachedDataFound:
+ cachedDataFound += 1;
+ break;
}
}
- return _didUseCachedData;
+ return cachedDataFound > 0;
}
//#endregion

View File

@@ -1,5 +1,5 @@
diff --git a/extensions/github-authentication/src/githubServer.ts b/extensions/github-authentication/src/githubServer.ts diff --git a/extensions/github-authentication/src/githubServer.ts b/extensions/github-authentication/src/githubServer.ts
index 3d36081..5bac245 100644 index 8424f5b..5bac245 100644
--- a/extensions/github-authentication/src/githubServer.ts --- a/extensions/github-authentication/src/githubServer.ts
+++ b/extensions/github-authentication/src/githubServer.ts +++ b/extensions/github-authentication/src/githubServer.ts
@@ -6,8 +6,6 @@ @@ -6,8 +6,6 @@
@@ -212,11 +212,14 @@ index 3d36081..5bac245 100644
private async manuallyProvideUri() { private async manuallyProvideUri() {
const uri = await vscode.window.showInputBox({ const uri = await vscode.window.showInputBox({
prompt: 'Uri', prompt: 'Uri',
@@ -290,41 +159,7 @@ export class GitHubServer implements IGitHubServer { @@ -290,44 +159,7 @@ export class GitHubServer implements IGitHubServer {
return getUserInfo(token, this.getServerUri('/user'), this._logger); return getUserInfo(token, this.getServerUri('/user'), this._logger);
} }
- public async sendAdditionalTelemetryInfo(token: string): Promise<void> { - public async sendAdditionalTelemetryInfo(token: string): Promise<void> {
- if (!vscode.env.isTelemetryEnabled) {
- return;
- }
- const nocors = await this.isNoCorsEnvironment(); - const nocors = await this.isNoCorsEnvironment();
- -
- if (nocors) { - if (nocors) {

92
prepare_artifacts.sh Executable file
View File

@@ -0,0 +1,92 @@
#!/bin/bash
set -e
npm install -g checksum
sum_file() {
if [[ -f "$1" ]]; then
echo "Calcuating checksum for $1"
checksum -a sha256 "$1" > "$1".sha256
checksum "$1" > "$1".sha1
fi
}
mkdir artifacts
if [[ "${OS_NAME}" == "osx" ]]; then
if [[ "${SHOULD_BUILD_ZIP}" != "no" ]]; then
echo "Building and moving ZIP"
cd "VSCode-darwin-${VSCODE_ARCH}"
zip -r -X -y ../artifacts/VSCodium-darwin-${VSCODE_ARCH}-${MS_TAG}.zip ./*.app
cd ..
fi
if [[ "${SHOULD_BUILD_DMG}" != "no" ]]; then
echo "Building and moving DMG"
pushd "VSCode-darwin-${VSCODE_ARCH}"
npx create-dmg VSCodium.app ..
mv "../VSCodium ${MS_TAG}.dmg" "../artifacts/VSCodium.${VSCODE_ARCH}.${MS_TAG}.dmg"
popd
fi
elif [[ "${OS_NAME}" == "windows" ]]; then
if [[ "${SHOULD_BUILD_ZIP}" != "no" ]]; then
echo "Moving ZIP"
mv vscode\\.build\\win32-${VSCODE_ARCH}\\archive\\VSCode-win32-${VSCODE_ARCH}.zip artifacts\\VSCodium-win32-${VSCODE_ARCH}-${MS_TAG}.zip
fi
if [[ "${SHOULD_BUILD_EXE_SYS}" != "no" ]]; then
echo "Moving System EXE"
mv vscode\\.build\\win32-${VSCODE_ARCH}\\system-setup\\VSCodeSetup.exe artifacts\\VSCodiumSetup-${VSCODE_ARCH}-${MS_TAG}.exe
fi
if [[ "${SHOULD_BUILD_EXE_USR}" != "no" ]]; then
echo "Moving User EXE"
mv vscode\\.build\\win32-${VSCODE_ARCH}\\user-setup\\VSCodeSetup.exe artifacts\\VSCodiumUserSetup-${VSCODE_ARCH}-${MS_TAG}.exe
fi
if [[ "${VSCODE_ARCH}" == "ia32" || "${VSCODE_ARCH}" == "x64" ]]; then
if [[ "${SHOULD_BUILD_MSI}" != "no" ]]; then
echo "Moving MSI"
mv build\\windows\\msi\\releasedir\\VSCodium-${VSCODE_ARCH}-${MS_TAG}.msi artifacts/
fi
if [[ "${SHOULD_BUILD_MSI_NOUP}" != "no" ]]; then
echo "Moving MSI with disabled updates"
mv build\\windows\\msi\\releasedir\\VSCodium-${VSCODE_ARCH}-updates-disabled-${MS_TAG}.msi artifacts/
fi
fi
else
if [[ "${SHOULD_BUILD_TAR}" != "no" ]]; then
echo "Building and moving TAR"
cd VSCode-linux-${VSCODE_ARCH}
tar czf ../artifacts/VSCodium-linux-${VSCODE_ARCH}-${MS_TAG}.tar.gz .
cd ..
fi
if [[ "${SHOULD_BUILD_DEB}" != "no" ]]; then
echo "Moving DEB"
mv vscode/.build/linux/deb/*/deb/*.deb artifacts/
fi
if [[ "${SHOULD_BUILD_RPM}" != "no" ]]; then
echo "Moving RPM"
mv vscode/.build/linux/rpm/*/*.rpm artifacts/
fi
if [[ "${SHOULD_BUILD_APPIMAGE}" != "no" ]]; then
echo "Moving AppImage"
mv build/linux/appimage/out/*.AppImage* artifacts/
fi
fi
cd artifacts
for FILE in *
do
if [[ -f "${FILE}" ]]; then
sum_file "${FILE}"
fi
done
cd ..

27
release.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
set -e
if [[ -z "${GH_CLI_TOKEN}" ]]; then
echo "Will not release because no GH_CLI_TOKEN defined"
exit
fi
echo "${GH_CLI_TOKEN}" | gh auth login --with-token
if [[ $( gh release view "${MS_TAG}" 2>&1 ) =~ "release not found" ]]; then
echo "Creating release '${MS_TAG}'"
gh release create "${MS_TAG}"
fi
cd artifacts
for FILE in *
do
if [[ -f "${FILE}" ]] && [[ "${FILE}" != *.sha1 ]] && [[ "${FILE}" != *.sha256 ]]; then
echo "Uploading '${FILE}'"
gh release upload "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
fi
done
cd ..

28
sum.sh
View File

@@ -1,28 +0,0 @@
#!/bin/bash
npm install -g checksum
sum_file () {
if [[ -f "$1" ]]; then
checksum -a sha256 "$1" > "$1".sha256
checksum "$1" > "$1".sha1
fi
}
if [[ "$SHOULD_BUILD" == "yes" ]]; then
if [[ "$OS_NAME" == "osx" ]]; then
sum_file VSCodium-darwin-*.zip
sum_file VSCodium*.dmg
elif [[ "$OS_NAME" == "windows" ]]; then
sum_file VSCodiumSetup-*.exe
sum_file VSCodiumUserSetup-*.exe
sum_file VSCodium-win32-*.zip
sum_file "VSCodium-${VSCODE_ARCH}-${MS_TAG}.msi"
sum_file "VSCodium-${VSCODE_ARCH}-updates-disabled-${MS_TAG}.msi"
else # linux
sum_file VSCodium-*.AppImage
sum_file VSCodium-linux*.tar.gz
sum_file *.deb
sum_file *.rpm
fi
fi

View File

@@ -1,7 +1,10 @@
DEFAULT_TRUE="'default': true" DEFAULT_TRUE="'default': true"
DEFAULT_FALSE="'default': false" DEFAULT_FALSE="'default': false"
DEFAULT_ON="'default': TelemetryConfiguration.ON"
DEFAULT_OFF="'default': TelemetryConfiguration.OFF"
TELEMETRY_ENABLE="'telemetry.enableTelemetry':" TELEMETRY_ENABLE="'telemetry.enableTelemetry':"
TELEMETRY_CRASH_REPORTER="'telemetry.enableCrashReporter':" TELEMETRY_CRASH_REPORTER="'telemetry.enableCrashReporter':"
TELEMETRY_CONFIGURATION=" TelemetryConfiguration.ON"
#include common functions #include common functions
. ../utils.sh . ../utils.sh
@@ -22,7 +25,7 @@ update_setting () {
if [[ $line == *"$SETTING"* ]]; then if [[ $line == *"$SETTING"* ]]; then
local IN_SETTING=1 local IN_SETTING=1
fi fi
if [[ $line == *"$DEFAULT_TRUE"* && "$IN_SETTING" == "1" ]]; then if [[ ($line == *"$DEFAULT_TRUE"* || $line == *"$DEFAULT_ON"*) && "$IN_SETTING" == "1" ]]; then
local FOUND=1 local FOUND=1
break break
fi fi
@@ -34,10 +37,15 @@ update_setting () {
fi fi
# construct line-aware replacement string # construct line-aware replacement string
if [[ $line == *"$DEFAULT_TRUE"* ]]; then
local DEFAULT_TRUE_TO_FALSE="${LINE_NUM}s/${DEFAULT_TRUE}/${DEFAULT_FALSE}/" local DEFAULT_TRUE_TO_FALSE="${LINE_NUM}s/${DEFAULT_TRUE}/${DEFAULT_FALSE}/"
else
local DEFAULT_TRUE_TO_FALSE="${LINE_NUM}s/${DEFAULT_ON}/${DEFAULT_OFF}/"
fi
replace "$DEFAULT_TRUE_TO_FALSE" $FILENAME replace "$DEFAULT_TRUE_TO_FALSE" $FILENAME
} }
update_setting "$TELEMETRY_ENABLE" src/vs/platform/telemetry/common/telemetryService.ts update_setting "$TELEMETRY_ENABLE" src/vs/platform/telemetry/common/telemetryService.ts
update_setting "$TELEMETRY_CRASH_REPORTER" src/vs/workbench/electron-sandbox/desktop.contribution.ts update_setting "$TELEMETRY_CRASH_REPORTER" src/vs/workbench/electron-sandbox/desktop.contribution.ts
update_setting "$TELEMETRY_CONFIGURATION" src/vs/platform/telemetry/common/telemetryService.ts

View File

@@ -1,10 +1,17 @@
#!/bin/bash #!/bin/bash
if [[ "$SHOULD_BUILD" != "yes" ]]; then set -e
if [[ "${SHOULD_BUILD}" != "yes" ]]; then
echo "Will not update version JSON because we did not build" echo "Will not update version JSON because we did not build"
exit exit
fi fi
if [[ -z "${GITHUB_TOKEN}" ]]; then
echo "Will not update version JSON because no GITHUB_TOKEN defined"
exit
fi
# { # {
# "url": "https://az764295.vo.msecnd.net/stable/51b0b28134d51361cf996d2f0a1c698247aeabd8/VSCode-darwin-stable.zip", # "url": "https://az764295.vo.msecnd.net/stable/51b0b28134d51361cf996d2f0a1c698247aeabd8/VSCode-darwin-stable.zip",
# "name": "1.33.1", # "name": "1.33.1",
@@ -24,37 +31,40 @@ fi
# `timestamp` is $(node -e 'console.log(Date.now())') # `timestamp` is $(node -e 'console.log(Date.now())')
# `sha256hash` in <filename>.sha256 # `sha256hash` in <filename>.sha256
URL_BASE=https://github.com/VSCodium/vscodium/releases/download/${MS_TAG} URL_BASE="https://github.com/VSCodium/vscodium/releases/download/${MS_TAG}"
# to make testing on forks easier # to make testing on forks easier
VERSIONS_REPO="${GITHUB_USERNAME}/versions" VERSIONS_REPO="${GITHUB_USERNAME}/versions"
echo "Versions repo:" $VERSIONS_REPO echo "Versions repo: ${VERSIONS_REPO}"
# generateJson <assetName>
# e.g. generateJson VSCodium-darwin-1.33.0.zip
generateJson() { generateJson() {
local assetName=$1 JSON_DATA="{}"
# generate parts # generate parts
local url=${URL_BASE}/${assetName} local url="${URL_BASE}/${ASSET_NAME}"
local name=$MS_TAG local name="${MS_TAG}"
local version=$MS_COMMIT local version="${MS_COMMIT}"
local productVersion=$MS_TAG local productVersion="${MS_TAG}"
local timestamp=$(node -e 'console.log(Date.now())') local timestamp=$(node -e 'console.log(Date.now())')
local sha1hash=$(cat ${assetName}.sha1 | awk '{ print $1 }') if [[ ! -f "artifacts/${ASSET_NAME}" ]]; then
local sha256hash=$(cat ${assetName}.sha256 | awk '{ print $1 }') echo "Downloading artifact '${ASSET_NAME}'"
gh release download "${MS_TAG}" --dir "artifacts" --pattern "${ASSET_NAME}*"
fi
local sha1hash=$(cat "artifacts/${ASSET_NAME}.sha1" | awk '{ print $1 }')
local sha256hash=$(cat "artifacts/${ASSET_NAME}.sha256" | awk '{ print $1 }')
# check that nothing is blank (blank indicates something awry with build) # check that nothing is blank (blank indicates something awry with build)
for key in url name version productVersion sha1hash timestamp sha256hash; do for key in url name version productVersion sha1hash timestamp sha256hash; do
if [[ "${!key}" == "" ]]; then if [[ -z "${key}" ]]; then
echo "Missing data for version update; exiting..." echo "Variable '${key}' is empty; exiting..."
exit 1 exit 1
fi fi
done done
# generate json # generate json
local json=$(jq \ JSON_DATA=$(jq \
--arg url "${url}" \ --arg url "${url}" \
--arg name "${name}" \ --arg name "${name}" \
--arg version "${version}" \ --arg version "${version}" \
@@ -64,70 +74,62 @@ generateJson() {
--arg sha256hash "${sha256hash}" \ --arg sha256hash "${sha256hash}" \
'. | .url=$url | .name=$name | .version=$version | .productVersion=$productVersion | .hash=$hash | .timestamp=$timestamp | .sha256hash=$sha256hash' \ '. | .url=$url | .name=$name | .version=$version | .productVersion=$productVersion | .hash=$hash | .timestamp=$timestamp | .sha256hash=$sha256hash' \
<<<'{}') <<<'{}')
echo "$json"
} }
updateLatestVersion() { updateLatestVersion() {
echo "Generating ${VERSION_PATH}/latest.json"
generateJson
cd versions cd versions
local versionPath=$1
local json=$2
# create/update the latest.json file in the correct location # create/update the latest.json file in the correct location
mkdir -p $versionPath mkdir -p "${VERSION_PATH}"
echo $json > $versionPath/latest.json echo "${JSON_DATA}" > "${VERSION_PATH}/latest.json"
cd .. cd ..
} }
# init versions repo for later commiting + pushing the json file to it # init versions repo for later commiting + pushing the json file to it
# thank you https://www.vinaygopinath.me/blog/tech/commit-to-master-branch-on-github-using-travis-ci/ # thank you https://www.vinaygopinath.me/blog/tech/commit-to-master-branch-on-github-using-travis-ci/
git clone https://github.com/${VERSIONS_REPO}.git git clone "https://github.com/${VERSIONS_REPO}.git"
cd versions cd versions
git config user.email "vscodium-ci@not-real.com" git config user.email "vscodium-ci@not-real.com"
git config user.name "VSCodium CI" git config user.name "VSCodium CI"
git remote rm origin git remote rm origin
git remote add origin https://${GITHUB_USERNAME}:${GITHUB_TOKEN}@github.com/${VERSIONS_REPO}.git > /dev/null 2>&1 git remote add origin "https://${GITHUB_USERNAME}:${GITHUB_TOKEN}@github.com/${VERSIONS_REPO}.git" > /dev/null 2>&1
cd .. cd ..
if [[ "$OS_NAME" == "osx" ]]; then if [[ "${OS_NAME}" == "osx" ]]; then
# zip, sha1, and sha256 files are all at top level dir
ASSET_NAME=VSCodium-darwin-${VSCODE_ARCH}-${MS_TAG}.zip ASSET_NAME=VSCodium-darwin-${VSCODE_ARCH}-${MS_TAG}.zip
VERSION_PATH="darwin/${VSCODE_ARCH}" VERSION_PATH="darwin/${VSCODE_ARCH}"
JSON="$(generateJson ${ASSET_NAME})" updateLatestVersion
updateLatestVersion "$VERSION_PATH" "$JSON" elif [[ "${OS_NAME}" == "windows" ]]; then
elif [[ "$OS_NAME" == "windows" ]]; then
# system installer # system installer
ASSET_NAME=VSCodiumSetup-${VSCODE_ARCH}-${MS_TAG}.exe ASSET_NAME=VSCodiumSetup-${VSCODE_ARCH}-${MS_TAG}.exe
VERSION_PATH="win32/${VSCODE_ARCH}/system" VERSION_PATH="win32/${VSCODE_ARCH}/system"
JSON="$(generateJson ${ASSET_NAME})" updateLatestVersion
updateLatestVersion "$VERSION_PATH" "$JSON"
# user installer # user installer
ASSET_NAME=VSCodiumUserSetup-${VSCODE_ARCH}-${MS_TAG}.exe ASSET_NAME=VSCodiumUserSetup-${VSCODE_ARCH}-${MS_TAG}.exe
VERSION_PATH="win32/${VSCODE_ARCH}/user" VERSION_PATH="win32/${VSCODE_ARCH}/user"
JSON="$(generateJson ${ASSET_NAME})" updateLatestVersion
updateLatestVersion "$VERSION_PATH" "$JSON"
# windows archive # windows archive
ASSET_NAME=VSCodium-win32-${VSCODE_ARCH}-${MS_TAG}.zip ASSET_NAME=VSCodium-win32-${VSCODE_ARCH}-${MS_TAG}.zip
VERSION_PATH="win32/${VSCODE_ARCH}/archive" VERSION_PATH="win32/${VSCODE_ARCH}/archive"
JSON="$(generateJson ${ASSET_NAME})" updateLatestVersion
updateLatestVersion "$VERSION_PATH" "$JSON"
if [[ "${VSCODE_ARCH}" == "ia32" || "${VSCODE_ARCH}" == "x64" ]]; then if [[ "${VSCODE_ARCH}" == "ia32" || "${VSCODE_ARCH}" == "x64" ]]; then
# msi # msi
ASSET_NAME=VSCodium-${VSCODE_ARCH}-${MS_TAG}.msi ASSET_NAME=VSCodium-${VSCODE_ARCH}-${MS_TAG}.msi
VERSION_PATH="win32/${VSCODE_ARCH}/msi" VERSION_PATH="win32/${VSCODE_ARCH}/msi"
JSON="$(generateJson ${ASSET_NAME})" updateLatestVersion
updateLatestVersion "$VERSION_PATH" "$JSON"
# updates-disabled msi # updates-disabled msi
ASSET_NAME=VSCodium-${VSCODE_ARCH}-updates-disabled-${MS_TAG}.msi ASSET_NAME=VSCodium-${VSCODE_ARCH}-updates-disabled-${MS_TAG}.msi
VERSION_PATH="win32/${VSCODE_ARCH}/msi-updates-disabled" VERSION_PATH="win32/${VSCODE_ARCH}/msi-updates-disabled"
JSON="$(generateJson ${ASSET_NAME})" updateLatestVersion
updateLatestVersion "$VERSION_PATH" "$JSON"
fi fi
else # linux else # linux
# update service links to tar.gz file # update service links to tar.gz file
@@ -135,19 +137,23 @@ else # linux
# as examples # as examples
ASSET_NAME=VSCodium-linux-${VSCODE_ARCH}-${MS_TAG}.tar.gz ASSET_NAME=VSCodium-linux-${VSCODE_ARCH}-${MS_TAG}.tar.gz
VERSION_PATH="linux/${VSCODE_ARCH}" VERSION_PATH="linux/${VSCODE_ARCH}"
JSON="$(generateJson ${ASSET_NAME})" updateLatestVersion
updateLatestVersion "$VERSION_PATH" "$JSON"
fi fi
cd versions cd versions
git pull origin master # in case another build just pushed git pull origin master # in case another build just pushed
git add . git add .
dateAndMonth=`date "+%D %T"`
git commit -m "CI update: $dateAndMonth (Build $GITHUB_RUN_NUMBER)" CHANGES=$( git status --porcelain )
if ! git push origin master --quiet; then
if [[ ! -z "${CHANGES}" ]]; then
dateAndMonth=$( date "+%D %T" )
git commit -m "CI update: ${dateAndMonth} (Build ${GITHUB_RUN_NUMBER})"
if ! git push origin master --quiet; then
git pull origin master git pull origin master
git push origin master --quiet git push origin master --quiet
fi
fi fi
cd .. cd ..