Compare commits

...

16 Commits

Author SHA1 Message Date
Baptiste Augrain
c71f2250ce fix: remove bad negation (#916) 2021-11-12 02:14:13 +01:00
Baptiste Augrain
b0154c7831 fix: add debug log (#915) 2021-11-10 11:52:44 +01:00
Baptiste Augrain
23313d41ba fix: correctly read exit status (#914) 2021-11-10 10:40:20 +01:00
Baptiste Augrain
cf48030b59 fix: deleting bad assets (#913) 2021-11-10 10:13:12 +01:00
Baptiste Augrain
848aabfe54 fix: fixing release script (#912) 2021-11-10 09:36:35 +01:00
Baptiste Augrain
10a0cb4b30 fix: remove infinity loop in the release script (#904) 2021-11-06 12:58:53 +01:00
Baptiste Augrain
0469329683 fix: fixing release script (#903) 2021-11-06 12:26:36 +01:00
Baptiste Augrain
6acd2fbfe1 feat: break force the uploads (#902) 2021-11-06 12:03:44 +01:00
Baptiste Augrain
38810539a7 fix(1.62): fix patches (#899) 2021-11-06 02:52:55 +01:00
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
17 changed files with 611 additions and 387 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

@@ -11,7 +11,7 @@ on:
jobs: jobs:
linux: linux:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: ${{ matrix.image }} image: ${{ matrix.image }}
env: env:
OS_NAME: 'linux' OS_NAME: 'linux'
@@ -34,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:
@@ -42,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 }}
@@ -79,42 +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' if: env.SHOULD_BUILD == 'yes' && env.SHOULD_DEPLOY == 'yes'
- name: Move/rename build artifacts
shell: bash
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'
- 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 }} GITHUB_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,7 +11,7 @@ on:
jobs: jobs:
build: build:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@@ -27,25 +27,22 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Setup Node.js environment - name: Setup Node.js environment
uses: actions/setup-node@v1 uses: actions/setup-node@v1
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
@@ -92,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' 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'
- 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 }} GITHUB_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' 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'
- 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 }} GITHUB_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,29 +19,50 @@ 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}-inno-updater" yarn gulp "vscode-win32-${VSCODE_ARCH}-inno-updater"
yarn gulp "vscode-win32-${VSCODE_ARCH}-archive"
yarn gulp "vscode-win32-${VSCODE_ARCH}-system-setup" if [[ "${SHOULD_BUILD_ZIP}" != "no" ]]; then
yarn gulp "vscode-win32-${VSCODE_ARCH}-user-setup" yarn gulp "vscode-win32-${VSCODE_ARCH}-archive"
fi
if [[ "${SHOULD_BUILD_EXE_SYS}" != "no" ]]; then
yarn gulp "vscode-win32-${VSCODE_ARCH}-system-setup"
fi
if [[ "${SHOULD_BUILD_EXE_USR}" != "no" ]]; then
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
. ../build/windows/msi/build.sh if [[ "${SHOULD_BUILD_MSI}" != "no" ]]; then
. ../build/windows/msi/build-updates-disabled.sh . ../build/windows/msi/build.sh
fi
if [[ "${SHOULD_BUILD_MSI_NOUP}" != "no" ]]; then
. ../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" if [[ "${SKIP_LINUX_PACKAGES}" != "True" ]]; then
yarn gulp "vscode-linux-${VSCODE_ARCH}-build-rpm" if [[ "${SHOULD_BUILD_DEB}" != "no" || "${SHOULD_BUILD_APPIMAGE}" != "no" ]]; then
yarn gulp "vscode-linux-${VSCODE_ARCH}-build-deb"
. ../build/linux/appimage/build.sh 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
fi
fi fi
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,147 +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 # macos
if [ "$VSCODIUM_ASSETS" != "null" ]; then if [[ "${OS_NAME}" == "osx" ]]; then
# macos if [[ -z $( contains "darwin-${VSCODE_ARCH}-${MS_TAG}.zip" ) ]]; then
if [[ "$OS_NAME" == "osx" ]]; then echo "Building on MacOS because we have no ZIP"
if [[ -z $( contains "darwin-$VSCODE_ARCH-$MS_TAG.zip" ) ]]; then export SHOULD_BUILD="yes"
echo "Building on Mac because we have no ZIP" else
export SHOULD_BUILD_ZIP="no"
fi
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
if [[ ${VSCODE_ARCH} == "arm64" ]]; then
if [[ -z $( contains "VSCodiumSetup-${VSCODE_ARCH}-${MS_TAG}.exe" ) ]]; then
echo "Building on Windows arm64 because we have no system setup"
export SHOULD_BUILD="yes" export SHOULD_BUILD="yes"
fi
elif [[ "$OS_NAME" == "windows" ]]; then
# windows-arm64
if [[ $VSCODE_ARCH == "arm64" ]]; then
if [[ -z $( contains "VSCodiumSetup-$VSCODE_ARCH-$MS_TAG.exe" ) ]]; then
echo "Building on Windows arm64 because we have no system setup"
export SHOULD_BUILD="yes"
fi
if [[ -z $( contains "UserSetup-$VSCODE_ARCH-$MS_TAG.exe" ) ]]; then
echo "Building on Windows arm64 because we have no user setup"
export SHOULD_BUILD="yes"
fi
if [[ -z $( contains "win32-$VSCODE_ARCH-$MS_TAG.zip" ) ]]; then
echo "Building on Windows arm64 because we have no zip"
export SHOULD_BUILD="yes"
fi
if [[ "$SHOULD_BUILD" != "yes" ]]; then
echo "Already have all the Windows arm64 builds"
fi
# windows-ia32
elif [[ $VSCODE_ARCH == "ia32" ]]; then
if [[ -z $( contains "VSCodiumSetup-$VSCODE_ARCH-$MS_TAG.exe" ) ]]; then
echo "Building on Windows ia32 because we have no system setup"
export SHOULD_BUILD="yes"
fi
if [[ -z $( contains "UserSetup-$VSCODE_ARCH-$MS_TAG.exe" ) ]]; then
echo "Building on Windows ia32 because we have no user setup"
export SHOULD_BUILD="yes"
fi
if [[ -z $( contains "win32-$VSCODE_ARCH-$MS_TAG.zip" ) ]]; then
echo "Building on Windows ia32 because we have no zip"
export SHOULD_BUILD="yes"
fi
if [[ -z $( contains "VSCodium-$VSCODE_ARCH-$MS_TAG.msi" ) ]]; then
echo "Building on Windows ia32 because we have no msi"
export SHOULD_BUILD="yes"
fi
if [[ -z $( contains "VSCodium-$VSCODE_ARCH-updates-disabled-$MS_TAG.msi" ) ]]; then
echo "Building on Windows ia32 because we have no updates-disabled msi"
export SHOULD_BUILD="yes"
fi
if [[ "$SHOULD_BUILD" != "yes" ]]; then
echo "Already have all the Windows ia32 builds"
fi
# windows-x64
else else
if [[ -z $( contains "VSCodiumSetup-$VSCODE_ARCH-$MS_TAG.exe" ) ]]; then export SHOULD_BUILD_EXE_SYS="no"
echo "Building on Windows x64 because we have no system setup"
export SHOULD_BUILD="yes"
fi
if [[ -z $( contains "UserSetup-$VSCODE_ARCH-$MS_TAG.exe" ) ]]; then
echo "Building on Windows x64 because we have no user setup"
export SHOULD_BUILD="yes"
fi
if [[ -z $( contains "win32-$VSCODE_ARCH-$MS_TAG.zip" ) ]]; then
echo "Building on Windows x64 because we have no zip"
export SHOULD_BUILD="yes"
fi
if [[ -z $( contains "VSCodium-$VSCODE_ARCH-$MS_TAG.msi" ) ]]; then
echo "Building on Windows x64 because we have no msi"
export SHOULD_BUILD="yes"
fi
if [[ -z $( contains "VSCodium-$VSCODE_ARCH-updates-disabled-$MS_TAG.msi" ) ]]; then
echo "Building on Windows x64 because we have no updates-disabled msi"
export SHOULD_BUILD="yes"
fi
if [[ "$SHOULD_BUILD" != "yes" ]]; then
echo "Already have all the Windows x64 builds"
fi
fi fi
elif [[ "$OS_NAME" == "linux" ]]; then
# linux-arm64 if [[ -z $( contains "UserSetup-${VSCODE_ARCH}-${MS_TAG}.exe" ) ]]; then
if [[ $VSCODE_ARCH == "arm64" ]]; then echo "Building on Windows arm64 because we have no user setup"
if [[ -z $( contains "arm64.deb" ) ]]; then export SHOULD_BUILD="yes"
echo "Building on Linux arm64 because we have no DEB"
export SHOULD_BUILD="yes"
fi
if [[ -z $( contains "arm64-$MS_TAG.tar.gz" ) ]]; then
echo "Building on Linux arm64 because we have no TAR"
export SHOULD_BUILD="yes"
fi
if [[ "$SHOULD_BUILD" != "yes" ]]; then
echo "Already have all the Linux arm64 builds"
fi
# linux-armhf
elif [[ $VSCODE_ARCH == "armhf" ]]; then
if [[ -z $( contains "armhf.deb" ) ]]; then
echo "Building on Linux arm because we have no DEB"
export SHOULD_BUILD="yes"
fi
if [[ -z $( contains "armhf-${MS_TAG}.tar.gz" ) ]]; then
echo "Building on Linux arm because we have no TAR"
export SHOULD_BUILD="yes"
fi
if [[ "$SHOULD_BUILD" != "yes" ]]; then
echo "Already have all the Linux arm builds"
fi
# linux-x64
else else
if [[ -z $( contains "x86_64.rpm" ) ]]; then export SHOULD_BUILD_EXE_USR="no"
echo "Building on Linux x64 because we have no RPM" fi
export SHOULD_BUILD="yes"
fi if [[ -z $( contains "win32-${VSCODE_ARCH}-${MS_TAG}.zip" ) ]]; then
if [[ -z $( contains "amd64.deb" ) ]]; then echo "Building on Windows arm64 because we have no zip"
echo "Building on Linux x64 because we have no DEB" export SHOULD_BUILD="yes"
export SHOULD_BUILD="yes" else
fi export SHOULD_BUILD_ZIP="no"
if [[ -z $( contains "x64-$MS_TAG.tar.gz" ) ]]; then fi
echo "Building on Linux x64 because we have no TAR"
export SHOULD_BUILD="yes" if [[ "${SHOULD_BUILD}" != "yes" ]]; then
fi echo "Already have all the Windows arm64 builds"
if [[ -z $( contains "x86_64.AppImage" ) ]]; then fi
echo "Building on Linux x64 because we have no AppImage"
export SHOULD_BUILD="yes" # windows-ia32
fi elif [[ ${VSCODE_ARCH} == "ia32" ]]; then
if [[ "$SHOULD_BUILD" != "yes" ]]; then if [[ -z $( contains "VSCodiumSetup-${VSCODE_ARCH}-${MS_TAG}.exe" ) ]]; then
echo "Already have all the Linux x64 builds" echo "Building on Windows ia32 because we have no system setup"
fi export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_EXE_SYS="no"
fi
if [[ -z $( contains "UserSetup-${VSCODE_ARCH}-${MS_TAG}.exe" ) ]]; then
echo "Building on Windows ia32 because we have no user setup"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_EXE_USR="no"
fi
if [[ -z $( contains "win32-${VSCODE_ARCH}-${MS_TAG}.zip" ) ]]; then
echo "Building on Windows ia32 because we have no zip"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_ZIP="no"
fi
if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-${MS_TAG}.msi" ) ]]; then
echo "Building on Windows ia32 because we have no msi"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_MSI="no"
fi
if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-updates-disabled-${MS_TAG}.msi" ) ]]; then
echo "Building on Windows ia32 because we have no updates-disabled msi"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_MSI_NOUP="no"
fi
if [[ "${SHOULD_BUILD}" != "yes" ]]; then
echo "Already have all the Windows ia32 builds"
fi
# windows-x64
else
if [[ -z $( contains "VSCodiumSetup-${VSCODE_ARCH}-${MS_TAG}.exe" ) ]]; then
echo "Building on Windows x64 because we have no system setup"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_EXE_SYS="no"
fi
if [[ -z $( contains "UserSetup-${VSCODE_ARCH}-${MS_TAG}.exe" ) ]]; then
echo "Building on Windows x64 because we have no user setup"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_EXE_USR="no"
fi
if [[ -z $( contains "win32-${VSCODE_ARCH}-${MS_TAG}.zip" ) ]]; then
echo "Building on Windows x64 because we have no zip"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_ZIP="no"
fi
if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-${MS_TAG}.msi" ) ]]; then
echo "Building on Windows x64 because we have no msi"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_MSI="no"
fi
if [[ -z $( contains "VSCodium-${VSCODE_ARCH}-updates-disabled-${MS_TAG}.msi" ) ]]; then
echo "Building on Windows x64 because we have no updates-disabled msi"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_MSI_NOUP="no"
fi
if [[ "${SHOULD_BUILD}" != "yes" ]]; then
echo "Already have all the Windows x64 builds"
fi
fi
elif [[ "${OS_NAME}" == "linux" ]]; then
# linux-arm64
if [[ ${VSCODE_ARCH} == "arm64" ]]; then
if [[ -z $( contains "arm64.deb" ) ]]; then
echo "Building on Linux arm64 because we have no DEB"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_DEB="no"
fi
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"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_TAR="no"
fi
export SHOULD_BUILD_APPIMAGE="no"
if [[ "${SHOULD_BUILD}" != "yes" ]]; then
echo "Already have all the Linux arm64 builds"
fi
# linux-armhf
elif [[ ${VSCODE_ARCH} == "armhf" ]]; then
if [[ -z $( contains "armhf.deb" ) ]]; then
echo "Building on Linux arm because we have no DEB"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_DEB="no"
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
echo "Building on Linux arm because we have no TAR"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_TAR="no"
fi
export SHOULD_BUILD_APPIMAGE="no"
if [[ "${SHOULD_BUILD}" != "yes" ]]; then
echo "Already have all the Linux arm builds"
fi
# linux-x64
else
if [[ -z $( contains "amd64.deb" ) ]]; then
echo "Building on Linux x64 because we have no DEB"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_DEB="no"
fi
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"
export SHOULD_BUILD="yes"
else
export SHOULD_BUILD_TAR="no"
fi
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"
fi fi
fi fi
else
echo "Release assets do not exist at all, continuing build"
export SHOULD_BUILD="yes"
fi fi
else
echo "Release assets do not exist at all, continuing build"
export SHOULD_BUILD="yes"
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,8 +1,8 @@
diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts
index 78d6060..dfa9de2 100644 index 657b9c9..9b9b12e 100644
--- a/src/vs/base/common/product.ts --- a/src/vs/base/common/product.ts
+++ b/src/vs/base/common/product.ts +++ b/src/vs/base/common/product.ts
@@ -69,6 +69,7 @@ export interface IProductConfiguration { @@ -70,6 +70,7 @@ export interface IProductConfiguration {
readonly extensionsGallery?: { readonly extensionsGallery?: {
readonly serviceUrl: string; readonly serviceUrl: string;
@@ -11,7 +11,7 @@ index 78d6060..dfa9de2 100644
readonly resourceUrlTemplate: string; readonly resourceUrlTemplate: string;
readonly controlUrl: string; readonly controlUrl: string;
diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts
index 09dfc64..fec0cfa 100644 index 5e38d35..12bb161 100644
--- a/src/vs/platform/product/common/product.ts --- a/src/vs/platform/product/common/product.ts
+++ b/src/vs/platform/product/common/product.ts +++ b/src/vs/platform/product/common/product.ts
@@ -4,11 +4,12 @@ @@ -4,11 +4,12 @@
@@ -26,9 +26,9 @@ index 09dfc64..fec0cfa 100644
import { ISandboxConfiguration } from 'vs/base/parts/sandbox/common/sandboxTypes'; import { ISandboxConfiguration } from 'vs/base/parts/sandbox/common/sandboxTypes';
+import { getUserDataPath } from 'vs/platform/environment/node/userDataPath'; +import { getUserDataPath } from 'vs/platform/environment/node/userDataPath';
let product: IProductConfiguration; /**
* @deprecated You MUST use `IProductService` if possible.
@@ -31,6 +32,32 @@ else if (typeof require?.__$__nodeRequire === 'function') { @@ -34,6 +35,32 @@ else if (typeof require?.__$__nodeRequire === 'function') {
product = require.__$__nodeRequire(joinPath(rootPath, 'product.json').fsPath); product = require.__$__nodeRequire(joinPath(rootPath, 'product.json').fsPath);
const pkg = require.__$__nodeRequire(joinPath(rootPath, 'package.json').fsPath) as { version: string; }; const pkg = require.__$__nodeRequire(joinPath(rootPath, 'package.json').fsPath) as { version: string; };
@@ -61,7 +61,7 @@ index 09dfc64..fec0cfa 100644
// Running out of sources // Running out of sources
if (env['VSCODE_DEV']) { if (env['VSCODE_DEV']) {
Object.assign(product, { Object.assign(product, {
@@ -40,6 +67,19 @@ else if (typeof require?.__$__nodeRequire === 'function') { @@ -43,6 +70,19 @@ else if (typeof require?.__$__nodeRequire === 'function') {
}); });
} }

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 fe0fbfd..656d8bb 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 @@
@@ -47,7 +47,7 @@ index 3d36081..5bac245 100644
private _statusBarCommandId = `${this.type}.provide-manually`; private _statusBarCommandId = `${this.type}.provide-manually`;
private _disposable: vscode.Disposable; private _disposable: vscode.Disposable;
private _uriHandler = new UriEventHandler(this._logger); private _uriHandler = new UriEventHandler(this._logger);
@@ -115,150 +99,35 @@ export class GitHubServer implements IGitHubServer { @@ -115,137 +99,35 @@ export class GitHubServer implements IGitHubServer {
this._disposable.dispose(); this._disposable.dispose();
} }
@@ -58,15 +58,13 @@ index 3d36081..5bac245 100644
- // TODO@joaomoreno TODO@TylerLeonhardt - // TODO@joaomoreno TODO@TylerLeonhardt
- private async isNoCorsEnvironment(): Promise<boolean> { - private async isNoCorsEnvironment(): Promise<boolean> {
- const uri = await vscode.env.asExternalUri(vscode.Uri.parse(`${vscode.env.uriScheme}://vscode.github-authentication/dummy`)); - const uri = await vscode.env.asExternalUri(vscode.Uri.parse(`${vscode.env.uriScheme}://vscode.github-authentication/dummy`));
- return (uri.scheme === 'https' && /^(vscode|github)\./.test(uri.authority)) || (uri.scheme === 'http' && /^localhost/.test(uri.authority)); - return (uri.scheme === 'https' && /^((insiders\.)?vscode|github)\./.test(uri.authority)) || (uri.scheme === 'http' && /^localhost/.test(uri.authority));
- } - }
- -
public async login(scopes: string): Promise<string> { public async login(scopes: string): Promise<string> {
this._logger.info(`Logging in for the following scopes: ${scopes}`); this._logger.info(`Logging in for the following scopes: ${scopes}`);
- // TODO@joaomoreno TODO@TylerLeonhardt - const callbackUri = await vscode.env.asExternalUri(vscode.Uri.parse(`${vscode.env.uriScheme}://vscode.github-authentication/did-authenticate`));
- const nocors = await this.isNoCorsEnvironment();
- const callbackUri = await vscode.env.asExternalUri(vscode.Uri.parse(`${vscode.env.uriScheme}://vscode.github-authentication/did-authenticate${nocors ? '?nocors=true' : ''}`));
- -
- if (this.isTestEnvironment(callbackUri)) { - if (this.isTestEnvironment(callbackUri)) {
- const token = await vscode.window.showInputBox({ prompt: 'GitHub Personal Access Token', ignoreFocusOut: true }); - const token = await vscode.window.showInputBox({ prompt: 'GitHub Personal Access Token', ignoreFocusOut: true });
@@ -86,7 +84,7 @@ index 3d36081..5bac245 100644
- return tokenScopes.includes(splitScopes); - return tokenScopes.includes(splitScopes);
- }); - });
- })) { - })) {
- throw new Error(`The provided token is does not match the requested scopes: ${scopes}`); - throw new Error(`The provided token does not match the requested scopes: ${scopes}`);
+ const tokenScopes = await getScopes(token, this.getServerUri('/'), this._logger); // Example: ['repo', 'user'] + const tokenScopes = await getScopes(token, this.getServerUri('/'), this._logger); // Example: ['repo', 'user']
+ const scopesList = scopes.split(' '); // Example: 'read:user repo user:email' + const scopesList = scopes.split(' '); // Example: 'read:user repo user:email'
+ if (!scopesList.every(scope => { + if (!scopesList.every(scope => {
@@ -104,7 +102,7 @@ index 3d36081..5bac245 100644
- const existingStates = this._pendingStates.get(scopes) || []; - const existingStates = this._pendingStates.get(scopes) || [];
- this._pendingStates.set(scopes, [...existingStates, state]); - this._pendingStates.set(scopes, [...existingStates, state]);
- -
- const uri = vscode.Uri.parse(`https://${AUTH_RELAY_SERVER}/authorize/?callbackUri=${encodeURIComponent(callbackUri.toString())}&scope=${scopes}&state=${state}&responseType=code&authServer=https://github.com${nocors ? '&nocors=true' : ''}`); - const uri = vscode.Uri.parse(`https://${AUTH_RELAY_SERVER}/authorize/?callbackUri=${encodeURIComponent(callbackUri.toString())}&scope=${scopes}&state=${state}&responseType=code&authServer=https://github.com`);
- await vscode.env.openExternal(uri); - await vscode.env.openExternal(uri);
- -
- // Register a single listener for the URI callback, in case the user starts the login process multiple times - // Register a single listener for the URI callback, in case the user starts the login process multiple times
@@ -117,7 +115,7 @@ index 3d36081..5bac245 100644
+ return tokenScopes.includes(splitScopes); + return tokenScopes.includes(splitScopes);
+ }); + });
+ })) { + })) {
+ throw new Error(`The provided token is does not match the requested scopes: ${scopes}`); + throw new Error(`The provided token does not match the requested scopes: ${scopes}`);
} }
- return Promise.race([ - return Promise.race([
@@ -158,34 +156,23 @@ index 3d36081..5bac245 100644
- const url = `https://${AUTH_RELAY_SERVER}/token?code=${code}&state=${query.state}`; - const url = `https://${AUTH_RELAY_SERVER}/token?code=${code}&state=${query.state}`;
- this._logger.info('Exchanging code for token...'); - this._logger.info('Exchanging code for token...');
- -
- // TODO@joao: remove - try {
- if (query.nocors) { - const result = await fetch(url, {
- try { - method: 'POST',
- const json: any = await vscode.commands.executeCommand('_workbench.fetchJSON', url, 'POST'); - headers: {
- Accept: 'application/json'
- }
- });
-
- if (result.ok) {
- const json = await result.json();
- this._logger.info('Token exchange success!'); - this._logger.info('Token exchange success!');
- resolve(json.access_token); - resolve(json.access_token);
- } catch (err) { - } else {
- reject(err); - reject(result.statusText);
- }
- } else {
- try {
- const result = await fetch(url, {
- method: 'POST',
- headers: {
- Accept: 'application/json'
- }
- });
-
- if (result.ok) {
- const json = await result.json();
- this._logger.info('Token exchange success!');
- resolve(json.access_token);
- } else {
- reject(result.statusText);
- }
- } catch (ex) {
- reject(ex);
- } - }
- } catch (ex) {
- reject(ex);
- } - }
- }; - };
- -
@@ -212,11 +199,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 { @@ -277,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 ..

62
release.sh Executable file
View File

@@ -0,0 +1,62 @@
#!/bin/bash
set -e
if [[ -z "${GITHUB_TOKEN}" ]]; then
echo "Will not release because no GITHUB_TOKEN defined"
exit
fi
npm install -g github-release-cli
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
set +e
for FILE in *
do
if [[ -f "${FILE}" ]] && [[ "${FILE}" != *.sha1 ]] && [[ "${FILE}" != *.sha256 ]]; then
echo "::group::Uploading '${FILE}' at $( date "+%T" )"
gh release upload "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
EXIT_STATUS=$?
echo "exit: $EXIT_STATUS"
if (( $EXIT_STATUS )); then
for (( i=0; i<10; i++ ))
do
github-release delete --owner VSCodium --repo vscodium --tag "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
sleep $(( 15 * (i + 1)))
echo "RE-Uploading '${FILE}' at $( date "+%T" )"
gh release upload "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
EXIT_STATUS=$?
echo "exit: $EXIT_STATUS"
if ! (( $EXIT_STATUS )); then
break
fi
done
echo "exit: $EXIT_STATUS"
if (( $EXIT_STATUS )); then
echo "'${FILE}' hasn't been uploaded!"
github-release delete --owner VSCodium --repo vscodium --tag "${MS_TAG}" "${FILE}" "${FILE}.sha1" "${FILE}.sha256"
exit 1
fi
fi
echo "::endgroup::"
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
local DEFAULT_TRUE_TO_FALSE="${LINE_NUM}s/${DEFAULT_TRUE}/${DEFAULT_FALSE}/" if [[ $line == *"$DEFAULT_TRUE"* ]]; then
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
git pull origin master if [[ ! -z "${CHANGES}" ]]; then
git push origin master --quiet 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 push origin master --quiet
fi
fi fi
cd .. cd ..