Skip to content

Commit

Permalink
feat: add reh-web
Browse files Browse the repository at this point in the history
  • Loading branch information
daiyam committed Aug 14, 2024
1 parent 98747a7 commit 9313f51
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 19 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/insider-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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')

Expand Down Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/stable-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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')

Expand Down Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
91 changes: 91 additions & 0 deletions check_tags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -224,20 +239,37 @@ 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
fi
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"
else
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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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}"
Expand Down
34 changes: 25 additions & 9 deletions package_linux_reh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions prepare_assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9313f51

Please sign in to comment.