feat: dev build script can build only packages

This commit is contained in:
Baptiste Augrain 2022-10-02 10:39:39 +02:00
parent d7450f5afe
commit ae2b84df50
5 changed files with 34 additions and 12 deletions

1
.gitignore vendored
View file

@ -3,6 +3,7 @@ VS*/*
VSCode*
VSCodium*
.DS_Store
*.env
artifacts/
build/linux/appimage/out
build/linux/appimage/pkg2appimage.AppDir

View file

@ -6,7 +6,7 @@ if [[ "${SHOULD_BUILD}" == "yes" ]]; then
npm config set scripts-prepend-node-path true
npm config set node_gyp
echo "MS_COMMIT: ${MS_COMMIT}"
echo "MS_COMMIT=\"${MS_COMMIT}\""
. prepare_vscode.sh

View file

@ -6,11 +6,12 @@
export CI_BUILD="no"
export SHOULD_BUILD="yes"
export SKIP_BUILD="no"
export SKIP_PACKAGES="yes"
export VSCODE_LATEST="no"
export VSCODE_QUALITY="stable"
while getopts ":ilp" opt; do
while getopts ":ilop" opt; do
case "$opt" in
i)
export VSCODE_QUALITY="insider"
@ -18,6 +19,9 @@ while getopts ":ilp" opt; do
l)
export VSCODE_LATEST="yes"
;;
o)
export SKIP_BUILD="yes"
;;
p)
export SKIP_PACKAGES="no"
;;
@ -45,18 +49,35 @@ else
fi
echo "OS_NAME=\"${OS_NAME}\""
echo "SKIP_BUILD=\"${SKIP_BUILD}\""
echo "SKIP_PACKAGES=\"${SKIP_PACKAGES}\""
echo "VSCODE_ARCH=\"${VSCODE_ARCH}\""
echo "VSCODE_LATEST=\"${VSCODE_LATEST}\""
echo "VSCODE_QUALITY=\"${VSCODE_QUALITY}\""
rm -rf vscode* VSCode*
if [[ "${SKIP_BUILD}" == "no" ]]; then
rm -rf vscode* VSCode*
. get_repo.sh
. build.sh
. get_repo.sh
if [[ "${VSCODE_QUALITY}" == "insider" && "${VSCODE_LATEST}" == "yes" ]]; then
echo "$( cat "insider.json" | jq --arg 'tag' "${MS_TAG/\-insider/}" --arg 'commit' "${MS_COMMIT}" '. | .tag=$tag | .commit=$commit' )" > "insider.json"
# save variables for later
echo "MS_TAG=\"${MS_TAG}\"" > build.env
echo "MS_COMMIT=\"${MS_COMMIT}\"" >> build.env
echo "RELEASE_VERSION=\"${RELEASE_VERSION}\"" >> build.env
echo "BUILD_SOURCEVERSION=\"${BUILD_SOURCEVERSION}\"" >> build.env
. build.sh
if [[ "${VSCODE_QUALITY}" == "insider" && "${VSCODE_LATEST}" == "yes" ]]; then
echo "$( cat "insider.json" | jq --arg 'tag' "${MS_TAG/\-insider/}" --arg 'commit' "${MS_COMMIT}" '. | .tag=$tag | .commit=$commit' )" > "insider.json"
fi
else
. build.env
echo "MS_TAG=\"${MS_TAG}\""
echo "MS_COMMIT=\"${MS_COMMIT}\""
echo "RELEASE_VERSION=\"${RELEASE_VERSION}\""
echo "BUILD_SOURCEVERSION=\"${BUILD_SOURCEVERSION}\""
fi
if [[ "${SKIP_PACKAGES}" == "no" ]]; then

View file

@ -80,16 +80,16 @@ if [[ -z "${MS_TAG}" ]]; then
export MS_COMMIT=$( echo "${UPDATE_INFO}" | jq -r '.version' )
export MS_TAG=$( echo "${UPDATE_INFO}" | jq -r '.name' )
elif [[ -z "${MS_COMMIT}" ]]; then
reference=$( git ls-remote --tags | grep -x ".*refs\/tags\/${MS_TAG}" | head -1 )
REFERENCE=$( git ls-remote --tags | grep -x ".*refs\/tags\/${MS_TAG}" | head -1 )
if [[ -z "${reference}" ]]; then
if [[ -z "${REFERENCE}" ]]; then
echo "The following tag can't be found: ${MS_TAG}"
exit 1
elif [[ "${reference}" =~ ^([[:alnum:]]+)[[:space:]]+refs\/tags\/([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
elif [[ "${REFERENCE}" =~ ^([[:alnum:]]+)[[:space:]]+refs\/tags\/([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
export MS_COMMIT="${BASH_REMATCH[1]}"
export MS_TAG="${BASH_REMATCH[2]}"
else
echo "The following reference can't be parsed: ${reference}"
echo "The following reference can't be parsed: ${REFERENCE}"
exit 1
fi
fi

View file

@ -16,7 +16,7 @@ if [[ -z "${BUILD_SOURCEVERSION}" ]]; then
export BUILD_SOURCEVERSION=$( echo "${vscodium_hash}:${vscode_hash}" | checksum )
fi
echo "Build version: ${BUILD_SOURCEVERSION}"
echo "BUILD_SOURCEVERSION=\"${BUILD_SOURCEVERSION}\""
# for GH actions
if [[ $GITHUB_ENV ]]; then