mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-11 18:58:59 +03:00
Build cli only version of debs (#11166)
* Build cli only version of debs * Export the vars needed by j2 * Fix paths * Add symlink to chia in /usr/local/bin/ * Upload the cli only debs to s3 * Add init.py * Ensure SHA is on the dev build for amd64
This commit is contained in:
parent
3ea3a4dc0c
commit
2fbe062e78
@ -137,10 +137,11 @@ jobs:
|
||||
CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}
|
||||
if: steps.check_secrets.outputs.HAS_SECRET
|
||||
run: |
|
||||
GIT_SHORT_HASH=$(echo "${GITHUB_SHA}" | cut -c1-8)
|
||||
CHIA_DEV_BUILD=${CHIA_INSTALLER_VERSION}-$GIT_SHORT_HASH
|
||||
echo "CHIA_DEV_BUILD=$CHIA_DEV_BUILD" >>$GITHUB_ENV
|
||||
aws s3 cp "$GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb" "s3://download.chia.net/dev/chia-blockchain_${CHIA_DEV_BUILD}_arm64.deb"
|
||||
GIT_SHORT_HASH=$(echo "${GITHUB_SHA}" | cut -c1-8)
|
||||
CHIA_DEV_BUILD=${CHIA_INSTALLER_VERSION}-$GIT_SHORT_HASH
|
||||
echo "CHIA_DEV_BUILD=$CHIA_DEV_BUILD" >>$GITHUB_ENV
|
||||
aws s3 cp "$GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb" "s3://download.chia.net/dev/chia-blockchain_${CHIA_DEV_BUILD}_arm64.deb"
|
||||
aws s3 cp "$GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb" "s3://download.chia.net/dev/chia-blockchain-cli_${CHIA_DEV_BUILD}-1_arm64.deb"
|
||||
|
||||
- name: Create Checksums
|
||||
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'
|
||||
@ -149,6 +150,7 @@ jobs:
|
||||
run: |
|
||||
ls $GITHUB_WORKSPACE/build_scripts/final_installer/
|
||||
sha256sum $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb > $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb.sha256
|
||||
sha256sum $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb > $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb.sha256
|
||||
ls $GITHUB_WORKSPACE/build_scripts/final_installer/
|
||||
|
||||
- name: Install py3createtorrent
|
||||
@ -162,6 +164,7 @@ jobs:
|
||||
CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}
|
||||
run: |
|
||||
py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb -o $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb.torrent --webseed https://download.chia.net/install/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb
|
||||
py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb -o $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb.torrent --webseed https://download.chia.net/install/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb
|
||||
ls $GITHUB_WORKSPACE/build_scripts/final_installer/
|
||||
|
||||
- name: Upload Beta Installer
|
||||
@ -171,16 +174,21 @@ jobs:
|
||||
run: |
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb s3://download.chia.net/beta/chia-blockchain_arm64_latest_beta.deb
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb.sha256 s3://download.chia.net/beta/chia-blockchain_arm64_latest_beta.deb.sha256
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb s3://download.chia.net/beta/chia-blockchain-cli_arm64_latest_beta.deb
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb.sha256 s3://download.chia.net/beta/chia-blockchain-cli_arm64_latest_beta.deb.sha256
|
||||
|
||||
- name: Upload Release Files
|
||||
if: steps.check_secrets.outputs.HAS_SECRET && startsWith(github.ref, 'refs/tags/')
|
||||
env:
|
||||
CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}
|
||||
run: |
|
||||
ls $GITHUB_WORKSPACE/build_scripts/final_installer/
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb s3://download.chia.net/install/
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb.sha256 s3://download.chia.net/install/
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb.torrent s3://download.chia.net/torrents/
|
||||
ls $GITHUB_WORKSPACE/build_scripts/final_installer/
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb s3://download.chia.net/install/
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb.sha256 s3://download.chia.net/install/
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_arm64.deb.torrent s3://download.chia.net/torrents/
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb s3://download.chia.net/install/
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb.sha256 s3://download.chia.net/install/
|
||||
aws s3 cp $GITHUB_WORKSPACE/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_arm64.deb.torrent s3://download.chia.net/torrents/
|
||||
|
||||
- name: Get tag name
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
|
32
.github/workflows/build-linux-installer-deb.yml
vendored
32
.github/workflows/build-linux-installer-deb.yml
vendored
@ -178,22 +178,24 @@ jobs:
|
||||
- name: Upload to s3
|
||||
if: steps.check_secrets.outputs.HAS_SECRET
|
||||
env:
|
||||
CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}
|
||||
CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}
|
||||
run: |
|
||||
GIT_SHORT_HASH=$(echo "${GITHUB_SHA}" | cut -c1-8)
|
||||
CHIA_DEV_BUILD=${CHIA_INSTALLER_VERSION}-$GIT_SHORT_HASH
|
||||
echo "CHIA_DEV_BUILD=$CHIA_DEV_BUILD" >>$GITHUB_ENV
|
||||
ls ${{ github.workspace }}/build_scripts/final_installer/
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb s3://download.chia.net/dev/chia-blockchain_${CHIA_DEV_BUILD}_amd64.deb
|
||||
GIT_SHORT_HASH=$(echo "${GITHUB_SHA}" | cut -c1-8)
|
||||
CHIA_DEV_BUILD=${CHIA_INSTALLER_VERSION}-$GIT_SHORT_HASH
|
||||
echo "CHIA_DEV_BUILD=$CHIA_DEV_BUILD" >>$GITHUB_ENV
|
||||
ls ${{ github.workspace }}/build_scripts/final_installer/
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb s3://download.chia.net/dev/chia-blockchain_${CHIA_DEV_BUILD}_amd64.deb
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb s3://download.chia.net/dev/chia-blockchain-cli_${CHIA_DEV_BUILD}-1_amd64.deb
|
||||
|
||||
- name: Create Checksums
|
||||
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'
|
||||
env:
|
||||
CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}
|
||||
run: |
|
||||
ls ${{ github.workspace }}/build_scripts/final_installer/
|
||||
sha256sum ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb > ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb.sha256
|
||||
ls ${{ github.workspace }}/build_scripts/final_installer/
|
||||
ls ${{ github.workspace }}/build_scripts/final_installer/
|
||||
sha256sum ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb > ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb.sha256
|
||||
sha256sum ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb > ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb.sha256
|
||||
ls ${{ github.workspace }}/build_scripts/final_installer/
|
||||
|
||||
- name: Install py3createtorrent
|
||||
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'
|
||||
@ -206,6 +208,7 @@ jobs:
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: |
|
||||
py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb -o ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb.torrent --webseed https://download.chia.net/install/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb
|
||||
py3createtorrent -f -t udp://tracker.opentrackr.org:1337/announce ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb -o ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb.torrent --webseed https://download.chia.net/install/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb
|
||||
ls
|
||||
|
||||
- name: Upload Beta Installer
|
||||
@ -215,15 +218,20 @@ jobs:
|
||||
run: |
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb s3://download.chia.net/beta/chia-blockchain_amd64_latest_beta.deb
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb.sha256 s3://download.chia.net/beta/chia-blockchain_amd64_latest_beta.deb.sha256
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb s3://download.chia.net/beta/chia-blockchain-cli_amd64_latest_beta.deb
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb.sha256 s3://download.chia.net/beta/chia-blockchain-cli_amd64_latest_beta.deb.sha256
|
||||
|
||||
- name: Upload Release Files
|
||||
env:
|
||||
CHIA_INSTALLER_VERSION: ${{ steps.version_number.outputs.CHIA_INSTALLER_VERSION }}
|
||||
if: steps.check_secrets.outputs.HAS_SECRET && startsWith(github.ref, 'refs/tags/')
|
||||
run: |
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb s3://download.chia.net/install/
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb.sha256 s3://download.chia.net/install/
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb.torrent s3://download.chia.net/torrents/
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb s3://download.chia.net/install/
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb.sha256 s3://download.chia.net/install/
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain_${CHIA_INSTALLER_VERSION}_amd64.deb.torrent s3://download.chia.net/torrents/
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb s3://download.chia.net/install/
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb.sha256 s3://download.chia.net/install/
|
||||
aws s3 cp ${{ github.workspace }}/build_scripts/final_installer/chia-blockchain-cli_${CHIA_INSTALLER_VERSION}-1_amd64.deb.torrent s3://download.chia.net/torrents/
|
||||
|
||||
- name: Get tag name
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
|
0
build_scripts/assets/deb/__init__.py
Normal file
0
build_scripts/assets/deb/__init__.py
Normal file
6
build_scripts/assets/deb/control.j2
Normal file
6
build_scripts/assets/deb/control.j2
Normal file
@ -0,0 +1,6 @@
|
||||
Package: chia-blockchain-cli
|
||||
Version: {{ CHIA_INSTALLER_VERSION }}
|
||||
Architecture: {{ PLATFORM }}
|
||||
Maintainer: Chia Network Inc <hello@chia.net>
|
||||
Description: Chia Blockchain
|
||||
Chia is a modern cryptocurrency built from scratch, designed to be efficient, decentralized, and secure.
|
5
build_scripts/assets/deb/postinst
Normal file
5
build_scripts/assets/deb/postinst
Normal file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
ln -s /opt/chia/chia /usr/local/bin/chia
|
5
build_scripts/assets/deb/prerm
Normal file
5
build_scripts/assets/deb/prerm
Normal file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
unlink /usr/local/bin/chia
|
@ -12,6 +12,7 @@ else
|
||||
PLATFORM="$1"
|
||||
DIR_NAME="chia-blockchain-linux-arm64"
|
||||
fi
|
||||
export PLATFORM
|
||||
|
||||
# If the env variable NOTARIZE and the username and password variables are
|
||||
# set, this will attempt to Notarize the signed DMG
|
||||
@ -21,6 +22,7 @@ if [ ! "$CHIA_INSTALLER_VERSION" ]; then
|
||||
CHIA_INSTALLER_VERSION="0.0.0"
|
||||
fi
|
||||
echo "Chia Installer Version is: $CHIA_INSTALLER_VERSION"
|
||||
export CHIA_INSTALLER_VERSION
|
||||
|
||||
echo "Installing npm and electron packagers"
|
||||
cd npm_linux_deb || exit
|
||||
@ -42,6 +44,20 @@ if [ "$LAST_EXIT_CODE" -ne 0 ]; then
|
||||
exit $LAST_EXIT_CODE
|
||||
fi
|
||||
|
||||
# Builds CLI only .deb
|
||||
# need j2 for templating the control file
|
||||
pip install j2cli
|
||||
CLI_DEB_BASE="chia-blockchain-cli_$CHIA_INSTALLER_VERSION-1_$PLATFORM"
|
||||
mkdir -p "dist/$CLI_DEB_BASE/opt/chia"
|
||||
mkdir -p "dist/$CLI_DEB_BASE/DEBIAN"
|
||||
j2 -o "dist/$CLI_DEB_BASE/DEBIAN/control" assets/deb/control.j2
|
||||
cp assets/deb/postinst "dist/$CLI_DEB_BASE/DEBIAN/postinst"
|
||||
cp assets/deb/prerm "dist/$CLI_DEB_BASE/DEBIAN/prerm"
|
||||
chmod 0755 "dist/$CLI_DEB_BASE/DEBIAN/postinst" "dist/$CLI_DEB_BASE/DEBIAN/prerm"
|
||||
cp -r dist/daemon/* "dist/$CLI_DEB_BASE/opt/chia/"
|
||||
dpkg-deb --build --root-owner-group "dist/$CLI_DEB_BASE"
|
||||
# CLI only .deb done
|
||||
|
||||
cp -r dist/daemon ../chia-blockchain-gui/packages/gui
|
||||
cd .. || exit
|
||||
cd chia-blockchain-gui || exit
|
||||
@ -92,4 +108,7 @@ if [ "$LAST_EXIT_CODE" -ne 0 ]; then
|
||||
exit $LAST_EXIT_CODE
|
||||
fi
|
||||
|
||||
# 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/
|
||||
|
||||
ls final_installer/
|
||||
|
Loading…
Reference in New Issue
Block a user