Pre-release dev_test_part29
#285
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: CodeOSS CI | |
on: | |
push: | |
branches: | |
- dev/* | |
tags: | |
- v*.*.* | |
pull_request: | |
branches: | |
- $default-branch | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NODE_VERSION: 16 | |
PYTHON_VERSION: "3.x" | |
RUST_VERSION: 1.65.0 | |
CODE_ICO_URL: https://github.com/LcJuves/vscode/raw/94cba4eb314f52fd18b47b72459954fda65302d0/resources/win32/code.ico | |
VSCODE_STEP_ON_IT: false | |
CACHE_VERSION: 1691224280 | |
PUBLISH_NAME: dev_test_part29 | |
PUBLISH_TAG_NAME: dev_test_part29 | |
PRE_RELEASE: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
generate-product-configurations: | |
name: Generate product configurations | |
runs-on: windows-2019 | |
outputs: | |
application-name: ${{ steps.write-job-variables.outputs.application-name }} | |
tunnel-application-name: ${{ steps.write-job-variables.outputs.tunnel-application-name }} | |
name-short: ${{ steps.write-job-variables.outputs.name-short }} | |
vscode-quality: ${{ steps.write-job-variables.outputs.vscode-quality }} | |
version: ${{ steps.write-job-variables.outputs.version }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Compute product configurations cache key | |
id: compute-product-configurations-cache-key | |
run: | | |
GITHUB_API_URL=https://api.github.com/repos/microsoft/vscode/releases | |
curl -H "Accept: application/vnd.github.v3+json" -s $GITHUB_API_URL >releases.json | |
# shellcheck disable=SC2034 | |
REMOTE_VERSION=$(node -p "require('./releases.json')[0]['tag_name']") | |
VERSION=$(node -p "require('./package.json')['version']") | |
echo "VERSION=$VERSION" >>"$GITHUB_ENV" | |
UNIVERSAL_ZIP_VERSION=$VERSION | |
[ "$GITHUB_REF_NAME" == "dev/real-time-synchronization" ] && UNIVERSAL_ZIP_VERSION=$REMOTE_VERSION | |
VS_ZIP_URL="https://update.code.visualstudio.com/${UNIVERSAL_ZIP_VERSION}/darwin-universal/stable" | |
CURL_DO_URL=$(curl -is "$VS_ZIP_URL" | grep Location | awk -F ": " '{print $2}' | tr -d "\r|\n") | |
echo "CURL_DO_URL=$CURL_DO_URL" >>"$GITHUB_ENV" | |
echo "key=$(echo "$CURL_DO_URL#$CACHE_VERSION" | sha512sum | awk '{print $1}')" >>"$GITHUB_OUTPUT" | |
- name: Cache product configurations | |
id: cache-product-configurations | |
uses: actions/cache@v3 | |
with: | |
path: | | |
product.json | |
resources/win32/VisualElementsManifest.xml | |
resources/server/manifest.json | |
resources/linux/AppImage.yml | |
key: "${{ runner.os }}${{ steps.compute-product-configurations-cache-key.outputs.key }}" | |
- name: Do generating ... | |
if: ${{ steps.cache-product-configurations.outputs.cache-hit != 'true' }} | |
run: | | |
VS_ZIP_NAME="VSCode-darwin-universal.zip" | |
curl -L -s -o $VS_ZIP_NAME "$CURL_DO_URL" | |
VS_PRODUCT_JSON_PATH="Visual Studio Code.app/Contents/Resources/app/product.json" | |
unzip $VS_ZIP_NAME "$VS_PRODUCT_JSON_PATH" | |
cp "$VS_PRODUCT_JSON_PATH" vs-product.json | |
node .github/generateProductConfigurations.js | |
- name: Publish product configurations | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Product configurations | |
path: | | |
product.json | |
vs-product.json | |
resources/win32/VisualElementsManifest.xml | |
resources/server/manifest.json | |
resources/linux/AppImage.yml | |
- name: Write job variables | |
id: write-job-variables | |
run: | | |
echo "application-name=$(node -p "require('./product.json')['applicationName']")" >>"$GITHUB_OUTPUT" | |
echo "tunnel-application-name=$(node -p "require('./product.json')['tunnelApplicationName']")" >>"$GITHUB_OUTPUT" | |
echo "name-short=$(node -p "require('./product.json')['nameShort']")" >>"$GITHUB_OUTPUT" | |
echo "vscode-quality=$(node -p "require('./product.json')['quality']||''")" >>"$GITHUB_OUTPUT" | |
echo "version=$VERSION" >>"$GITHUB_OUTPUT" | |
compile: | |
name: Compile | |
runs-on: ubuntu-20.04 | |
needs: generate-product-configurations | |
env: | |
VSCODE_ARCH: x64 | |
VSCODE_QUALITY: ${{ needs.generate-product-configurations.outputs.vscode-quality }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Download product configurations | |
uses: actions/download-artifact@v3 | |
with: | |
name: Product configurations | |
- name: Install build tools | |
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }} | |
run: | | |
sudo apt update -y | |
sudo apt install -y build-essential pkg-config libx11-dev libx11-xcb-dev libxkbfile-dev libsecret-1-dev libnotify-bin libkrb5-dev | |
- name: Compute node modules cache key | |
id: compute-node-modules-cache-key | |
run: echo "key=$(node build/azure-pipelines/common/computeNodeModulesCacheKey.js compile)" >>"$GITHUB_OUTPUT" | |
- name: Cache node modules | |
id: cache-node-modules | |
uses: actions/cache@v3 | |
with: | |
path: ".build/node_modules_cache" | |
key: "${{ runner.os }}GenericNodeModules${{ steps.compute-node-modules-cache-key.outputs.key }}${{ env.CACHE_VERSION }}" | |
- name: Extract node modules archive | |
if: ${{ steps.cache-node-modules.outputs.cache-hit == 'true' }} | |
run: tar -xJf .build/node_modules_cache/cache.tar.xz | |
- name: Install dependencies | |
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }} | |
run: | | |
for i in {1..5}; do # try 5 times | |
yarn --frozen-lockfile --check-files && break | |
if [ "$i" -eq 3 ]; then | |
echo "Yarn failed too many times" >&2 | |
exit 1 | |
fi | |
echo "Yarn failed $i, trying again..." | |
done | |
env: | |
ELECTRON_SKIP_BINARY_DOWNLOAD: 1 | |
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | |
- name: Create node modules archive | |
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }} | |
run: | | |
mkdir -p .build/node_modules_cache | |
node build/azure-pipelines/common/listNodeModules.js .build/node_modules_list.txt | |
tar -cJf .build/node_modules_cache/cache.tar.xz -T .build/node_modules_list.txt | |
- name: Install built-in extensions | |
uses: ./.github/workflows/install-builtin-extensions | |
with: | |
cache-version: ${{ env.CACHE_VERSION }} | |
- name: Compile & Hygiene | |
timeout-minutes: 60 | |
run: yarn npm-run-all -lp core-ci extensions-ci hygiene eslint valid-layers-check vscode-dts-compile-check tsec-compile-check | |
- name: Compile test suites | |
if: ${{ env.VSCODE_STEP_ON_IT == 'false' }} | |
run: | | |
yarn --cwd test/smoke compile | |
yarn --cwd test/integration/browser compile | |
- name: Compute openssl prebuilt cache key | |
id: compute-openssl-prebuilt-cache-key | |
run: echo "key=$(echo "OPENSSL_PREBUILT#$CACHE_VERSION" | sha512sum | awk '{print $1}')" >>"$GITHUB_OUTPUT" | |
- name: Cache openssl prebuilt | |
id: cache-openssl-prebuilt | |
uses: actions/cache@v3 | |
with: | |
path: openssl | |
key: "${{ runner.os }}${{ steps.compute-openssl-prebuilt-cache-key.outputs.key }}" | |
- name: Download & Extract openssl prebuilt | |
if: ${{ steps.cache-openssl-prebuilt.outputs.cache-hit != 'true' }} | |
run: | | |
OPENSSL_PREBUILT_VERSION=0.0.5 | |
npm pack @vscode/openssl-prebuilt@$OPENSSL_PREBUILT_VERSION | |
mkdir openssl | |
tar -xvzf vscode-openssl-prebuilt-$OPENSSL_PREBUILT_VERSION.tgz --strip-components=2 -C openssl package/out/ | |
- name: Compress compilation artifact | |
run: | | |
tar -cvJ --ignore-failed-read \ | |
--exclude='.build/node_modules_cache' \ | |
--exclude='.build/node_modules_list.txt' \ | |
--exclude='.build/distro' \ | |
-f compilation.tar.xz \ | |
.build out-* test/integration/browser/out test/smoke/out test/automation/out openssl | |
- name: Publish compilation artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Compilation | |
path: compilation.tar.xz | |
build-for-linux: | |
name: Build for Linux | |
runs-on: ubuntu-20.04 | |
container: | |
image: vscodehub.azurecr.io/vscode-linux-build-agent:${{ matrix.image-tag }} | |
options: --user 0:0 --cap-add SYS_ADMIN | |
needs: [generate-product-configurations, compile] | |
strategy: | |
matrix: | |
include: | |
- arch: x64 | |
image-tag: bionic-x64 | |
rust-host-triple: x86_64-unknown-linux-gnu | |
- arch: arm64 | |
image-tag: stretch-arm64 | |
rust-host-triple: aarch64-unknown-linux-gnu | |
- arch: armhf | |
image-tag: stretch-armhf | |
rust-host-triple: armv7-unknown-linux-gnueabihf | |
env: | |
VSCODE_ARCH: ${{ matrix.arch }} | |
APPLICATION_NAME: ${{ needs.generate-product-configurations.outputs.application-name }} | |
CLI_APP_NAME: ${{ needs.generate-product-configurations.outputs.tunnel-application-name }} | |
NAME_SHORT: ${{ needs.generate-product-configurations.outputs.name-short }} | |
VSCODE_QUALITY: ${{ needs.generate-product-configurations.outputs.vscode-quality }} | |
VERSION: ${{ needs.generate-product-configurations.outputs.version }} | |
RUST_HOST_TRIPLE: ${{ matrix.rust-host-triple }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- uses: ATiltedTree/setup-rust@v1.0.5 | |
with: | |
rust-version: ${{ env.RUST_VERSION }} | |
targets: ${{ matrix.rust-host-triple }} | |
- name: Download product configurations | |
uses: actions/download-artifact@v3 | |
with: | |
name: Product configurations | |
- name: Initialize job variables | |
run: | | |
NPM_ARCH=$VSCODE_ARCH | |
[ "${NPM_ARCH}" == "armhf" ] && NPM_ARCH=armv7l | |
echo "NPM_ARCH=$NPM_ARCH" >>"$GITHUB_ENV" | |
[ "$VSCODE_ARCH" == "x64" ] && echo "DISPLAY=:10" >>"$GITHUB_ENV" | |
- name: Setup system services | |
if: ${{ env.VSCODE_ARCH == 'x64' }} | |
run: | | |
# Start X server | |
/etc/init.d/xvfb start | |
# Start dbus session | |
DBUS_LAUNCH_RESULT=$(sudo dbus-daemon --config-file=/usr/share/dbus-1/system.conf --print-address) | |
echo "DBUS_SESSION_BUS_ADDRESS=$DBUS_LAUNCH_RESULT" >>"$GITHUB_ENV" | |
- name: Download compilation output | |
uses: actions/download-artifact@v3 | |
with: | |
name: Compilation | |
- name: Extract compilation output | |
run: tar -xJf compilation.tar.xz | |
- name: Compute node modules cache key | |
id: compute-node-modules-cache-key | |
run: echo "key=$(node build/azure-pipelines/common/computeNodeModulesCacheKey.js linux $VSCODE_ARCH)" >>"$GITHUB_OUTPUT" | |
- name: Cache node modules | |
id: cache-node-modules | |
uses: actions/cache@v3 | |
with: | |
path: ".build/node_modules_cache" | |
key: "${{ runner.os }}NodeModules${{ steps.compute-node-modules-cache-key.outputs.key }}${{ env.CACHE_VERSION }}" | |
- name: Extract node modules archive | |
if: ${{ steps.cache-node-modules.outputs.cache-hit == 'true' }} | |
run: tar -xJf .build/node_modules_cache/cache.tar.xz | |
- name: Install build dependencies | |
run: | | |
node build/npm/setupBuildYarnrc | |
for i in {1..3}; do | |
yarn --cwd build --frozen-lockfile --check-files && break | |
if [ "$i" -eq 3 ]; then | |
echo "Yarn failed too many times" >&2 | |
exit 1 | |
fi | |
echo "Yarn failed $i, trying again..." | |
done | |
- name: Install dependencies | |
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }} | |
run: | | |
if [ "$NPM_ARCH" = "armv7l" ]; then | |
# There is no target_arch="armv7l" supported by node_gyp, | |
# arm versions for compilation are decided based on the CC | |
# macros. | |
# Mapping value is based on | |
# https://github.com/nodejs/node/blob/0903515e126c2697042d6546c6aa4b72e1a4b33e/configure.py#L49-L50 | |
npm_config_arch="arm" | |
else | |
npm_config_arch=$NPM_ARCH | |
fi | |
export npm_config_arch | |
if [ -z "$CC" ] || [ -z "$CXX" ]; then | |
# Download clang based on chromium revision used by vscode | |
curl -s https://raw.githubusercontent.com/chromium/chromium/98.0.4758.109/tools/clang/scripts/update.py | | |
python - --output-dir="$PWD"/.build/CR_Clang --host-os=linux | |
# Download libcxx headers and objects from upstream electron releases | |
DEBUG=libcxx-fetcher \ | |
VSCODE_LIBCXX_OBJECTS_DIR=$PWD/.build/libcxx-objects \ | |
VSCODE_LIBCXX_HEADERS_DIR=$PWD/.build/libcxx_headers \ | |
VSCODE_LIBCXXABI_HEADERS_DIR=$PWD/.build/libcxxabi_headers \ | |
VSCODE_ARCH="$NPM_ARCH" \ | |
node build/linux/libcxx-fetcher.js | |
# Set compiler toolchain | |
# Flags for the client build are based on | |
# https://source.chromium.org/chromium/chromium/src/+/refs/tags/98.0.4758.109:build/config/arm.gni | |
# https://source.chromium.org/chromium/chromium/src/+/refs/tags/98.0.4758.109:build/config/compiler/BUILD.gn | |
# https://source.chromium.org/chromium/chromium/src/+/refs/tags/98.0.4758.109:build/config/c++/BUILD.gn | |
export CC="$PWD"/.build/CR_Clang/bin/clang | |
export CXX="$PWD"/.build/CR_Clang/bin/clang++ | |
export CXXFLAGS="-nostdinc++ -D__NO_INLINE__ -isystem$PWD/.build/libcxx_headers -isystem$PWD/.build/libcxx_headers/include -isystem$PWD/.build/libcxxabi_headers/include -fPIC -flto=thin -fsplit-lto-unit" | |
export LDFLAGS="-stdlib=libc++ -fuse-ld=lld -flto=thin -L$PWD/.build/libcxx-objects -lc++abi -Wl,--lto-O0" | |
# shellcheck disable=SC2155 | |
export VSCODE_REMOTE_CC="$(which gcc)" | |
# shellcheck disable=SC2155 | |
export VSCODE_REMOTE_CXX="$(which g++)" | |
fi | |
for i in {1..3}; do | |
yarn --frozen-lockfile --check-files && break | |
if [ "$i" -eq 3 ]; then | |
echo "Yarn failed too many times" >&2 | |
exit 1 | |
fi | |
echo "Yarn failed $i, trying again..." | |
done | |
env: | |
ELECTRON_SKIP_BINARY_DOWNLOAD: 1 | |
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | |
- name: Create node modules archive | |
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }} | |
run: | | |
mkdir -p .build/node_modules_cache | |
node build/azure-pipelines/common/listNodeModules.js .build/node_modules_list.txt | |
tar -cJf .build/node_modules_cache/cache.tar.xz --files-from .build/node_modules_list.txt | |
- name: Install built-in extensions | |
uses: ./.github/workflows/install-builtin-extensions | |
with: | |
cache-version: ${{ env.CACHE_VERSION }} | |
- name: Build client artifacts | |
run: | | |
BUILD_VERSION="$(date +%s)" | |
echo "::group::Build binary package" | |
yarn gulp vscode-linux-${VSCODE_ARCH}-min-ci | |
BUILD=$NAME_SHORT-linux-${VSCODE_ARCH} | |
(cd .. && cp -r VSCode-linux-${VSCODE_ARCH} $BUILD) | |
[ -z "${VSCODE_QUALITY}" ] && | |
XZ_TARBALL_NAME="${APPLICATION_NAME}-${VSCODE_ARCH}-$BUILD_VERSION.tar.xz" || | |
XZ_TARBALL_NAME="${APPLICATION_NAME}-${VSCODE_QUALITY}-${VSCODE_ARCH}-$BUILD_VERSION.tar.xz" | |
(cd .. && tar -cJf "$XZ_TARBALL_NAME" $BUILD) | |
mv ../"$XZ_TARBALL_NAME" . | |
echo "XZ_TARBALL_NAME=$XZ_TARBALL_NAME" >>"$GITHUB_ENV" | |
[ -z "${VSCODE_QUALITY}" ] && | |
GZ_TARBALL_NAME="${APPLICATION_NAME}-${VSCODE_ARCH}-$BUILD_VERSION.tar.gz" || | |
GZ_TARBALL_NAME="${APPLICATION_NAME}-${VSCODE_QUALITY}-${VSCODE_ARCH}-$BUILD_VERSION.tar.gz" | |
(cd .. && tar -zcf "$GZ_TARBALL_NAME" $BUILD) | |
mv ../"$GZ_TARBALL_NAME" . | |
echo "GZ_TARBALL_NAME=$GZ_TARBALL_NAME" >>"$GITHUB_ENV" | |
echo "::endgroup::" | |
echo "::group::Build rpm package" | |
yarn gulp vscode-linux-${VSCODE_ARCH}-build-rpm | |
case $VSCODE_ARCH in | |
x64) RPM_ARCH="x86_64" ;; | |
armhf) RPM_ARCH="armv7hl" ;; | |
arm64) RPM_ARCH="aarch64" ;; | |
*) RPM_ARCH="$VSCODE_ARCH" ;; | |
esac | |
RPM_OUT_DIR=.build/linux/rpm/$RPM_ARCH | |
RPM_FILENAME="$(cd $RPM_OUT_DIR && (ls ./*.rpm) | awk -F "./" 'NR==1{print $2}')" | |
mv "$RPM_OUT_DIR/$RPM_FILENAME" . | |
echo "RPM_FILENAME=$RPM_FILENAME" >>"$GITHUB_ENV" | |
echo "::endgroup::" | |
echo "::group::Build deb package" | |
yarn gulp vscode-linux-${VSCODE_ARCH}-build-deb | |
case $VSCODE_ARCH in | |
x64) DEB_ARCH="amd64" ;; | |
*) DEB_ARCH="$VSCODE_ARCH" ;; | |
esac | |
DEB_OUT_DIR=.build/linux/deb/$DEB_ARCH/deb | |
DEB_FILENAME="$(cd $DEB_OUT_DIR && (ls ./*.deb) | awk -F "./" 'NR==1{print $2}')" | |
mv "$DEB_OUT_DIR/$DEB_FILENAME" . | |
echo "DEB_FILENAME=$DEB_FILENAME" >>"$GITHUB_ENV" | |
echo "::endgroup::" | |
if [ "$VSCODE_ARCH" == "x64" ]; then | |
echo "::group::Build AppImage package" | |
npm install -g @liangchengj/nfserv && (nfserv >nfserv.log 2>&1 &) && (sleep 6 && cat nfserv.log) | |
DOWNLOAD_URL="http://127.0.0.1:9934/$DEB_FILENAME" | |
echo "DOWNLOAD_URL >>> $DOWNLOAD_URL" && export DOWNLOAD_URL | |
GITHUB_API_URL=https://api.github.com/repos/AppImage/pkg2appimage/releases | |
curl -H "Accept: application/vnd.github.v3+json" -s $GITHUB_API_URL >releases.json | |
BROWSER_DOWNLOAD_URL=$(node -p "require('./releases.json')[0]['assets'][0]['browser_download_url']") | |
curl -L -O -s "$BROWSER_DOWNLOAD_URL" && chmod u+x "$PWD/${BROWSER_DOWNLOAD_URL##*/}" | |
"$PWD/${BROWSER_DOWNLOAD_URL##*/}" "$APPIMAGE_YML_PATH" | |
APPIMAGE_FILENAME=$NAME_SHORT-linux-${VSCODE_ARCH}-$VERSION.AppImage | |
mv out/*.AppImage "$APPIMAGE_FILENAME" | |
echo "APPIMAGE_FILENAME=$APPIMAGE_FILENAME" >>"$GITHUB_ENV" | |
echo "::endgroup::" | |
fi | |
echo "::group::Build snap package" | |
set -x | |
yarn gulp vscode-linux-$VSCODE_ARCH-prepare-snap | |
SNAP_FILENAME="$APPLICATION_NAME-$VSCODE_QUALITY-$VSCODE_ARCH-$BUILD_VERSION.snap" | |
echo "SNAP_FILENAME=$SNAP_FILENAME" >>"$GITHUB_ENV" | |
DOCKER_IMAGE_NAME="docker.io/snapcore/snapcraft:stable" | |
SNAP_BUILD_SH_NAME="snap-build-$BUILD_VERSION.sh" | |
cat <<'EOF' >"$PWD/$SNAP_BUILD_SH_NAME" | |
cd /workspace || exit | |
# Make sure we get latest packages | |
sudo apt-get update | |
sudo apt-get upgrade -y | |
sudo apt-get install -y curl apt-transport-https ca-certificates | |
# Get snapcraft version | |
snapcraft --version | |
SNAP_ROOT="$PWD/.build/linux/snap/${VSCODE_ARCH}" | |
SNAP_PATH="$SNAP_ROOT/$SNAP_FILENAME" | |
case $VSCODE_ARCH in | |
x64) SNAP_ARCH="amd64" ;; | |
*) SNAP_ARCH="$VSCODE_ARCH" ;; | |
esac | |
(cd "$SNAP_ROOT/$APPLICATION_NAME-$VSCODE_ARCH" && | |
sudo --preserve-env snapcraft prime --target-arch "$SNAP_ARCH" && | |
snap pack prime --compression=lzo --filename="$SNAP_PATH") | |
mv "$SNAP_PATH" . | |
EOF | |
exec docker run -v "$PWD:/workspace" \ | |
-e APPLICATION_NAME=$APPLICATION_NAME \ | |
-e VSCODE_ARCH=$VSCODE_ARCH \ | |
-e SNAP_FILENAME=$SNAP_FILENAME \ | |
--entrypoint=bash $DOCKER_IMAGE_NAME -ex "/workspace/$SNAP_BUILD_SH_NAME" | |
echo "::endgroup::" | |
- name: Build server artifacts | |
run: | | |
yarn gulp vscode-reh-linux-${VSCODE_ARCH}-min-ci | |
SERVER_BUILD_NAME="$APPLICATION_NAME-server-linux-${VSCODE_ARCH}" | |
SERVER_TARBALL_FILENAME="$SERVER_BUILD_NAME.tar.gz" | |
(cd .. && cp -r vscode-reh-linux-${VSCODE_ARCH} $SERVER_BUILD_NAME) | |
(cd .. && tar -zcf $SERVER_TARBALL_FILENAME $SERVER_BUILD_NAME) | |
mv ../$SERVER_TARBALL_FILENAME . | |
echo "SERVER_TARBALL_FILENAME=$SERVER_TARBALL_FILENAME" >>"$GITHUB_ENV" | |
yarn gulp vscode-reh-web-linux-${VSCODE_ARCH}-min-ci | |
SERVER_WEB_BUILD_NAME="$APPLICATION_NAME-server-linux-${VSCODE_ARCH}-web" | |
SERVER_WEB_TARBALL_FILENAME="$SERVER_WEB_BUILD_NAME.tar.gz" | |
(cd .. && cp -r vscode-reh-web-linux-${VSCODE_ARCH} $SERVER_WEB_BUILD_NAME) | |
(cd .. && tar -zcf $SERVER_WEB_TARBALL_FILENAME $SERVER_WEB_BUILD_NAME) | |
mv ../$SERVER_WEB_TARBALL_FILENAME . | |
echo "SERVER_WEB_TARBALL_FILENAME=$SERVER_WEB_TARBALL_FILENAME" >>"$GITHUB_ENV" | |
- name: Generate SHA512 checksum files | |
run: | | |
gensha512() { (sha512sum "$1" | awk '{print $1}' >"$1".sha512); } | |
[ -f "$XZ_TARBALL_NAME" ] && gensha512 "$XZ_TARBALL_NAME" | |
[ -f "$GZ_TARBALL_NAME" ] && gensha512 "$GZ_TARBALL_NAME" | |
[ -f "$SERVER_TARBALL_FILENAME" ] && gensha512 "$SERVER_TARBALL_FILENAME" | |
[ -f "$SERVER_WEB_TARBALL_FILENAME" ] && gensha512 "$SERVER_WEB_TARBALL_FILENAME" | |
[ -f "$RPM_FILENAME" ] && gensha512 "$RPM_FILENAME" | |
[ -f "$DEB_FILENAME" ] && gensha512 "$DEB_FILENAME" | |
[ -f "$SNAP_FILENAME" ] && gensha512 "$SNAP_FILENAME" | |
[ -f "$APPIMAGE_FILENAME" ] && gensha512 "$APPIMAGE_FILENAME" | |
- name: Switch to tag name | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
echo "PUBLISH_NAME=${{ github.ref }}" >>"$GITHUB_ENV" | |
echo "PUBLISH_TAG_NAME=${{ github.ref }}" >>"$GITHUB_ENV" | |
echo "PRE_RELEASE=false" >>"$GITHUB_ENV" | |
- name: Publish artifacts | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: ${{ env.PUBLISH_NAME }} | |
tag_name: ${{ env.PUBLISH_TAG_NAME }} | |
prerelease: ${{ env.PRE_RELEASE }} | |
files: | | |
${{ env.XZ_TARBALL_NAME }} | |
${{ env.XZ_TARBALL_NAME }}.sha512 | |
${{ env.GZ_TARBALL_NAME }} | |
${{ env.GZ_TARBALL_NAME }}.sha512 | |
${{ env.RPM_FILENAME }} | |
${{ env.RPM_FILENAME }}.sha512 | |
${{ env.DEB_FILENAME }} | |
${{ env.DEB_FILENAME }}.sha512 | |
${{ env.SNAP_FILENAME }} | |
${{ env.SNAP_FILENAME }}.sha512 | |
${{ env.APPIMAGE_FILENAME }} | |
${{ env.APPIMAGE_FILENAME }}.sha512 | |
${{ env.SERVER_TARBALL_FILENAME }} | |
${{ env.SERVER_TARBALL_FILENAME }}.sha512 | |
${{ env.SERVER_WEB_TARBALL_FILENAME }} | |
${{ env.SERVER_WEB_TARBALL_FILENAME }}.sha512 | |
build-for-macos: | |
name: Build for macOS | |
runs-on: macos-11 | |
needs: [generate-product-configurations, compile] | |
strategy: | |
matrix: | |
include: | |
- arch: x64 | |
rust-host-triple-arch: x86_64 | |
- arch: arm64 | |
rust-host-triple-arch: aarch64 | |
env: | |
VSCODE_ARCH: ${{ matrix.arch }} | |
APPLICATION_NAME: ${{ needs.generate-product-configurations.outputs.application-name }} | |
CLI_APP_NAME: ${{ needs.generate-product-configurations.outputs.tunnel-application-name }} | |
NAME_SHORT: ${{ needs.generate-product-configurations.outputs.name-short }} | |
RUST_HOST_TRIPLE: ${{ matrix.rust-host-triple-arch }}-apple-darwin | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- uses: ATiltedTree/setup-rust@v1.0.5 | |
with: | |
rust-version: ${{ env.RUST_VERSION }} | |
targets: ${{ env.RUST_HOST_TRIPLE }} | |
- name: Download product configurations | |
uses: actions/download-artifact@v3 | |
with: | |
name: Product configurations | |
- name: Download compilation output | |
uses: actions/download-artifact@v3 | |
with: | |
name: Compilation | |
- name: Extract compilation output | |
run: tar -xJf compilation.tar.xz | |
- name: Compute node modules cache key | |
id: compute-node-modules-cache-key | |
run: echo "key=$(node build/azure-pipelines/common/computeNodeModulesCacheKey.js darwin $VSCODE_ARCH)" >>"$GITHUB_OUTPUT" | |
- name: Cache node modules | |
id: cache-node-modules | |
uses: actions/cache@v3 | |
with: | |
path: ".build/node_modules_cache" | |
key: "${{ runner.os }}NodeModules${{ steps.compute-node-modules-cache-key.outputs.key }}${{ env.CACHE_VERSION }}" | |
- name: Extract node modules archive | |
if: ${{ steps.cache-node-modules.outputs.cache-hit == 'true' }} | |
run: tar -xJf .build/node_modules_cache/cache.tar.xz | |
- name: Install dependencies | |
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }} | |
run: | | |
npm install -g node-gyp@latest | |
npm_config_arch=$VSCODE_ARCH | |
export npm_config_arch | |
npm_config_node_gyp=$(which node-gyp) | |
export npm_config_node_gyp | |
for i in {1..5}; do # try 5 times | |
yarn --frozen-lockfile --check-files && break | |
if [ $i -eq 3 ]; then | |
echo "Yarn failed too many times" >&2 | |
exit 1 | |
fi | |
echo "Yarn failed $i, trying again..." | |
done | |
env: | |
ELECTRON_SKIP_BINARY_DOWNLOAD: 1 | |
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | |
- name: Create node modules archive | |
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }} | |
run: | | |
mkdir -p .build/node_modules_cache | |
node build/azure-pipelines/common/listNodeModules.js .build/node_modules_list.txt | |
tar -cJf .build/node_modules_cache/cache.tar.xz --files-from .build/node_modules_list.txt | |
- name: Install built-in extensions | |
uses: ./.github/workflows/install-builtin-extensions | |
with: | |
cache-version: ${{ env.CACHE_VERSION }} | |
- name: Build client artifacts | |
run: | | |
yarn gulp vscode-darwin-${VSCODE_ARCH}-min-ci | |
BUILD=$NAME_SHORT-darwin-${VSCODE_ARCH} | |
(cd .. && cp -r VSCode-darwin-${VSCODE_ARCH} $BUILD) | |
export OPENSSL_LIB_DIR="$PWD/openssl/${VSCODE_ARCH}-osx/lib" | |
export OPENSSL_INCLUDE_DIR="$PWD/openssl/${VSCODE_ARCH}-osx/include" | |
(cd cli && cargo build --release --target "$RUST_HOST_TRIPLE" --bin=code) | |
APP_NAME="$(cd ../$BUILD && ls . | head -n 1)" | |
mv cli/target/"$RUST_HOST_TRIPLE"/release/code ../$BUILD/"$APP_NAME"/Contents/Resources/app/bin/"$CLI_APP_NAME" | |
XZ_TARBALL_NAME=$BUILD.tar.xz | |
(cd ../$BUILD && tar -cJf ../$XZ_TARBALL_NAME ./*.app) | |
mv ../$XZ_TARBALL_NAME . | |
echo "XZ_TARBALL_NAME=$XZ_TARBALL_NAME" >>"$GITHUB_ENV" | |
ZIP_NAME=$BUILD.zip | |
(cd ../$BUILD && zip -Xry -q ../$ZIP_NAME ./*.app) | |
mv ../$ZIP_NAME . | |
echo "ZIP_NAME=$ZIP_NAME" >>"$GITHUB_ENV" | |
- name: Build server artifacts | |
run: | | |
yarn gulp vscode-reh-darwin-$VSCODE_ARCH-min-ci | |
SERVER_BUILD_NAME="$APPLICATION_NAME-server-darwin-$VSCODE_ARCH" | |
SERVER_ZIP_NAME="$SERVER_BUILD_NAME.zip" | |
(cd .. && cp -r vscode-reh-darwin-$VSCODE_ARCH $SERVER_BUILD_NAME) | |
(cd .. && zip -Xry -q $SERVER_ZIP_NAME $SERVER_BUILD_NAME) | |
mv ../$SERVER_ZIP_NAME . | |
echo "SERVER_ZIP_NAME=$SERVER_ZIP_NAME" >>"$GITHUB_ENV" | |
yarn gulp vscode-reh-web-darwin-$VSCODE_ARCH-min-ci | |
SERVER_WEB_BUILD_NAME="$APPLICATION_NAME-server-darwin-$VSCODE_ARCH-web" | |
SERVER_WEB_ZIP_NAME="$SERVER_WEB_BUILD_NAME.zip" | |
(cd .. && cp -r vscode-reh-web-darwin-$VSCODE_ARCH $SERVER_WEB_BUILD_NAME) | |
(cd .. && zip -Xry -q $SERVER_WEB_ZIP_NAME $SERVER_WEB_BUILD_NAME) | |
mv ../$SERVER_WEB_ZIP_NAME . | |
echo "SERVER_WEB_ZIP_NAME=$SERVER_WEB_ZIP_NAME" >>"$GITHUB_ENV" | |
- name: Generate SHA512 checksum files | |
run: | | |
gensha512() { (shasum -a 512 "$1" | awk '{print $1}' >"$1".sha512); } | |
[ -f "$XZ_TARBALL_NAME" ] && gensha512 "$XZ_TARBALL_NAME" | |
[ -f "$ZIP_NAME" ] && gensha512 "$ZIP_NAME" | |
[ -f "$SERVER_ZIP_NAME" ] && gensha512 "$SERVER_ZIP_NAME" | |
[ -f "$SERVER_WEB_ZIP_NAME" ] && gensha512 "$SERVER_WEB_ZIP_NAME" | |
- name: Switch to tag name | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
echo "PUBLISH_NAME=${{ github.ref }}" >>"$GITHUB_ENV" | |
echo "PUBLISH_TAG_NAME=${{ github.ref }}" >>"$GITHUB_ENV" | |
echo "PRE_RELEASE=false" >>"$GITHUB_ENV" | |
- name: Publish artifacts | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: ${{ env.PUBLISH_NAME }} | |
tag_name: ${{ env.PUBLISH_TAG_NAME }} | |
prerelease: ${{ env.PRE_RELEASE }} | |
files: | | |
${{ env.XZ_TARBALL_NAME }} | |
${{ env.XZ_TARBALL_NAME }}.sha512 | |
${{ env.ZIP_NAME }} | |
${{ env.ZIP_NAME }}.sha512 | |
${{ env.SERVER_ZIP_NAME }} | |
${{ env.SERVER_ZIP_NAME }}.sha512 | |
${{ env.SERVER_WEB_ZIP_NAME }} | |
${{ env.SERVER_WEB_ZIP_NAME }}.sha512 | |
build-universal-application: | |
name: Build universal application | |
runs-on: macos-11 | |
needs: [generate-product-configurations, build-for-macos] | |
env: | |
VSCODE_ARCH: universal | |
NAME_SHORT: ${{ needs.generate-product-configurations.outputs.name-short }} | |
GITHUB_REPOSITORY: ${{ github.repository }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Download product configurations | |
uses: actions/download-artifact@v3 | |
with: | |
name: Product configurations | |
- name: Compute node modules cache key | |
id: compute-node-modules-cache-key | |
run: echo "key=$(node build/azure-pipelines/common/computeNodeModulesCacheKey.js darwin x64)" >>"$GITHUB_OUTPUT" | |
- name: Cache node modules | |
id: cache-node-modules | |
uses: actions/cache@v3 | |
with: | |
path: ".build/node_modules_cache" | |
key: "${{ runner.os }}NodeModules${{ steps.compute-node-modules-cache-key.outputs.key }}${{ env.CACHE_VERSION }}" | |
- name: Extract node modules archive | |
if: ${{ steps.cache-node-modules.outputs.cache-hit == 'true' }} | |
run: tar -xJf .build/node_modules_cache/cache.tar.xz | |
- name: Create Universal App | |
run: | | |
AGENT_BUILDDIRECTORY="$(cd .. && pwd)" | |
DOWNLOAD_URL_PREFIX="https://github.com/$GITHUB_REPOSITORY/releases/download/$PUBLISH_TAG_NAME" | |
curl -L -O -s "$DOWNLOAD_URL_PREFIX/$NAME_SHORT-darwin-arm64.tar.xz" | |
curl -L -O -s "$DOWNLOAD_URL_PREFIX/$NAME_SHORT-darwin-x64.tar.xz" | |
tar -xJf "$NAME_SHORT-darwin-arm64.tar.xz" | |
mkdir ../VSCode-darwin-arm64 && mv ./*.app ../VSCode-darwin-arm64/ | |
tar -xJf "$NAME_SHORT-darwin-x64.tar.xz" | |
mkdir ../VSCode-darwin-x64 && mv ./*.app ../VSCode-darwin-x64/ | |
DEBUG=* node build/darwin/create-universal-app.js "$AGENT_BUILDDIRECTORY" | |
BUILD=$NAME_SHORT-darwin-${VSCODE_ARCH} | |
(cd .. && cp -r VSCode-darwin-${VSCODE_ARCH} $BUILD) | |
XZ_TARBALL_NAME=$BUILD.tar.xz | |
(cd ../$BUILD && tar -cJf ../$XZ_TARBALL_NAME ./*.app) | |
mv ../$XZ_TARBALL_NAME . | |
echo "XZ_TARBALL_NAME=$XZ_TARBALL_NAME" >>"$GITHUB_ENV" | |
ZIP_NAME=$BUILD.zip | |
(cd ../$BUILD && zip -r -X -y -q ../$ZIP_NAME ./*.app) | |
mv ../$ZIP_NAME . | |
echo "ZIP_NAME=$ZIP_NAME" >>"$GITHUB_ENV" | |
- name: Generate SHA512 checksum files | |
run: | | |
gensha512() { (shasum -a 512 "$1" | awk '{print $1}' >"$1".sha512); } | |
[ -f "$XZ_TARBALL_NAME" ] && gensha512 "$XZ_TARBALL_NAME" | |
[ -f "$ZIP_NAME" ] && gensha512 "$ZIP_NAME" | |
- name: Switch to tag name | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
echo "PUBLISH_NAME=${{ github.ref }}" >>"$GITHUB_ENV" | |
echo "PUBLISH_TAG_NAME=${{ github.ref }}" >>"$GITHUB_ENV" | |
echo "PRE_RELEASE=false" >>"$GITHUB_ENV" | |
- name: Publish artifacts | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: ${{ env.PUBLISH_NAME }} | |
tag_name: ${{ env.PUBLISH_TAG_NAME }} | |
prerelease: ${{ env.PRE_RELEASE }} | |
files: | | |
${{ env.XZ_TARBALL_NAME }} | |
${{ env.XZ_TARBALL_NAME }}.sha512 | |
${{ env.ZIP_NAME }} | |
${{ env.ZIP_NAME }}.sha512 | |
build-for-windows: | |
name: Build for Windows | |
runs-on: windows-2019 | |
needs: [generate-product-configurations, compile] | |
strategy: | |
matrix: | |
include: | |
- arch: x64 | |
rust-host-triple-arch: x86_64 | |
- arch: arm64 | |
rust-host-triple-arch: aarch64 | |
- arch: ia32 | |
rust-host-triple-arch: i686 | |
env: | |
VSCODE_ARCH: ${{ matrix.arch }} | |
APPLICATION_NAME: ${{ needs.generate-product-configurations.outputs.application-name }} | |
CLI_APP_NAME: ${{ needs.generate-product-configurations.outputs.tunnel-application-name }} | |
NAME_SHORT: ${{ needs.generate-product-configurations.outputs.name-short }} | |
VERSION: ${{ needs.generate-product-configurations.outputs.version }} | |
RUST_HOST_TRIPLE: ${{ matrix.rust-host-triple-arch }}-pc-windows-msvc | |
RUSTFLAGS: "-C target-feature=+crt-static" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- uses: ATiltedTree/setup-rust@v1.0.5 | |
with: | |
rust-version: ${{ env.RUST_VERSION }} | |
targets: ${{ env.RUST_HOST_TRIPLE }} | |
- name: Download product configurations | |
uses: actions/download-artifact@v3 | |
with: | |
name: Product configurations | |
- name: Download compilation output | |
uses: actions/download-artifact@v3 | |
with: | |
name: Compilation | |
- name: Extract compilation output | |
run: tar -xJf compilation.tar.xz | |
- name: Compute node modules cache key | |
id: compute-node-modules-cache-key | |
run: echo "key=$(node build/azure-pipelines/common/computeNodeModulesCacheKey.js win32 $VSCODE_ARCH)" >>"$GITHUB_OUTPUT" | |
- name: Cache node modules | |
id: cache-node-modules | |
uses: actions/cache@v3 | |
with: | |
path: ".build/node_modules_cache" | |
key: "${{ runner.os }}NodeModules${{ steps.compute-node-modules-cache-key.outputs.key }}${{ env.CACHE_VERSION }}" | |
- name: Extract node modules archive | |
if: ${{ steps.cache-node-modules.outputs.cache-hit == 'true' }} | |
run: tar -xJf .build/node_modules_cache/cache.tar.xz | |
- name: Install dependencies | |
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }} | |
run: | | |
npm_config_arch=${VSCODE_ARCH} | |
export npm_config_arch | |
CHILD_CONCURRENCY="1" | |
export CHILD_CONCURRENCY | |
for i in {1..3}; do | |
yarn --frozen-lockfile --check-files && break | |
if [ "$i" -eq 3 ]; then | |
echo "Yarn failed too many times" >&2 | |
exit 1 | |
fi | |
echo "Yarn failed $i, trying again..." | |
done | |
env: | |
ELECTRON_SKIP_BINARY_DOWNLOAD: 1 | |
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | |
- name: Create node modules archive | |
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }} | |
run: | | |
mkdir -p .build/node_modules_cache | |
node build/azure-pipelines/common/listNodeModules.js .build/node_modules_list.txt | |
tar -cJf .build/node_modules_cache/cache.tar.xz --files-from .build/node_modules_list.txt | |
- name: Install built-in extensions | |
uses: ./.github/workflows/install-builtin-extensions | |
with: | |
cache-version: ${{ env.CACHE_VERSION }} | |
- name: Build client artifacts | |
run: | | |
echo "::group::Build binary package" | |
yarn gulp vscode-win32-${VSCODE_ARCH}-min-ci | |
OPENSSL_PREBUILT_ARCH=$([ "$VSCODE_ARCH" == "ia32" ] && echo "x86" || echo "$VSCODE_ARCH") | |
export OPENSSL_LIB_DIR="$PWD/openssl/${OPENSSL_PREBUILT_ARCH}-windows-static-md/lib" | |
export OPENSSL_INCLUDE_DIR="$PWD/openssl/${OPENSSL_PREBUILT_ARCH}-windows-static-md/include" | |
(cd cli && cargo build --release --target "$RUST_HOST_TRIPLE" --bin=code) | |
DEFAULT_BUILD=VSCode-win32-${VSCODE_ARCH} | |
mv cli/target/"$RUST_HOST_TRIPLE"/release/code.exe ../$DEFAULT_BUILD/bin/"$CLI_APP_NAME.exe" | |
BUILD=$NAME_SHORT-win32-${VSCODE_ARCH} | |
(cd .. && cp -r $DEFAULT_BUILD $BUILD) | |
XZ_TARBALL_NAME=$BUILD-$VERSION.tar.xz | |
(cd .. && tar -cJf $XZ_TARBALL_NAME $BUILD) | |
mv ../$XZ_TARBALL_NAME . | |
echo "XZ_TARBALL_NAME=$XZ_TARBALL_NAME" >>"$GITHUB_ENV" | |
ZIP_NAME=$BUILD-$VERSION.zip | |
(cd .. && 7z a -tzip $ZIP_NAME -x!CodeSignSummary*.md $BUILD -r) | |
mv ../$ZIP_NAME . | |
echo "ZIP_NAME=$ZIP_NAME" >>"$GITHUB_ENV" | |
echo "::endgroup::" | |
yarn gulp vscode-win32-${VSCODE_ARCH}-inno-updater | |
curl -L -s -o resources/win32/code.ico $CODE_ICO_URL | |
echo "::group::Build system setup installer" | |
yarn gulp vscode-win32-${VSCODE_ARCH}-system-setup | |
SYSTEM_SETUP_NAME=${NAME_SHORT}Setup-${VSCODE_ARCH}-$VERSION.exe | |
mv .build/win32-${VSCODE_ARCH}/system-setup/VSCodeSetup.exe $SYSTEM_SETUP_NAME | |
echo "SYSTEM_SETUP_NAME=$SYSTEM_SETUP_NAME" >>"$GITHUB_ENV" | |
echo "::endgroup::" | |
echo "::group::Build user setup installer" | |
yarn gulp vscode-win32-${VSCODE_ARCH}-user-setup | |
USER_SETUP_NAME=${NAME_SHORT}UserSetup-${VSCODE_ARCH}-$VERSION.exe | |
mv .build/win32-${VSCODE_ARCH}/user-setup/VSCodeSetup.exe $USER_SETUP_NAME | |
echo "USER_SETUP_NAME=$USER_SETUP_NAME" >>"$GITHUB_ENV" | |
echo "::endgroup::" | |
- name: Build server artifacts | |
if: ${{ env.VSCODE_ARCH != 'arm64' }} | |
run: | | |
yarn gulp vscode-reh-win32-${VSCODE_ARCH}-min-ci | |
SERVER_BUILD_NAME="$APPLICATION_NAME-server-win32-${VSCODE_ARCH}" | |
SERVER_ZIP_NAME="$SERVER_BUILD_NAME.zip" | |
(cd .. && cp -r vscode-reh-win32-${VSCODE_ARCH} $SERVER_BUILD_NAME) | |
(cd .. && 7z a -tzip $SERVER_ZIP_NAME $SERVER_BUILD_NAME -r) | |
mv ../$SERVER_ZIP_NAME . | |
echo "SERVER_ZIP_NAME=$SERVER_ZIP_NAME" >>"$GITHUB_ENV" | |
yarn gulp vscode-reh-web-win32-${VSCODE_ARCH}-min-ci | |
SERVER_WEB_BUILD_NAME="$APPLICATION_NAME-server-win32-${VSCODE_ARCH}-web" | |
SERVER_WEB_ZIP_NAME="$SERVER_WEB_BUILD_NAME.zip" | |
(cd .. && cp -r vscode-reh-web-win32-${VSCODE_ARCH} $SERVER_WEB_BUILD_NAME) | |
(cd .. && 7z a -tzip $SERVER_WEB_ZIP_NAME $SERVER_WEB_BUILD_NAME -r) | |
mv ../$SERVER_WEB_ZIP_NAME . | |
echo "SERVER_WEB_ZIP_NAME=$SERVER_WEB_ZIP_NAME" >>"$GITHUB_ENV" | |
- name: Generate SHA512 checksum files | |
run: | | |
gensha512() { (sha512sum "$1" | awk '{print $1}' >"$1".sha512); } | |
[ -f "$XZ_TARBALL_NAME" ] && gensha512 "$XZ_TARBALL_NAME" | |
[ -f "$ZIP_NAME" ] && gensha512 "$ZIP_NAME" | |
[ -f "$SYSTEM_SETUP_NAME" ] && gensha512 "$SYSTEM_SETUP_NAME" | |
[ -f "$USER_SETUP_NAME" ] && gensha512 "$USER_SETUP_NAME" | |
[ -f "$SERVER_ZIP_NAME" ] && gensha512 "$SERVER_ZIP_NAME" | |
[ -f "$SERVER_WEB_ZIP_NAME" ] && gensha512 "$SERVER_WEB_ZIP_NAME" | |
- name: Switch to tag name | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
echo "PUBLISH_NAME=${{ github.ref }}" >>"$GITHUB_ENV" | |
echo "PUBLISH_TAG_NAME=${{ github.ref }}" >>"$GITHUB_ENV" | |
echo "PRE_RELEASE=false" >>"$GITHUB_ENV" | |
- name: Publish artifacts | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: ${{ env.PUBLISH_NAME }} | |
tag_name: ${{ env.PUBLISH_TAG_NAME }} | |
prerelease: ${{ env.PRE_RELEASE }} | |
files: | | |
${{ env.XZ_TARBALL_NAME }} | |
${{ env.XZ_TARBALL_NAME }}.sha512 | |
${{ env.ZIP_NAME }} | |
${{ env.ZIP_NAME }}.sha512 | |
${{ env.SYSTEM_SETUP_NAME }} | |
${{ env.SYSTEM_SETUP_NAME }}.sha512 | |
${{ env.USER_SETUP_NAME }} | |
${{ env.USER_SETUP_NAME }}.sha512 | |
${{ env.SERVER_ZIP_NAME }} | |
${{ env.SERVER_ZIP_NAME }}.sha512 | |
${{ env.SERVER_WEB_ZIP_NAME }} | |
${{ env.SERVER_WEB_ZIP_NAME }}.sha512 | |
build-for-web: | |
name: Build for Web | |
runs-on: ubuntu-20.04 | |
needs: [generate-product-configurations, compile] | |
env: | |
VSCODE_ARCH: x64 | |
APPLICATION_NAME: ${{ needs.generate-product-configurations.outputs.application-name }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Download product configurations | |
uses: actions/download-artifact@v3 | |
with: | |
name: Product configurations | |
- name: Download compilation output | |
uses: actions/download-artifact@v3 | |
with: | |
name: Compilation | |
- name: Extract compilation output | |
run: tar -xJf compilation.tar.xz | |
- name: Compute node modules cache key | |
id: compute-node-modules-cache-key | |
run: echo "key=$(node build/azure-pipelines/common/computeNodeModulesCacheKey.js web)" >>"$GITHUB_OUTPUT" | |
- name: Cache node modules | |
id: cache-node-modules | |
uses: actions/cache@v3 | |
with: | |
path: ".build/node_modules_cache" | |
key: "WebNodeModules${{ steps.compute-node-modules-cache-key.outputs.key }}${{ env.CACHE_VERSION }}" | |
- name: Install build dependencies | |
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }} | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y libkrb5-dev | |
- name: Install dependencies | |
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }} | |
run: | | |
for i in {1..5}; do # try 5 times | |
yarn --frozen-lockfile --check-files && break | |
if [ $i -eq 3 ]; then | |
echo "Yarn failed too many times" >&2 | |
exit 1 | |
fi | |
echo "Yarn failed $i, trying again..." | |
done | |
env: | |
ELECTRON_SKIP_BINARY_DOWNLOAD: 1 | |
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | |
- name: Create node modules archive | |
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }} | |
run: | | |
mkdir -p .build/node_modules_cache | |
node build/azure-pipelines/common/listNodeModules.js .build/node_modules_list.txt | |
tar -cJf .build/node_modules_cache/cache.tar.xz --files-from .build/node_modules_list.txt | |
- name: Build artifact | |
run: | | |
yarn gulp vscode-web-min-ci | |
WEB_BUILD_NAME="$APPLICATION_NAME-web" | |
WEB_TARBALL_FILENAME="$APPLICATION_NAME-web.tar.gz" | |
(cd .. && cp -r vscode-web $WEB_BUILD_NAME) | |
(cd .. && tar --owner=0 --group=0 -czf $WEB_TARBALL_FILENAME $WEB_BUILD_NAME) | |
mv ../$WEB_TARBALL_FILENAME . | |
echo "WEB_TARBALL_FILENAME=$WEB_TARBALL_FILENAME" >>"$GITHUB_ENV" | |
- name: Generate SHA512 checksum file | |
run: | | |
gensha512() { (sha512sum "$1" | awk '{print $1}' >"$1".sha512); } | |
[ -f "$WEB_TARBALL_FILENAME" ] && gensha512 "$WEB_TARBALL_FILENAME" | |
- name: Switch to tag name | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
echo "PUBLISH_NAME=${{ github.ref }}" >>"$GITHUB_ENV" | |
echo "PUBLISH_TAG_NAME=${{ github.ref }}" >>"$GITHUB_ENV" | |
echo "PRE_RELEASE=false" >>"$GITHUB_ENV" | |
- name: Publish artifacts | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: ${{ env.PUBLISH_NAME }} | |
tag_name: ${{ env.PUBLISH_TAG_NAME }} | |
prerelease: ${{ env.PRE_RELEASE }} | |
files: | | |
${{ env.WEB_TARBALL_FILENAME }} | |
${{ env.WEB_TARBALL_FILENAME }}.sha512 |