Skip to content

Commit

Permalink
Revert "Removed lerna from build_scripts (#18180)"
Browse files Browse the repository at this point in the history
This reverts commit 7034c04.
  • Loading branch information
altendky authored Jun 21, 2024
1 parent 1d20bf3 commit ce8f6ca
Show file tree
Hide file tree
Showing 14 changed files with 31,521 additions and 8,636 deletions.
8 changes: 6 additions & 2 deletions build_scripts/build_linux_deb-1-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

set -o errexit

cd ../ || exit 1
echo "Installing global npm packages"
cd npm_linux || exit 1
npm ci

cd ../../ || exit 1
git submodule update --init chia-blockchain-gui

cd ./chia-blockchain-gui || exit 1

echo "npm build"
npx --no lerna clean -y # With --no option, `npx` guarantees not to install package from remote registry
npx lerna clean -y
npm ci
# Audit fix does not currently work with Lerna. See https://github.com/lerna/lerna/issues/1663
# npm audit fix
Expand Down
5 changes: 2 additions & 3 deletions build_scripts/build_linux_deb-2-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export CHIA_INSTALLER_VERSION
echo "Installing npm and electron packagers"
cd npm_linux || exit 1
npm ci
NPM_PATH="$(pwd)/node_modules/.bin"
cd .. || exit 1

echo "Create dist/"
Expand Down Expand Up @@ -109,12 +108,12 @@ if [ "$PLATFORM" = "arm64" ]; then
--config ../../../build_scripts/electron-builder.json
LAST_EXIT_CODE=$?
else
echo "${NPM_PATH}/electron-builder" build --linux deb --x64 \
echo electron-builder build --linux deb --x64 \
--config.extraMetadata.name=chia-blockchain \
--config.productName="$PRODUCT_NAME" --config.linux.desktop.Name="Chia Blockchain" \
--config.deb.packageName="chia-blockchain" \
--config ../../../build_scripts/electron-builder.json
"${NPM_PATH}/electron-builder" build --linux deb --x64 \
npx electron-builder build --linux deb --x64 \
--config.extraMetadata.name=chia-blockchain \
--config.productName="$PRODUCT_NAME" --config.linux.desktop.Name="Chia Blockchain" \
--config.deb.packageName="chia-blockchain" \
Expand Down
8 changes: 6 additions & 2 deletions build_scripts/build_linux_rpm-1-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

set -o errexit

cd ../ || exit 1
echo "Installing global npm packages"
cd npm_linux || exit 1
npm ci

cd ../../ || exit 1
git submodule update --init chia-blockchain-gui

cd ./chia-blockchain-gui || exit 1
echo "npm build"
npx --no lerna clean -y # With --no option, `npx` guarantees not to install package from remote registry
npx lerna clean -y
npm ci
# Audit fix does not currently work with Lerna. See https://github.com/lerna/lerna/issues/1663
# npm audit fix
Expand Down
5 changes: 2 additions & 3 deletions build_scripts/build_linux_rpm-2-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ echo "Chia Installer Version is: $CHIA_INSTALLER_VERSION"
echo "Installing npm and electron packagers"
cd npm_linux || exit 1
npm ci
NPM_PATH="$(pwd)/node_modules/.bin"
cd .. || exit 1

echo "Create dist/"
Expand Down Expand Up @@ -102,12 +101,12 @@ if [ "$REDHAT_PLATFORM" = "arm64" ]; then
OPT_ARCH="--arm64"
fi
PRODUCT_NAME="chia"
echo "${NPM_PATH}/electron-builder" build --linux rpm "${OPT_ARCH}" \
echo npx electron-builder build --linux rpm "${OPT_ARCH}" \
--config.extraMetadata.name=chia-blockchain \
--config.productName="${PRODUCT_NAME}" --config.linux.desktop.Name="Chia Blockchain" \
--config.rpm.packageName="chia-blockchain" \
--config ../../../build_scripts/electron-builder.json
"${NPM_PATH}/electron-builder" build --linux rpm "${OPT_ARCH}" \
npx electron-builder build --linux rpm "${OPT_ARCH}" \
--config.extraMetadata.name=chia-blockchain \
--config.productName="${PRODUCT_NAME}" --config.linux.desktop.Name="Chia Blockchain" \
--config.rpm.packageName="chia-blockchain" \
Expand Down
7 changes: 5 additions & 2 deletions build_scripts/build_macos-1-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ set -o errexit -o nounset

