mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2025-01-07 17:59:35 +03:00
Replace electron-packager
with electron-builder
(#12953)
* Install electron-builder * Replaced electron-packager with electron-builder for windows * Upgraded electron-builder version for mac * Replaced electron-packager with electron-builder for Linux and integreated deb/rpm dir * Updated mac installer job * Fixed app.asar location * Fixed dmg name for arm64 mac * Updated installer-version.py * Updated Linux(deb) installer CI job * Updated Linux(rpm) installer CI job * Fixed Linux(rpm) install CI issue * Revert to use `electron-packager` instead of `electron-builder` for arm64 .deb installer * Fixed lint errors * Fixed rpm installer job issue * Updated Windows installer CI job * Fixed rpm installer CI job * Simplified arm64 build * Added -y option to `apt install` command * Added `dmg-license` as npm build dependency for MacOS * Attempt to set product name appropriately for each platform * Specified productNames in commands * Fixed arm64 installer issue * Stopped to create link '/opt/chia/daemon' * Updated desktop app name for linux installers * Updated packageName for linux installers * Abort build jobs when 'cd' fails * Updated the GUI submodule ref (main:5e52b7f53478d4f39b4a0f0203f41e31dd53aee9) Co-authored-by: Jeff Cruikshank <jeff@chia.net>
This commit is contained in:
parent
90aeeba746
commit
b3b56a64d1
4
.github/workflows/build-macos-installers.yml
vendored
4
.github/workflows/build-macos-installers.yml
vendored
@ -159,8 +159,8 @@ jobs:
|
||||
NOTARIZE: ${{ steps.check_secrets.outputs.HAS_APPLE_SECRET }}
|
||||
APPLE_NOTARIZE_USERNAME: "${{ secrets.APPLE_NOTARIZE_USERNAME }}"
|
||||
APPLE_NOTARIZE_PASSWORD: "${{ secrets.APPLE_NOTARIZE_PASSWORD }}"
|
||||
MAC_PACKAGE_NAME: "${{ matrix.os.mac-package-name }}"
|
||||
MAC_FILE_SUFFIX: "${{ matrix.os.file-suffix }}"
|
||||
CSC_LINK: "${{ secrets.APPLE_DEV_ID_APP }}"
|
||||
CSC_KEY_PASSWORD: "${{ secrets.APPLE_DEV_ID_APP_PASS }}"
|
||||
run: |
|
||||
cd ./build_scripts
|
||||
sh build_macos-2-installer.sh
|
||||
|
@ -181,8 +181,8 @@ jobs:
|
||||
- name: Build Windows installer
|
||||
env:
|
||||
CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}
|
||||
WIN_CODE_SIGN_PASS: ${{ secrets.WIN_CODE_SIGN_PASS }}
|
||||
HAS_SECRET: ${{ steps.check_secrets.outputs.HAS_SIGNING_SECRET }}
|
||||
CSC_KEY_PASSWORD: ${{ secrets.WIN_CODE_SIGN_PASS }}
|
||||
run: |
|
||||
$env:path="C:\Program` Files` (x86)\Microsoft` Visual` Studio\2019\Enterprise\SDK\ScopeCppSDK\vc15\VC\bin\;$env:path"
|
||||
$env:path="C:\Program` Files` (x86)\Windows` Kits\10\App` Certification` Kit;$env:path"
|
||||
@ -285,11 +285,7 @@ jobs:
|
||||
|
||||
- name: Remove Windows exe and installer to exclude from cache
|
||||
run: |
|
||||
Remove-Item .\chia-blockchain-gui\packages\gui\Chia-win32-x64 -Recurse -Force
|
||||
Remove-Item .\chia-blockchain-gui\packages\gui\release-builds -Recurse -Force
|
||||
Remove-Item .\chia-blockchain-gui\packages\gui\dist -Recurse -Force
|
||||
Remove-Item .\chia-blockchain-gui\packages\gui\daemon -Recurse -Force
|
||||
If (Test-Path .\chia-blockchain-gui\packages\gui\win_code_sign_cert.p12) {
|
||||
Remove-Item .\chia-blockchain-gui\packages\gui\win_code_sign_cert.p12 -Force
|
||||
}
|
||||
Remove-Item .\chia-blockchain-gui\Chia-win32-x64 -Recurse -Force
|
||||
Remove-Item .\chia-blockchain-gui\release-builds -Recurse -Force
|
||||
|
@ -3,5 +3,4 @@
|
||||
|
||||
set -e
|
||||
|
||||
ln -s /usr/lib/chia-blockchain/resources/app.asar.unpacked/daemon/chia /usr/bin/chia || true
|
||||
ln -s /usr/lib/chia-blockchain/resources/app.asar.unpacked/daemon /opt/chia || true
|
||||
ln -s /opt/chia/resources/app.asar.unpacked/daemon/chia /usr/bin/chia || true
|
||||
|
@ -4,4 +4,3 @@
|
||||
set -e
|
||||
|
||||
unlink /usr/bin/chia || true
|
||||
unlink /opt/chia || true
|
||||
|
@ -3,5 +3,4 @@
|
||||
|
||||
set -e
|
||||
|
||||
ln -s /usr/lib/chia-blockchain/resources/app.asar.unpacked/daemon/chia /usr/bin/chia || true
|
||||
ln -s /usr/lib/chia-blockchain/resources/app.asar.unpacked/daemon /opt/chia || true
|
||||
ln -s /opt/chia/resources/app.asar.unpacked/daemon/chia /usr/bin/chia || true
|
||||
|
@ -4,4 +4,3 @@
|
||||
set -e
|
||||
|
||||
unlink /usr/bin/chia || true
|
||||
unlink /opt/chia || true
|
||||
|
@ -1,66 +0,0 @@
|
||||
const createDMG = require('electron-installer-dmg');
|
||||
|
||||
// Return positioning params for the DMG contents. x,y coordinates represent the
|
||||
// item's center point.
|
||||
function getContents(opts) {
|
||||
return [
|
||||
{
|
||||
x: 466,
|
||||
y: 280,
|
||||
type: 'link',
|
||||
path: '/Applications',
|
||||
},
|
||||
{
|
||||
x: 192,
|
||||
y: 280,
|
||||
type: 'file',
|
||||
path: opts.appPath,
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
async function main(opts) {
|
||||
console.log(`DMG creation options: ${JSON.stringify(opts, null, 2)}`);
|
||||
|
||||
const { appPath, appName, dmgIcon, dmgBackground, outputDir, appVersion } = opts;
|
||||
const dmgName = appName + (appVersion ? `-${appVersion}` : '');
|
||||
const dmgTitle = dmgName;
|
||||
|
||||
console.log(`DMG name set to: ${dmgName}`);
|
||||
console.log(`DMG title set to: ${dmgTitle}`);
|
||||
|
||||
console.log('Creating DMG...');
|
||||
await createDMG({
|
||||
appPath: appPath,
|
||||
name: dmgName,
|
||||
title: dmgTitle,
|
||||
icon: dmgIcon,
|
||||
background: dmgBackground,
|
||||
contents: getContents,
|
||||
overwrite: true,
|
||||
out: outputDir,
|
||||
});
|
||||
|
||||
console.log('Finished');
|
||||
}
|
||||
|
||||
const appName = 'Chia';
|
||||
const dmgIcon = '../chia-blockchain-gui/packages/gui/src/assets/img/Chia.icns';
|
||||
const dmgBackground = './assets/dmg/background.tiff';
|
||||
const outputDir = './final_installer';
|
||||
const appPath = process.argv[2]; // required
|
||||
const appVersion = process.argv[3]; // undefined is ok
|
||||
|
||||
if (!appPath) {
|
||||
console.error('appPath is required');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
main({
|
||||
appPath,
|
||||
appName,
|
||||
dmgIcon,
|
||||
dmgBackground,
|
||||
outputDir,
|
||||
appVersion,
|
||||
});
|
@ -3,14 +3,14 @@
|
||||
set -o errexit
|
||||
|
||||
echo "Installing global npm packages"
|
||||
cd npm_linux_deb || exit
|
||||
cd npm_linux || exit 1
|
||||
npm ci
|
||||
PATH=$(npm bin):$PATH
|
||||
|
||||
cd ../../ || exit
|
||||
cd ../../ || exit 1
|
||||
git submodule update --init chia-blockchain-gui
|
||||
|
||||
cd ./chia-blockchain-gui || exit
|
||||
cd ./chia-blockchain-gui || exit 1
|
||||
|
||||
echo "npm build"
|
||||
lerna clean -y
|
||||
@ -38,7 +38,7 @@ rm -rf packages/icons
|
||||
rm -rf packages/wallets
|
||||
|
||||
# Remove unused fat npm modules from the gui package
|
||||
cd ./packages/gui/node_modules
|
||||
cd ./packages/gui/node_modules || exit 1
|
||||
echo "Remove unused node_modules in the gui package to make cache slim more"
|
||||
rm -rf electron/dist # ~186MB
|
||||
rm -rf "@mui" # ~71MB
|
||||
|
@ -6,11 +6,9 @@ if [ ! "$1" ]; then
|
||||
echo "This script requires either amd64 of arm64 as an argument"
|
||||
exit 1
|
||||
elif [ "$1" = "amd64" ]; then
|
||||
PLATFORM="$1"
|
||||
DIR_NAME="chia-blockchain-linux-x64"
|
||||
PLATFORM="amd64"
|
||||
else
|
||||
PLATFORM="$1"
|
||||
DIR_NAME="chia-blockchain-linux-arm64"
|
||||
PLATFORM="arm64"
|
||||
fi
|
||||
export PLATFORM
|
||||
|
||||
@ -28,10 +26,10 @@ echo "Chia Installer Version is: $CHIA_INSTALLER_VERSION"
|
||||
export CHIA_INSTALLER_VERSION
|
||||
|
||||
echo "Installing npm and electron packagers"
|
||||
cd npm_linux_deb || exit
|
||||
cd npm_linux || exit 1
|
||||
npm ci
|
||||
PATH=$(npm bin):$PATH
|
||||
cd .. || exit
|
||||
cd .. || exit 1
|
||||
|
||||
echo "Create dist/"
|
||||
rm -rf dist
|
||||
@ -62,49 +60,64 @@ dpkg-deb --build --root-owner-group "dist/$CLI_DEB_BASE"
|
||||
cp -r dist/daemon ../chia-blockchain-gui/packages/gui
|
||||
|
||||
# Change to the gui package
|
||||
cd ../chia-blockchain-gui/packages/gui || exit
|
||||
cd ../chia-blockchain-gui/packages/gui || exit 1
|
||||
|
||||
# sets the version for chia-blockchain in package.json
|
||||
cp package.json package.json.orig
|
||||
jq --arg VER "$CHIA_INSTALLER_VERSION" '.version=$VER' package.json > temp.json && mv temp.json package.json
|
||||
|
||||
echo electron-packager
|
||||
electron-packager . chia-blockchain --asar.unpack="**/daemon/**" --platform=linux \
|
||||
--icon=src/assets/img/Chia.icns --overwrite --app-bundle-id=net.chia.blockchain \
|
||||
--appVersion=$CHIA_INSTALLER_VERSION --executable-name=chia-blockchain \
|
||||
--no-prune --no-deref-symlinks \
|
||||
--ignore="/node_modules/(?!ws(/|$))(?!@electron(/|$))" --ignore="^/src$" --ignore="^/public$"
|
||||
LAST_EXIT_CODE=$?
|
||||
# Note: `node_modules/ws` and `node_modules/@electron/remote` are dynamic dependencies
|
||||
# which GUI calls by `window.require('...')` at runtime.
|
||||
# So `ws` and `@electron/remote` cannot be ignored at this time.
|
||||
ls -l $DIR_NAME/resources
|
||||
echo "Building Linux(deb) Electron app"
|
||||
PRODUCT_NAME="chia"
|
||||
if [ "$PLATFORM" = "arm64" ]; then
|
||||
# electron-builder does not work for arm64 as of Aug 16, 2022.
|
||||
# This is a temporary fix.
|
||||
# https://github.com/jordansissel/fpm/issues/1801#issuecomment-919877499
|
||||
# @TODO Consolidates the process to amd64 if the issue of electron-builder is resolved
|
||||
sudo apt -y install ruby ruby-dev
|
||||
# `sudo gem install public_suffix -v 4.0.7` is required to fix the error below.
|
||||
# ERROR: Error installing fpm:
|
||||
# The last version of public_suffix (< 6.0, >= 2.0.2) to support your Ruby & RubyGems was 4.0.7. Try installing it with `gem install public_suffix -v 4.0.7` and then running the current command again
|
||||
# public_suffix requires Ruby version >= 2.6. The current ruby version is 2.5.0.
|
||||
# @TODO Maybe versions of sub dependencies should be managed by gem lock file.
|
||||
# @TODO Once ruby 2.6 can be installed on `apt install ruby`, installing public_suffix below should be removed.
|
||||
sudo gem install public_suffix -v 4.0.7
|
||||
sudo gem install fpm
|
||||
echo USE_SYSTEM_FPM=true electron-builder build --linux deb --arm64 \
|
||||
--config.productName="$PRODUCT_NAME" --config.linux.desktop.Name="Chia Blockchain" \
|
||||
--config.deb.packageName="chia-blockchain"
|
||||
USE_SYSTEM_FPM=true electron-builder build --linux deb --arm64 \
|
||||
--config.productName="$PRODUCT_NAME" --config.linux.desktop.Name="Chia Blockchain" \
|
||||
--config.deb.packageName="chia-blockchain"
|
||||
LAST_EXIT_CODE=$?
|
||||
else
|
||||
echo electron-builder build --linux deb --x64 \
|
||||
--config.productName="$PRODUCT_NAME" --config.linux.desktop.Name="Chia Blockchain" \
|
||||
--config.deb.packageName="chia-blockchain"
|
||||
electron-builder build --linux deb --x64 \
|
||||
--config.productName="$PRODUCT_NAME" --config.linux.desktop.Name="Chia Blockchain" \
|
||||
--config.deb.packageName="chia-blockchain"
|
||||
LAST_EXIT_CODE=$?
|
||||
fi
|
||||
ls -l dist/linux*-unpacked/resources
|
||||
|
||||
# reset the package.json to the original
|
||||
mv package.json.orig package.json
|
||||
|
||||
if [ "$LAST_EXIT_CODE" -ne 0 ]; then
|
||||
echo >&2 "electron-packager failed!"
|
||||
echo >&2 "electron-builder failed!"
|
||||
exit $LAST_EXIT_CODE
|
||||
fi
|
||||
|
||||
mv $DIR_NAME ../../../build_scripts/dist/
|
||||
cd ../../../build_scripts || exit
|
||||
GUI_DEB_NAME=chia-blockchain_${CHIA_INSTALLER_VERSION}_${PLATFORM}.deb
|
||||
mv "dist/${PRODUCT_NAME}-${CHIA_INSTALLER_VERSION}.deb" "../../../build_scripts/dist/${GUI_DEB_NAME}"
|
||||
cd ../../../build_scripts || exit 1
|
||||
|
||||
echo "Create chia-$CHIA_INSTALLER_VERSION.deb"
|
||||
echo "Create final installer"
|
||||
rm -rf final_installer
|
||||
mkdir final_installer
|
||||
electron-installer-debian --src "dist/$DIR_NAME/" \
|
||||
--arch "$PLATFORM" \
|
||||
--options.version "$CHIA_INSTALLER_VERSION" \
|
||||
--config deb-options.json
|
||||
LAST_EXIT_CODE=$?
|
||||
if [ "$LAST_EXIT_CODE" -ne 0 ]; then
|
||||
echo >&2 "electron-installer-debian failed!"
|
||||
exit $LAST_EXIT_CODE
|
||||
fi
|
||||
|
||||
mv "dist/${GUI_DEB_NAME}" final_installer/
|
||||
# Move the cli only deb into final installers as well, so it gets uploaded as an artifact
|
||||
mv "dist/$CLI_DEB_BASE.deb" final_installer/
|
||||
mv "dist/${CLI_DEB_BASE}.deb" final_installer/
|
||||
|
||||
ls final_installer/
|
||||
ls -l final_installer/
|
||||
|
@ -3,14 +3,14 @@
|
||||
set -o errexit
|
||||
|
||||
echo "Installing global npm packages"
|
||||
cd npm_linux_rpm || exit
|
||||
cd npm_linux || exit 1
|
||||
npm ci
|
||||
PATH=$(npm bin):$PATH
|
||||
|
||||
cd ../../ || exit
|
||||
cd ../../ || exit 1
|
||||
git submodule update --init chia-blockchain-gui
|
||||
|
||||
cd ./chia-blockchain-gui || exit
|
||||
cd ./chia-blockchain-gui || exit 1
|
||||
echo "npm build"
|
||||
lerna clean -y
|
||||
npm ci
|
||||
@ -37,7 +37,7 @@ rm -rf packages/icons
|
||||
rm -rf packages/wallets
|
||||
|
||||
# Remove unused fat npm modules from the gui package
|
||||
cd ./packages/gui/node_modules
|
||||
cd ./packages/gui/node_modules || exit 1
|
||||
echo "Remove unused node_modules in the gui package to make cache slim more"
|
||||
rm -rf electron/dist # ~186MB
|
||||
rm -rf "@mui" # ~71MB
|
||||
|
@ -9,12 +9,9 @@ if [ ! "$1" ]; then
|
||||
echo "This script requires either amd64 of arm64 as an argument"
|
||||
exit 1
|
||||
elif [ "$1" = "amd64" ]; then
|
||||
#PLATFORM="$1"
|
||||
REDHAT_PLATFORM="x86_64"
|
||||
DIR_NAME="chia-blockchain-linux-x64"
|
||||
export REDHAT_PLATFORM="x86_64"
|
||||
else
|
||||
#PLATFORM="$1"
|
||||
DIR_NAME="chia-blockchain-linux-arm64"
|
||||
export REDHAT_PLATFORM="arm64"
|
||||
fi
|
||||
|
||||
# If the env variable NOTARIZE and the username and password variables are
|
||||
@ -27,11 +24,10 @@ fi
|
||||
echo "Chia Installer Version is: $CHIA_INSTALLER_VERSION"
|
||||
|
||||
echo "Installing npm and electron packagers"
|
||||
cd npm_linux_rpm || exit
|
||||
cd npm_linux || exit 1
|
||||
npm ci
|
||||
GLOBAL_NPM_ROOT=$(pwd)/node_modules
|
||||
PATH=$(npm bin):$PATH
|
||||
cd .. || exit
|
||||
cd .. || exit 1
|
||||
|
||||
echo "Create dist/"
|
||||
rm -rf dist
|
||||
@ -74,64 +70,45 @@ fpm -s dir -t rpm \
|
||||
cp -r dist/daemon ../chia-blockchain-gui/packages/gui
|
||||
|
||||
# Change to the gui package
|
||||
cd ../chia-blockchain-gui/packages/gui || exit
|
||||
cd ../chia-blockchain-gui/packages/gui || exit 1
|
||||
|
||||
# sets the version for chia-blockchain in package.json
|
||||
cp package.json package.json.orig
|
||||
jq --arg VER "$CHIA_INSTALLER_VERSION" '.version=$VER' package.json > temp.json && mv temp.json package.json
|
||||
|
||||
echo electron-packager
|
||||
electron-packager . chia-blockchain --asar.unpack="**/daemon/**" --platform=linux \
|
||||
--icon=src/assets/img/Chia.icns --overwrite --app-bundle-id=net.chia.blockchain \
|
||||
--appVersion=$CHIA_INSTALLER_VERSION --executable-name=chia-blockchain \
|
||||
--no-prune --no-deref-symlinks \
|
||||
--ignore="/node_modules/(?!ws(/|$))(?!@electron(/|$))" --ignore="^/src$" --ignore="^/public$"
|
||||
echo "Building Linux(rpm) Electron app"
|
||||
OPT_ARCH="--x64"
|
||||
if [ "$REDHAT_PLATFORM" = "arm64" ]; then
|
||||
OPT_ARCH="--arm64"
|
||||
fi
|
||||
PRODUCT_NAME="chia"
|
||||
echo electron-builder build --linux rpm "${OPT_ARCH}" \
|
||||
--config.productName="${PRODUCT_NAME}" --config.linux.desktop.Name="Chia Blockchain" \
|
||||
--config.rpm.packageName="chia-blockchain"
|
||||
electron-builder build --linux rpm "${OPT_ARCH}" \
|
||||
--config.productName="${PRODUCT_NAME}" --config.linux.desktop.Name="Chia Blockchain" \
|
||||
--config.rpm.packageName="chia-blockchain"
|
||||
LAST_EXIT_CODE=$?
|
||||
# Note: `node_modules/ws` and `node_modules/@electron/remote` are dynamic dependencies
|
||||
# which GUI calls by `window.require('...')` at runtime.
|
||||
# So `ws` and `@electron/remote` cannot be ignored at this time.
|
||||
ls -l $DIR_NAME/resources
|
||||
ls -l dist/linux*-unpacked/resources
|
||||
|
||||
# reset the package.json to the original
|
||||
mv package.json.orig package.json
|
||||
|
||||
if [ "$LAST_EXIT_CODE" -ne 0 ]; then
|
||||
echo >&2 "electron-packager failed!"
|
||||
echo >&2 "electron-builder failed!"
|
||||
exit $LAST_EXIT_CODE
|
||||
fi
|
||||
|
||||
mv $DIR_NAME ../../../build_scripts/dist/
|
||||
cd ../../../build_scripts || exit
|
||||
GUI_RPM_NAME="chia-blockchain-${CHIA_INSTALLER_VERSION}-1.${REDHAT_PLATFORM}.rpm"
|
||||
mv "dist/${PRODUCT_NAME}-${CHIA_INSTALLER_VERSION}.rpm" "../../../build_scripts/dist/${GUI_RPM_NAME}"
|
||||
cd ../../../build_scripts || exit 1
|
||||
|
||||
if [ "$REDHAT_PLATFORM" = "x86_64" ]; then
|
||||
echo "Create chia-blockchain-$CHIA_INSTALLER_VERSION.rpm"
|
||||
|
||||
# Disables build links from the generated rpm so that we dont conflict with other packages. See https://github.com/Chia-Network/chia-blockchain/issues/3846
|
||||
# shellcheck disable=SC2086
|
||||
sed -i '1s/^/%define _build_id_links none\n%global _enable_debug_package 0\n%global debug_package %{nil}\n%global __os_install_post \/usr\/lib\/rpm\/brp-compress %{nil}\n/' "$GLOBAL_NPM_ROOT/electron-installer-redhat/resources/spec.ejs"
|
||||
|
||||
# Use attr feature of RPM to set the chrome-sandbox permissions
|
||||
# adds a %attr line after the %files line
|
||||
# The location is based on the existing location inside spec.ej
|
||||
sed -i '/^%files/a %attr(4755, root, root) /usr/lib/<%= name %>/chrome-sandbox' "$GLOBAL_NPM_ROOT/electron-installer-redhat/resources/spec.ejs"
|
||||
|
||||
# Updates the requirements for building an RPM on Centos 7 to allow older version of rpm-build and not use the boolean dependencies
|
||||
# See https://github.com/electron-userland/electron-installer-redhat/issues/157
|
||||
# shellcheck disable=SC2086
|
||||
sed -i "s#throw new Error('Please upgrade to RPM 4.13.*#console.warn('You are using RPM < 4.13')\n return { requires: [ 'gtk3', 'libnotify', 'nss', 'libXScrnSaver', 'libXtst', 'xdg-utils', 'at-spi2-core', 'libdrm', 'mesa-libgbm', 'libxcb' ] }#g" $GLOBAL_NPM_ROOT/electron-installer-redhat/src/dependencies.js
|
||||
|
||||
electron-installer-redhat --src dist/$DIR_NAME/ \
|
||||
--arch "$REDHAT_PLATFORM" \
|
||||
--options.version $CHIA_INSTALLER_VERSION \
|
||||
--config rpm-options.json
|
||||
LAST_EXIT_CODE=$?
|
||||
if [ "$LAST_EXIT_CODE" -ne 0 ]; then
|
||||
echo >&2 "electron-installer-redhat failed!"
|
||||
exit $LAST_EXIT_CODE
|
||||
fi
|
||||
fi
|
||||
echo "Create final installer"
|
||||
rm -rf final_installer
|
||||
mkdir final_installer
|
||||
|
||||
mv "dist/${GUI_RPM_NAME}" final_installer/
|
||||
# Move the cli only rpm into final installers as well, so it gets uploaded as an artifact
|
||||
mv "dist/$CLI_RPM_BASE.rpm" final_installer/
|
||||
|
||||
ls final_installer/
|
||||
ls -l final_installer/
|
||||
|
@ -5,13 +5,13 @@ set -o errexit -o nounset
|
||||
git status
|
||||
|
||||
echo "Installing global npm packages"
|
||||
cd npm_macos || exit
|
||||
cd npm_macos || exit 1
|
||||
npm ci
|
||||
PATH=$(npm bin):$PATH
|
||||
cd ../../ || exit
|
||||
cd ../../ || exit 1
|
||||
git submodule update --init chia-blockchain-gui
|
||||
|
||||
cd ./chia-blockchain-gui || exit
|
||||
cd ./chia-blockchain-gui || exit 1
|
||||
echo "npm build"
|
||||
lerna clean -y
|
||||
npm ci
|
||||
@ -38,7 +38,7 @@ rm -rf packages/icons
|
||||
rm -rf packages/wallets
|
||||
|
||||
# Remove unused fat npm modules from the gui package
|
||||
cd ./packages/gui/node_modules
|
||||
cd ./packages/gui/node_modules || exit 1
|
||||
echo "Remove unused node_modules in the gui package to make cache slim more"
|
||||
rm -rf electron/dist # ~186MB
|
||||
rm -rf "@mui" # ~71MB
|
||||
|
@ -14,11 +14,11 @@ if [ ! "$CHIA_INSTALLER_VERSION" ]; then
|
||||
fi
|
||||
echo "Chia Installer Version is: $CHIA_INSTALLER_VERSION"
|
||||
|
||||
echo "Installing npm and electron packagers"
|
||||
cd npm_macos || exit
|
||||
echo "Installing npm utilities"
|
||||
cd npm_macos || exit 1
|
||||
npm ci
|
||||
PATH=$(npm bin):$PATH
|
||||
cd .. || exit
|
||||
cd .. || exit 1
|
||||
|
||||
echo "Create dist/"
|
||||
sudo rm -rf dist
|
||||
@ -35,63 +35,48 @@ fi
|
||||
cp -r dist/daemon ../chia-blockchain-gui/packages/gui
|
||||
|
||||
# Change to the gui package
|
||||
cd ../chia-blockchain-gui/packages/gui || exit
|
||||
cd ../chia-blockchain-gui/packages/gui || exit 1
|
||||
|
||||
# sets the version for chia-blockchain in package.json
|
||||
brew install jq
|
||||
cp package.json package.json.orig
|
||||
jq --arg VER "$CHIA_INSTALLER_VERSION" '.version=$VER' package.json > temp.json && mv temp.json package.json
|
||||
|
||||
echo "electron-packager"
|
||||
electron-packager . Chia --asar.unpack="**/daemon/**" --platform=darwin \
|
||||
--icon=src/assets/img/Chia.icns --overwrite --app-bundle-id=net.chia.blockchain \
|
||||
--appVersion=$CHIA_INSTALLER_VERSION \
|
||||
--no-prune --no-deref-symlinks \
|
||||
--ignore="/node_modules/(?!ws(/|$))(?!@electron(/|$))" --ignore="^/src$" --ignore="^/public$"
|
||||
echo "Building macOS Electron app"
|
||||
OPT_ARCH="--x64"
|
||||
if [ "$(arch)" = "arm64" ]; then
|
||||
OPT_ARCH="--arm64"
|
||||
fi
|
||||
PRODUCT_NAME="Chia"
|
||||
echo electron-builder build --mac "${OPT_ARCH}" --config.productName="$PRODUCT_NAME"
|
||||
electron-builder build --mac "${OPT_ARCH}" --config.productName="$PRODUCT_NAME"
|
||||
LAST_EXIT_CODE=$?
|
||||
# Note: `node_modules/ws` and `node_modules/@electron/remote` are dynamic dependencies
|
||||
# which GUI calls by `window.require('...')` at runtime.
|
||||
# So `ws` and `@electron/remote` cannot be ignored at this time.
|
||||
ls -l "${MAC_PACKAGE_NAME}/Chia.app/Contents/Resources/app.asar"
|
||||
ls -l dist/mac*/chia.app/Contents/Resources/app.asar
|
||||
|
||||
# reset the package.json to the original
|
||||
mv package.json.orig package.json
|
||||
|
||||
if [ "$LAST_EXIT_CODE" -ne 0 ]; then
|
||||
echo >&2 "electron-packager failed!"
|
||||
echo >&2 "electron-builder failed!"
|
||||
exit $LAST_EXIT_CODE
|
||||
fi
|
||||
|
||||
if [ "$NOTARIZE" == true ]; then
|
||||
electron-osx-sign "${MAC_PACKAGE_NAME}/Chia.app" --platform=darwin \
|
||||
--hardened-runtime=true --provisioning-profile=chiablockchain.provisionprofile \
|
||||
--entitlements=entitlements.mac.plist --entitlements-inherit=entitlements.mac.plist \
|
||||
--no-gatekeeper-assess
|
||||
fi
|
||||
LAST_EXIT_CODE=$?
|
||||
if [ "$LAST_EXIT_CODE" -ne 0 ]; then
|
||||
echo >&2 "electron-osx-sign failed!"
|
||||
exit $LAST_EXIT_CODE
|
||||
fi
|
||||
mv dist/* ../../../build_scripts/dist/
|
||||
cd ../../../build_scripts || exit 1
|
||||
|
||||
mv "$MAC_PACKAGE_NAME" ../../../build_scripts/dist/
|
||||
cd ../../../build_scripts || exit
|
||||
|
||||
DMG_NAME="Chia-${CHIA_INSTALLER_VERSION}${MAC_FILE_SUFFIX}.dmg"
|
||||
echo "Create $DMG_NAME"
|
||||
mkdir final_installer
|
||||
NODE_PATH=./npm_macos/node_modules node build_dmg.js "dist/$MAC_PACKAGE_NAME/Chia.app" "${CHIA_INSTALLER_VERSION}${MAC_FILE_SUFFIX}"
|
||||
LAST_EXIT_CODE=$?
|
||||
if [ "$LAST_EXIT_CODE" -ne 0 ]; then
|
||||
echo >&2 "electron-installer-dmg failed!"
|
||||
exit $LAST_EXIT_CODE
|
||||
DMG_NAME="chia-${CHIA_INSTALLER_VERSION}.dmg"
|
||||
if [ "$(arch)" = "arm64" ]; then
|
||||
mv dist/${DMG_NAME} dist/chia-${CHIA_INSTALLER_VERSION}-arm64.dmg
|
||||
DMG_NAME=chia-${CHIA_INSTALLER_VERSION}-arm64.dmg
|
||||
fi
|
||||
mv dist/$DMG_NAME final_installer/
|
||||
|
||||
ls -lh final_installer
|
||||
|
||||
if [ "$NOTARIZE" == true ]; then
|
||||
echo "Notarize $DMG_NAME on ci"
|
||||
cd final_installer || exit
|
||||
cd final_installer || exit 1
|
||||
notarize-cli --file="$DMG_NAME" --bundle-id net.chia.blockchain \
|
||||
--username "$APPLE_NOTARIZE_USERNAME" --password "$APPLE_NOTARIZE_PASSWORD"
|
||||
echo "Notarization step complete"
|
||||
|
@ -32,10 +32,9 @@ Set-Location -Path ".\npm_windows" -PassThru
|
||||
npm ci
|
||||
$Env:Path = $(npm bin) + ";" + $Env:Path
|
||||
|
||||
Set-Location -Path "..\..\chia-blockchain-gui" -PassThru
|
||||
# We need the code sign cert in the gui subdirectory so we can actually sign the UI package
|
||||
Set-Location -Path "..\..\" -PassThru
|
||||
If ($env:HAS_SECRET) {
|
||||
Copy-Item "..\win_code_sign_cert.p12" -Destination "packages\gui\"
|
||||
$env:CSC_LINK = Join-Path "." "win_code_sign_cert.p12" -Resolve
|
||||
}
|
||||
|
||||
Write-Output " ---"
|
||||
@ -44,7 +43,7 @@ Write-Output " ---"
|
||||
$Env:NODE_OPTIONS = "--max-old-space-size=3000"
|
||||
|
||||
# Change to the GUI directory
|
||||
Set-Location -Path "packages\gui" -PassThru
|
||||
Set-Location -Path "chia-blockchain-gui\packages\gui" -PassThru
|
||||
|
||||
Write-Output " ---"
|
||||
Write-Output "Increase the stack for chia command for (chia plots create) chiapos limitations"
|
||||
@ -67,37 +66,26 @@ mv temp.json package.json
|
||||
Write-Output " ---"
|
||||
|
||||
Write-Output " ---"
|
||||
Write-Output "electron-packager"
|
||||
electron-packager . Chia --asar.unpack="**\daemon\**" `
|
||||
--overwrite --icon=.\src\assets\img\chia.ico --app-version=$packageVersion `
|
||||
--no-prune --no-deref-symlinks `
|
||||
--ignore="/node_modules/(?!ws(/|$))(?!@electron(/|$))" --ignore="^/src$" --ignore="^/public$"
|
||||
# Note: `node_modules/ws` and `node_modules/@electron/remote` are dynamic dependencies
|
||||
# which GUI calls by `window.require('...')` at runtime.
|
||||
# So `ws` and `@electron/remote` cannot be ignored at this time.
|
||||
Get-ChildItem Chia-win32-x64\resources
|
||||
Write-Output " ---"
|
||||
|
||||
Write-Output " ---"
|
||||
Write-Output "node winstaller.js"
|
||||
node winstaller.js
|
||||
Write-Output "electron-builder"
|
||||
electron-builder build --win --x64 --config.productName="Chia"
|
||||
Get-ChildItem dist\win-unpacked\resources
|
||||
Write-Output " ---"
|
||||
|
||||
If ($env:HAS_SECRET) {
|
||||
Write-Output " ---"
|
||||
Write-Output "Add timestamp and verify signature"
|
||||
Write-Output "Verify signature"
|
||||
Write-Output " ---"
|
||||
signtool.exe timestamp /v /t http://timestamp.comodoca.com/ .\release-builds\windows-installer\ChiaSetup-$packageVersion.exe
|
||||
signtool.exe verify /v /pa .\release-builds\windows-installer\ChiaSetup-$packageVersion.exe
|
||||
signtool.exe verify /v /pa .\dist\ChiaSetup-$packageVersion.exe
|
||||
} Else {
|
||||
Write-Output "Skipping timestamp and verify signatures - no authorization to install certificates"
|
||||
Write-Output "Skipping verify signatures - no authorization to install certificates"
|
||||
}
|
||||
|
||||
Write-Output " ---"
|
||||
Write-Output "Moving final installers to expected location"
|
||||
Write-Output " ---"
|
||||
Copy-Item ".\Chia-win32-x64" -Destination "$env:GITHUB_WORKSPACE\chia-blockchain-gui\" -Recurse
|
||||
Copy-Item ".\release-builds" -Destination "$env:GITHUB_WORKSPACE\chia-blockchain-gui\" -Recurse
|
||||
Copy-Item ".\dist\win-unpacked" -Destination "$env:GITHUB_WORKSPACE\chia-blockchain-gui\Chia-win32-x64" -Recurse
|
||||
mkdir "$env:GITHUB_WORKSPACE\chia-blockchain-gui\release-builds\windows-installer" -ea 0
|
||||
Copy-Item ".\dist\ChiaSetup-$packageVersion.exe" -Destination "$env:GITHUB_WORKSPACE\chia-blockchain-gui\release-builds\windows-installer"
|
||||
|
||||
Write-Output " ---"
|
||||
Write-Output "Windows Installer complete"
|
||||
|
@ -1,9 +0,0 @@
|
||||
{
|
||||
"dest": "final_installer/",
|
||||
"bin": "chia-blockchain",
|
||||
"name": "chia-blockchain",
|
||||
"scripts": {
|
||||
"postinst": "assets/deb/postinst.sh",
|
||||
"prerm": "assets/deb/prerm.sh"
|
||||
}
|
||||
}
|
@ -21,7 +21,7 @@ def main():
|
||||
dev_release_number = ""
|
||||
elif len(version) == 4:
|
||||
smc_patch_version = version[2]
|
||||
dev_release_number = "." + version[3]
|
||||
dev_release_number = "-" + version[3]
|
||||
else:
|
||||
smc_patch_version = ""
|
||||
dev_release_number = ""
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "npm_linux_rpm",
|
||||
"name": "npm_linux",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
@ -10,8 +10,7 @@
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"electron-installer-redhat": "^3.3.0",
|
||||
"electron-packager": "^15.4.0",
|
||||
"electron-builder": "^23.3.3",
|
||||
"lerna": "^5.4.0"
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
{
|
||||
"name": "npm_linux_deb",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"electron-installer-debian": "^3.1.0",
|
||||
"electron-packager": "^15.4.0",
|
||||
"lerna": "^5.4.0"
|
||||
}
|
||||
}
|
13910
build_scripts/npm_linux_rpm/package-lock.json
generated
13910
build_scripts/npm_linux_rpm/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
5998
build_scripts/npm_macos/package-lock.json
generated
5998
build_scripts/npm_macos/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -10,11 +10,9 @@
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"appdmg": "^0.6.4",
|
||||
"electron-installer-dmg": "^3.0.0",
|
||||
"electron-osx-sign": "^0.6.0",
|
||||
"electron-packager": "^15.4.0",
|
||||
"lerna": "^5.4.0",
|
||||
"@chia-network/notarize-cli": "^0.2.2"
|
||||
"@chia-network/notarize-cli": "^0.2.2",
|
||||
"dmg-license": "^1.0.11",
|
||||
"electron-builder": "^23.3.3",
|
||||
"lerna": "^5.4.0"
|
||||
}
|
||||
}
|
||||
|
3888
build_scripts/npm_windows/package-lock.json
generated
3888
build_scripts/npm_windows/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -10,7 +10,7 @@
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"electron-packager": "^15.4.0",
|
||||
"electron-builder": "^23.3.3",
|
||||
"lerna": "^5.4.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
"dest": "final_installer/",
|
||||
"bin": "chia-blockchain",
|
||||
"name": "chia-blockchain",
|
||||
"license": "../LICENSE",
|
||||
"scripts": {
|
||||
"post": "assets/rpm/postinst.sh",
|
||||
"preun": "assets/rpm/prerm.sh"
|
||||
}
|
||||
}
|
@ -1 +1 @@
|
||||
Subproject commit 55e776c875f27d2e80fed0105691ff8183040e18
|
||||
Subproject commit 5e52b7f53478d4f39b4a0f0203f41e31dd53aee9
|
Loading…
Reference in New Issue
Block a user