From 527b30e917247ab6eb747a8de12a6ced9ec6d621 Mon Sep 17 00:00:00 2001 From: Chris Marslender Date: Wed, 20 Apr 2022 23:39:51 -0500 Subject: [PATCH] Add cli only rpm (#11236) * Add cli only rpm * Ensure rvm (fpm) is loaded before running fpm * Use full path to fpm, since GHA seems to mess up the PATH in the container * Add back source and add use ruby-3 * Call rpm script with bash, to see if the rvm script works * Add --depends for libcrypt.so.1 --- .../workflows/build-linux-installer-rpm.yml | 2 +- build_scripts/build_linux_rpm.sh | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-linux-installer-rpm.yml b/.github/workflows/build-linux-installer-rpm.yml index b12a702ee64d..36c5795aae70 100644 --- a/.github/workflows/build-linux-installer-rpm.yml +++ b/.github/workflows/build-linux-installer-rpm.yml @@ -119,7 +119,7 @@ jobs: git -C ./chia-blockchain-gui status . ./activate cd ./build_scripts - sh build_linux_rpm.sh amd64 + bash build_linux_rpm.sh amd64 - name: Upload Linux artifacts uses: actions/upload-artifact@v3 diff --git a/build_scripts/build_linux_rpm.sh b/build_scripts/build_linux_rpm.sh index 21db74f43c41..60829b193737 100644 --- a/build_scripts/build_linux_rpm.sh +++ b/build_scripts/build_linux_rpm.sh @@ -43,6 +43,31 @@ if [ "$LAST_EXIT_CODE" -ne 0 ]; then exit $LAST_EXIT_CODE fi +# Builds CLI only rpm +CLI_RPM_BASE="chia-blockchain-cli-$CHIA_INSTALLER_VERSION-1.$REDHAT_PLATFORM" +mkdir -p "dist/$CLI_RPM_BASE/opt/chia" +mkdir -p "dist/$CLI_RPM_BASE/usr/bin" +cp -r dist/daemon/* "dist/$CLI_RPM_BASE/opt/chia/" +ln -s ../../opt/chia/chia "dist/$CLI_RPM_BASE/usr/bin/chia" +# This is built into the base build image +# shellcheck disable=SC1091 +. /etc/profile.d/rvm.sh +rvm use ruby-3 +# /usr/lib64/libcrypt.so.1 is marked as a dependency specifically because newer versions of fedora bundle +# libcrypt.so.2 by default, and the libxcrypt-compat package needs to be installed for the other version +# Marking as a dependency allows yum/dnf to automatically install the libxcrypt-compat package as well +fpm -s dir -t rpm \ + -C "dist/$CLI_RPM_BASE" \ + -p "dist/$CLI_RPM_BASE.rpm" \ + --name chia-blockchain-cli \ + --license Apache-2.0 \ + --version "$CHIA_INSTALLER_VERSION" \ + --architecture "$REDHAT_PLATFORM" \ + --description "Chia is a modern cryptocurrency built from scratch, designed to be efficient, decentralized, and secure." \ + --depends /usr/lib64/libcrypt.so.1 \ + . +# CLI only rpm done + cp -r dist/daemon ../chia-blockchain-gui/packages/gui cd .. || exit cd chia-blockchain-gui || exit @@ -109,4 +134,7 @@ if [ "$REDHAT_PLATFORM" = "x86_64" ]; then fi fi +# 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/