From 9313f513f2106b488c3849252aecaad30ed4cffc Mon Sep 17 00:00:00 2001 From: Baptiste Augrain Date: Wed, 14 Aug 2024 12:09:50 +0200 Subject: [PATCH] feat: add reh-web --- .github/workflows/insider-linux.yml | 8 ++- .github/workflows/stable-linux.yml | 8 ++- build.sh | 10 ++-- check_tags.sh | 91 +++++++++++++++++++++++++++++ package_linux_reh.sh | 34 ++++++++--- prepare_assets.sh | 7 +++ 6 files changed, 139 insertions(+), 19 deletions(-) diff --git a/.github/workflows/insider-linux.yml b/.github/workflows/insider-linux.yml index 0fddc81b404..3bf6a7fd01f 100644 --- a/.github/workflows/insider-linux.yml +++ b/.github/workflows/insider-linux.yml @@ -113,6 +113,7 @@ jobs: - name: Build env: SHOULD_BUILD_REH: 'no' + SHOULD_BUILD_REH_WEB: 'no' run: ./build.sh if: env.SHOULD_BUILD == 'yes' @@ -206,6 +207,7 @@ jobs: - name: Prepare assets env: SHOULD_BUILD_REH: 'no' + SHOULD_BUILD_REH_WEB: 'no' run: ./prepare_assets.sh if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true') @@ -293,21 +295,21 @@ jobs: uses: actions/download-artifact@v3 with: name: vscode - if: env.SHOULD_BUILD_REH != 'no' || github.event.inputs.generate_assets == 'true' + if: env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no' || github.event.inputs.generate_assets == 'true' - name: Build env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} npm_config_arch: ${{ matrix.npm_arch }} run: ./package_linux_reh.sh - if: env.SHOULD_BUILD_REH != 'no' || github.event.inputs.generate_assets == 'true' + if: env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no' || github.event.inputs.generate_assets == 'true' - name: Release env: GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }} GITHUB_USERNAME: ${{ github.repository_owner }} run: ./release.sh - if: env.SHOULD_BUILD_REH != 'no' && env.SHOULD_DEPLOY == 'yes' + if: (env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no') && env.SHOULD_DEPLOY == 'yes' - name: Upload assets uses: actions/upload-artifact@v4 diff --git a/.github/workflows/stable-linux.yml b/.github/workflows/stable-linux.yml index 61591dcfbdb..58c7cce5635 100644 --- a/.github/workflows/stable-linux.yml +++ b/.github/workflows/stable-linux.yml @@ -112,6 +112,7 @@ jobs: - name: Build env: SHOULD_BUILD_REH: 'no' + SHOULD_BUILD_REH_WEB: 'no' run: ./build.sh if: env.SHOULD_BUILD == 'yes' @@ -205,6 +206,7 @@ jobs: - name: Prepare assets env: SHOULD_BUILD_REH: 'no' + SHOULD_BUILD_REH_WEB: 'no' run: ./prepare_assets.sh if: env.SHOULD_BUILD == 'yes' && (env.SHOULD_DEPLOY == 'yes' || github.event.inputs.generate_assets == 'true') @@ -292,21 +294,21 @@ jobs: uses: actions/download-artifact@v3 with: name: vscode - if: env.SHOULD_BUILD_REH != 'no' || github.event.inputs.generate_assets == 'true' + if: env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no' || github.event.inputs.generate_assets == 'true' - name: Build env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} npm_config_arch: ${{ matrix.npm_arch }} run: ./package_linux_reh.sh - if: env.SHOULD_BUILD_REH != 'no' || github.event.inputs.generate_assets == 'true' + if: env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no' || github.event.inputs.generate_assets == 'true' - name: Release env: GITHUB_TOKEN: ${{ secrets.STRONGER_GITHUB_TOKEN }} GITHUB_USERNAME: ${{ github.repository_owner }} run: ./release.sh - if: env.SHOULD_BUILD_REH != 'no' && env.SHOULD_DEPLOY == 'yes' + if: (env.SHOULD_BUILD_REH != 'no' || env.SHOULD_BUILD_REH_WEB != 'no') && env.SHOULD_DEPLOY == 'yes' - name: Upload assets uses: actions/upload-artifact@v4 diff --git a/build.sh b/build.sh index c31f61229cd..919a6a59fa3 100755 --- a/build.sh +++ b/build.sh @@ -35,6 +35,7 @@ if [[ "${SHOULD_BUILD}" == "yes" ]]; then if [[ "${VSCODE_ARCH}" != "ia32" && "${VSCODE_ARCH}" != "x64" ]]; then SHOULD_BUILD_REH="no" + SHOULD_BUILD_REH_WEB="no" fi VSCODE_PLATFORM="win32" @@ -50,13 +51,14 @@ if [[ "${SHOULD_BUILD}" == "yes" ]]; then fi if [[ "${SHOULD_BUILD_REH}" != "no" ]]; then - if [[ "${OS_NAME}" == "linux" ]]; then - export VSCODE_NODE_GLIBC='-glibc-2.17' - fi - yarn gulp minify-vscode-reh yarn gulp "vscode-reh-${VSCODE_PLATFORM}-${VSCODE_ARCH}-min-ci" fi + if [[ "${SHOULD_BUILD_REH_WEB}" != "no" ]]; then + yarn gulp minify-vscode-reh-web + yarn gulp "vscode-reh-web-${VSCODE_PLATFORM}-${VSCODE_ARCH}-min-ci" + fi + cd .. fi diff --git a/check_tags.sh b/check_tags.sh index 19047e42958..70b914dc69b 100755 --- a/check_tags.sh +++ b/check_tags.sh @@ -98,6 +98,13 @@ elif [[ "${ASSETS}" != "null" ]]; then export SHOULD_BUILD_REH="no" fi + if [[ -z $( contains "${APP_NAME_LC}-reh-web-darwin-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then + echo "Building on MacOS because we have no REH-web archive" + export SHOULD_BUILD="yes" + else + export SHOULD_BUILD_REH_WEB="no" + fi + if [[ "${SHOULD_BUILD}" != "yes" ]]; then echo "Already have all the MacOS builds" fi @@ -127,6 +134,7 @@ elif [[ "${ASSETS}" != "null" ]]; then fi export SHOULD_BUILD_REH="no" + export SHOULD_BUILD_REH_WEB="no" if [[ "${SHOULD_BUILD}" != "yes" ]]; then echo "Already have all the Windows arm64 builds" @@ -176,6 +184,13 @@ elif [[ "${ASSETS}" != "null" ]]; then export SHOULD_BUILD_REH="no" fi + if [[ -z $( contains "${APP_NAME_LC}-reh-web-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then + echo "Building on Windows ia32 because we have no REH-web archive" + export SHOULD_BUILD="yes" + else + export SHOULD_BUILD_REH_WEB="no" + fi + if [[ "${SHOULD_BUILD}" != "yes" ]]; then echo "Already have all the Windows ia32 builds" fi @@ -224,6 +239,13 @@ elif [[ "${ASSETS}" != "null" ]]; then export SHOULD_BUILD_REH="no" fi + if [[ -z $( contains "${APP_NAME_LC}-reh-web-win32-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then + echo "Building on Windows x64 because we have no REH-web archive" + export SHOULD_BUILD="yes" + else + export SHOULD_BUILD_REH_WEB="no" + fi + if [[ "${SHOULD_BUILD}" != "yes" ]]; then echo "Already have all the Windows x64 builds" fi @@ -231,6 +253,7 @@ elif [[ "${ASSETS}" != "null" ]]; then elif [[ "${OS_NAME}" == "linux" ]]; then if [[ "${CHECK_ONLY_REH}" == "yes" ]]; then + if [[ -z $( contains "${APP_NAME_LC}-reh-linux-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then echo "Building on Linux ${VSCODE_ARCH} because we have no REH archive" export SHOULD_BUILD="yes" @@ -238,6 +261,15 @@ elif [[ "${ASSETS}" != "null" ]]; then echo "Already have the Linux REH ${VSCODE_ARCH} archive" export SHOULD_BUILD_REH="no" fi + + if [[ -z $( contains "${APP_NAME_LC}-reh-web-linux-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then + echo "Building on Linux ${VSCODE_ARCH} because we have no REH-web archive" + export SHOULD_BUILD="yes" + else + echo "Already have the Linux REH-web ${VSCODE_ARCH} archive" + export SHOULD_BUILD_REH_WEB="no" + fi + else # linux-arm64 @@ -270,6 +302,13 @@ elif [[ "${ASSETS}" != "null" ]]; then export SHOULD_BUILD_REH="no" fi + if [[ "${CHECK_REH}" != "no" && -z $( contains "${APP_NAME_LC}-reh-web-linux-arm64-${RELEASE_VERSION}.tar.gz" ) ]]; then + echo "Building on Linux arm64 because we have no REH-web archive" + export SHOULD_BUILD="yes" + else + export SHOULD_BUILD_REH_WEB="no" + fi + export SHOULD_BUILD_APPIMAGE="no" if [[ "${SHOULD_BUILD}" != "yes" ]]; then @@ -307,6 +346,13 @@ elif [[ "${ASSETS}" != "null" ]]; then export SHOULD_BUILD_REH="no" fi + if [[ "${CHECK_REH}" != "no" && -z $( contains "${APP_NAME_LC}-reh-web-linux-armhf-${RELEASE_VERSION}.tar.gz" ) ]]; then + echo "Building on Linux arm because we have no REH-web archive" + export SHOULD_BUILD="yes" + else + export SHOULD_BUILD_REH_WEB="no" + fi + export SHOULD_BUILD_APPIMAGE="no" if [[ "${SHOULD_BUILD}" != "yes" ]]; then @@ -328,6 +374,13 @@ elif [[ "${ASSETS}" != "null" ]]; then export SHOULD_BUILD_REH="no" fi + if [[ -z $( contains "${APP_NAME_LC}-reh-web-linux-ppc64le-${RELEASE_VERSION}.tar.gz" ) ]]; then + echo "Building on Linux PowerPC64LE because we have no REH-web archive" + export SHOULD_BUILD="yes" + else + export SHOULD_BUILD_REH_WEB="no" + fi + if [[ "${SHOULD_BUILD}" != "yes" ]]; then echo "Already have all the Linux PowerPC64LE builds" fi @@ -353,6 +406,13 @@ elif [[ "${ASSETS}" != "null" ]]; then export SHOULD_BUILD_REH="no" fi + if [[ -z $( contains "${APP_NAME_LC}-reh-web-linux-riscv64-${RELEASE_VERSION}.tar.gz" ) ]]; then + echo "Building on Linux RISC-V 64 because we have no REH-web archive" + export SHOULD_BUILD="yes" + else + export SHOULD_BUILD_REH_WEB="no" + fi + if [[ "${SHOULD_BUILD}" != "yes" ]]; then echo "Already have all the Linux riscv64 builds" fi @@ -397,6 +457,13 @@ elif [[ "${ASSETS}" != "null" ]]; then export SHOULD_BUILD_REH="no" fi + if [[ "${CHECK_REH}" != "no" && -z $( contains "${APP_NAME_LC}-reh-web-linux-x64-${RELEASE_VERSION}.tar.gz" ) ]]; then + echo "Building on Linux x64 because we have no REH-web archive" + export SHOULD_BUILD="yes" + else + export SHOULD_BUILD_REH_WEB="no" + fi + if [[ "${SHOULD_BUILD}" != "yes" ]]; then echo "Already have all the Linux x64 builds" fi @@ -413,6 +480,14 @@ elif [[ "${ASSETS}" != "null" ]]; then echo "Already have the Alpine REH ${VSCODE_ARCH} archive" export SHOULD_BUILD_REH="no" fi + + if [[ -z $( contains "${APP_NAME_LC}-reh-web-alpine-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" ) ]]; then + echo "Building on Alpine ${VSCODE_ARCH} because we have no REH-web archive" + export SHOULD_BUILD="yes" + else + echo "Already have the Alpine REH-web ${VSCODE_ARCH} archive" + export SHOULD_BUILD_REH_WEB="no" + fi else # alpine-arm64 @@ -423,6 +498,13 @@ elif [[ "${ASSETS}" != "null" ]]; then else export SHOULD_BUILD_REH="no" fi + + if [[ "${CHECK_REH}" != "no" && -z $( contains "${APP_NAME_LC}-reh-web-alpine-arm64-${RELEASE_VERSION}.tar.gz" ) ]]; then + echo "Building on Alpine arm64 because we have no REH-web archive" + export SHOULD_BUILD="yes" + else + export SHOULD_BUILD_REH_WEB="no" + fi fi # alpine-x64 @@ -433,6 +515,13 @@ elif [[ "${ASSETS}" != "null" ]]; then else export SHOULD_BUILD_REH="no" fi + + if [[ "${CHECK_REH}" != "no" && -z $( contains "${APP_NAME_LC}-reh-web-alpine-x64-${RELEASE_VERSION}.tar.gz" ) ]]; then + echo "Building on Alpine x64 because we have no REH-web archive" + export SHOULD_BUILD="yes" + else + export SHOULD_BUILD_REH_WEB="no" + fi fi fi fi @@ -454,6 +543,7 @@ else elif [[ "${OS_NAME}" == "windows" ]]; then if [[ "${VSCODE_ARCH}" == "arm64" ]]; then export SHOULD_BUILD_REH="no" + export SHOULD_BUILD_REH_WEB="no" fi fi @@ -471,6 +561,7 @@ 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_REH=${SHOULD_BUILD_REH}" >> "${GITHUB_ENV}" +echo "SHOULD_BUILD_REH_WEB=${SHOULD_BUILD_REH_WEB}" >> "${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}" diff --git a/package_linux_reh.sh b/package_linux_reh.sh index 20970bb7e9a..86b1d49bdb9 100755 --- a/package_linux_reh.sh +++ b/package_linux_reh.sh @@ -7,6 +7,10 @@ if [[ "${CI_BUILD}" == "no" ]]; then exit 1 fi +APP_NAME_LC="$( echo "${APP_NAME}" | awk '{print tolower($0)}' )" + +mkdir -p assets + tar -xzf ./vscode.tar.gz cd vscode || { echo "'vscode' dir not found"; exit 1; } @@ -96,20 +100,32 @@ node build/azure-pipelines/distro/mixin-npm export VSCODE_NODE_GLIBC="-glibc-${GLIBC_VERSION}" -yarn gulp minify-vscode-reh -yarn gulp "vscode-reh-${VSCODE_PLATFORM}-${VSCODE_ARCH}-min-ci" +if [[ "${SHOULD_BUILD_REH}" != "no" ]]; then + echo "Building REH" + yarn gulp minify-vscode-reh + yarn gulp "vscode-reh-${VSCODE_PLATFORM}-${VSCODE_ARCH}-min-ci" -EXPECTED_GLIBC_VERSION="${GLIBC_VERSION}" EXPECTED_GLIBCXX_VERSION="${GLIBCXX_VERSION}" SEARCH_PATH="../vscode-reh-${VSCODE_PLATFORM}-${VSCODE_ARCH}" ./build/azure-pipelines/linux/verify-glibc-requirements.sh + EXPECTED_GLIBC_VERSION="${GLIBC_VERSION}" EXPECTED_GLIBCXX_VERSION="${GLIBCXX_VERSION}" SEARCH_PATH="../vscode-reh-${VSCODE_PLATFORM}-${VSCODE_ARCH}" ./build/azure-pipelines/linux/verify-glibc-requirements.sh -cd .. + echo "Archiving REH" + pushd "../vscode-reh-${VSCODE_PLATFORM}-${VSCODE_ARCH}" + tar czf "../assets/${APP_NAME_LC}-reh-${VSCODE_PLATFORM}-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" . + popd +fi -APP_NAME_LC="$( echo "${APP_NAME}" | awk '{print tolower($0)}' )" +if [[ "${SHOULD_BUILD_REH_WEB}" != "no" ]]; then + echo "Building REH-web" + yarn gulp minify-vscode-reh-web + yarn gulp "vscode-reh-web-${VSCODE_PLATFORM}-${VSCODE_ARCH}-min-ci" -mkdir -p assets + EXPECTED_GLIBC_VERSION="${GLIBC_VERSION}" EXPECTED_GLIBCXX_VERSION="${GLIBCXX_VERSION}" SEARCH_PATH="../vscode-reh-web-${VSCODE_PLATFORM}-${VSCODE_ARCH}" ./build/azure-pipelines/linux/verify-glibc-requirements.sh + + echo "Archiving REH-web" + pushd "../vscode-reh-web-${VSCODE_PLATFORM}-${VSCODE_ARCH}" + tar czf "../assets/${APP_NAME_LC}-reh-web-${VSCODE_PLATFORM}-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" . + popd +fi -echo "Building and moving REH" -cd "vscode-reh-${VSCODE_PLATFORM}-${VSCODE_ARCH}" -tar czf "../assets/${APP_NAME_LC}-reh-${VSCODE_PLATFORM}-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" . cd .. npm install -g checksum diff --git a/prepare_assets.sh b/prepare_assets.sh index 3ab7c1defac..fc3eb913dc2 100755 --- a/prepare_assets.sh +++ b/prepare_assets.sh @@ -219,6 +219,13 @@ if [[ "${SHOULD_BUILD_REH}" != "no" ]]; then cd .. fi +if [[ "${SHOULD_BUILD_REH_WEB}" != "no" ]]; then + echo "Building and moving REH-web" + cd "vscode-reh-web-${VSCODE_PLATFORM}-${VSCODE_ARCH}" + tar czf "../assets/${APP_NAME_LC}-reh-web-${VSCODE_PLATFORM}-${VSCODE_ARCH}-${RELEASE_VERSION}.tar.gz" . + cd .. +fi + cd assets for FILE in *; do