build.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/bin/bash
  2. ### Windows
  3. # to run with Bash: "C:\Program Files\Git\bin\bash.exe" ./build/build.sh
  4. ###
  5. export CI_BUILD="no"
  6. export SHOULD_BUILD="yes"
  7. export SKIP_PACKAGES="yes"
  8. export VSCODE_LATEST="no"
  9. export VSCODE_QUALITY="stable"
  10. while getopts ":ilp" opt; do
  11. case "$opt" in
  12. i)
  13. export VSCODE_QUALITY="insider"
  14. ;;
  15. l)
  16. export VSCODE_LATEST="yes"
  17. ;;
  18. p)
  19. export SKIP_PACKAGES="no"
  20. ;;
  21. esac
  22. done
  23. case "${OSTYPE}" in
  24. darwin*)
  25. export OS_NAME="osx"
  26. ;;
  27. msys* | cygwin*)
  28. export OS_NAME="windows"
  29. ;;
  30. *)
  31. export OS_NAME="linux"
  32. ;;
  33. esac
  34. UNAME_ARCH=$( uname -m )
  35. if [[ "${UNAME_ARCH}" == "arm64" ]]; then
  36. export VSCODE_ARCH="arm64"
  37. else
  38. export VSCODE_ARCH="x64"
  39. fi
  40. echo "OS_NAME=\"${OS_NAME}\""
  41. echo "SKIP_PACKAGES=\"${SKIP_PACKAGES}\""
  42. echo "VSCODE_ARCH=\"${VSCODE_ARCH}\""
  43. echo "VSCODE_LATEST=\"${VSCODE_LATEST}\""
  44. echo "VSCODE_QUALITY=\"${VSCODE_QUALITY}\""
  45. rm -rf vscode* VSCode*
  46. . get_repo.sh
  47. . build.sh
  48. if [[ "${VSCODE_QUALITY}" == "insider" && "${VSCODE_LATEST}" == "yes" ]]; then
  49. echo "$( cat "insider.json" | jq --arg 'tag' "${MS_TAG/\-insider/}" --arg 'commit' "${MS_COMMIT}" '. | .tag=$tag | .commit=$commit' )" > "insider.json"
  50. fi
  51. if [[ "${SKIP_PACKAGES}" == "no" ]]; then
  52. if [[ "${OS_NAME}" == "windows" ]]; then
  53. rm -rf build/windows/msi/releasedir
  54. fi
  55. . prepare_artifacts.sh
  56. fi