git status

cd ../ || exit 1
echo "Installing global npm packages"
cd npm_macos || exit 1
npm ci
cd ../../ || exit 1
git submodule update --init chia-blockchain-gui

cd ./chia-blockchain-gui || exit 1
echo "npm build"
npx --no lerna clean -y # With --no option, `npx` guarantees not to install package from remote registry
npx lerna clean -y
npm ci
# Audit fix does not currently work with Lerna. See https://github.com/lerna/lerna/issues/1663
# npm audit fix
Expand Down
11 changes: 2 additions & 9 deletions build_scripts/build_macos-2-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ echo "Chia Installer Version is: $CHIA_INSTALLER_VERSION"
echo "Installing npm utilities"
cd npm_macos || exit 1
npm ci
NPM_PATH="$(pwd)/node_modules/.bin"
cd .. || exit 1

echo "Create dist/"
Expand Down Expand Up @@ -67,14 +66,8 @@ else
echo "Not on ci or no secrets so not signing"
export CSC_IDENTITY_AUTO_DISCOVERY=false
fi
echo "${NPM_PATH}/electron-builder" build --mac "${OPT_ARCH}" \
--config.productName="$PRODUCT_NAME" \
--config.mac.minimumSystemVersion="11" \
--config ../../../build_scripts/electron-builder.json
"${NPM_PATH}/electron-builder" build --mac "${OPT_ARCH}" \
--config.productName="$PRODUCT_NAME" \
--config.mac.minimumSystemVersion="11" \
--config ../../../build_scripts/electron-builder.json
echo npx electron-builder build --mac "${OPT_ARCH}" --config.productName="$PRODUCT_NAME" --config.mac.minimumSystemVersion="11" --config ../../../build_scripts/electron-builder.json
npx electron-builder build --mac "${OPT_ARCH}" --config.productName="$PRODUCT_NAME" --config.mac.minimumSystemVersion="11" --config ../../../build_scripts/electron-builder.json
LAST_EXIT_CODE=$?
ls -l dist/mac*/chia.app/Contents/Resources/app.asar

Expand Down
10 changes: 8 additions & 2 deletions build_scripts/build_windows-1-gui.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ $ErrorActionPreference = "Stop"

git status

Set-Location -Path "..\" -PassThru
Write-Output " ---"
Write-Output "Setup npm packager"
Write-Output " ---"
Set-Location -Path ".\npm_windows" -PassThru
npm ci

Set-Location -Path "..\..\" -PassThru
git submodule update --init chia-blockchain-gui

Set-Location -Path ".\chia-blockchain-gui" -PassThru
Expand All @@ -15,7 +21,7 @@ Write-Output " ---"
$Env:NODE_OPTIONS = "--max-old-space-size=3000"

Write-Output "lerna clean -y"
npx --no lerna clean -y # With --no option, `npx` guarantees not to install package from remote registry
npx lerna clean -y
Write-Output "npm ci"
npm ci
# Audit fix does not currently work with Lerna. See https://github.com/lerna/lerna/issues/1663
Expand Down
6 changes: 1 addition & 5 deletions build_scripts/build_windows-2-installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ Write-Output "Setup npm packager"
Write-Output " ---"
Set-Location -Path ".\npm_windows" -PassThru
npm ci
$NPM_PATH = $pwd.PATH + "\node_modules\.bin"

Set-Location -Path "..\..\" -PassThru

Expand Down Expand Up @@ -69,10 +68,7 @@ Write-Output " ---"

Write-Output " ---"
Write-Output "electron-builder create package directory"
$OLD_ENV_PATH = $Env:Path
$Env:Path = $NPM_PATH + ";" + $Env:Path
electron-builder build --win --x64 --config.productName="Chia" --dir --config ../../../build_scripts/electron-builder.json
$Env:Path = $OLD_ENV_PATH
npx electron-builder build --win --x64 --config.productName="Chia" --dir --config ../../../build_scripts/electron-builder.json
Get-ChildItem dist\win-unpacked\resources
Write-Output " ---"

Expand Down
Loading

0 comments on commit ce8f6ca

Please sign in to comment.