Skip to content

Commit

Permalink
Add cli only rpm (#11236)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
cmmarslender authored Apr 21, 2022
1 parent 25ab0c9 commit 527b30e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build-linux-installer-rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 28 additions & 0 deletions build_scripts/build_linux_rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/

0 comments on commit 527b30e

Please sign in to comment.