From 4ee76ba8c9b3108b82c8950fc88b03bb0bc3e2d1 Mon Sep 17 00:00:00 2001 From: Aditya Toshniwal Date: Thu, 1 Aug 2024 13:18:01 +0530 Subject: [PATCH] Build changes to sign pgAdmin4.exe and use yarn v3 on linux builds --- Make.bat | 16 ++++++++++++++++ pkg/linux/build-functions.sh | 12 +++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Make.bat b/Make.bat index 83844559b..52162faa7 100644 --- a/Make.bat +++ b/Make.bat @@ -26,6 +26,7 @@ CALL :CLEAN || EXIT /B 1 CALL :CREATE_VIRTUAL_ENV || EXIT /B 1 CALL :CREATE_PYTHON_ENV || EXIT /B 1 CALL :CREATE_RUNTIME_ENV || EXIT /B 1 +CALL :SIGN_PGADMIN_EXE || EXIT /B 1 CALL :GENERATE_SBOM || EXIT /B 1 CALL :CREATE_INSTALLER || EXIT /B 1 CALL :SIGN_INSTALLER || EXIT /B 1 @@ -358,6 +359,21 @@ REM Main build sequence Ends ECHO Generating SBOM... CALL syft "%BUILDROOT%" -o cyclonedx-json > "%BUILDROOT%\sbom.json" + EXIT /B 0 + +:SIGN_PGADMIN_EXE + ECHO Attempting to sign the pgAdmin4 exe.. + CALL "%PGADMIN_SIGNTOOL_DIR%\signtool.exe" sign /tr http://timestamp.digicert.com "%BUILDROOT%\runtime\pgAdmin4.exe" + IF %ERRORLEVEL% NEQ 0 ( + ECHO. + ECHO ************************************************************ + ECHO * Failed to sign the pgAdmin4 exe... + ECHO ************************************************************ + PAUSE + ) + + EXIT /B 0 + :SIGN_INSTALLER ECHO Attempting to sign the installer... CALL "%PGADMIN_SIGNTOOL_DIR%\signtool.exe" sign /tr http://timestamp.digicert.com "%DISTROOT%\%INSTALLERNAME%" diff --git a/pkg/linux/build-functions.sh b/pkg/linux/build-functions.sh index 74fba08ba..fbc4215d7 100644 --- a/pkg/linux/build-functions.sh +++ b/pkg/linux/build-functions.sh @@ -171,7 +171,15 @@ _build_runtime() { cp -r "${SOURCEDIR}/runtime/src" "${BUNDLEDIR}/resources/app/src" cp "${SOURCEDIR}/runtime/package.json" "${BUNDLEDIR}/resources/app" - yarn --cwd "${BUNDLEDIR}/resources/app" install --production=true + + # Install the runtime node_modules + pushd "${BUNDLEDIR}/resources/app" > /dev/null || exit + yarn set version berry + yarn set version 3 + yarn plugin import workspace-tools + yarn workspaces focus --production + + popd > /dev/null || exit # Create the icon mkdir -p "${DESKTOPROOT}/usr/share/icons/hicolor/128x128/apps/" @@ -212,6 +220,8 @@ _copy_code() { find "${SERVERROOT}/usr/${APP_NAME}/venv/" -name "_tkinter*" -print0 | xargs -0 rm -rf pushd "${SOURCEDIR}/web" > /dev/null || exit + yarn set version berry + yarn set version 3 yarn install yarn run bundle popd > /dev/null || exit