mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-11 18:58:59 +03:00
First attempt at a .deb build (#1372)
* First attempt at a .deb build * Actually run the linux installer. * src and dest * Lets use ubuntu to build the .deb... * Better options to installer-debian * package name of chia-blockchain * chia-blockchain * drop sudo * chia-blockchain-x64 dir * target amd64 * drop arch in packager * Prepare for ARM64 * ARM64? * Redhat and ARM take 2 * redhat in failure mode * redhat version issue * Limit ARM64 and try for both linux * Use 18.04 for x86 and manylinux2014 for ARM64 * Add RH - ARM64 fix * Try updated ARM64 podman, fix fake SCM version * No sudo * Install node correctly * remove sudo * Next time, save the changes... * need epel for fakeroot * Grrr -y * Correct fake setuptools * correct version number * Remove quotes * RH version fix? * try revision 0 * Remove revision * Don't set SCM_PRETEND
This commit is contained in:
parent
ddb92a0690
commit
33efff1d5d
68
.github/workflows/build-linux-arm64-installer.yml
vendored
Normal file
68
.github/workflows/build-linux-arm64-installer.yml
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
name: Linux ARM64 installer on Python 3.8
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Linux ARM64 installer on Python 3.8
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 40
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: [3.8]
|
||||
os: [ARM64]
|
||||
|
||||
steps:
|
||||
- name: Cancel previous runs on the same branch
|
||||
if: ${{ github.ref != 'refs/heads/dev' }}
|
||||
uses: styfle/cancel-workflow-action@0.8.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
||||
- name: Build ARM64 Installer
|
||||
run: |
|
||||
podman run --rm=true \
|
||||
-v ${{ github.workspace }}:/ws:rw --workdir=/ws \
|
||||
quay.io/pypa/manylinux2014_aarch64 \
|
||||
bash -exc '\
|
||||
echo $PATH && \
|
||||
yum install -y epel-release && \
|
||||
curl -sL https://rpm.nodesource.com/setup_12.x | bash - && \
|
||||
yum clean all && yum makecache fast && \
|
||||
yum install -y nodejs fakeroot dpkg && \
|
||||
rm -rf venv && \
|
||||
export PATH=/opt/python/cp38-cp38/bin/:$PATH && \
|
||||
/opt/python/cp38-cp38/bin/python -m venv venv && \
|
||||
if [ ! -f "activate" ]; then ln -s venv/bin/activate; fi && \
|
||||
. ./activate && \
|
||||
sh install.sh && \
|
||||
ldd --version && \
|
||||
cd build_scripts && \
|
||||
sh build_linux.sh arm64 \
|
||||
'
|
||||
|
||||
- name: Upload Linux artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Linux-ARM-64-Installer
|
||||
path: ${{ github.workspace }}/build_scripts/final_installer/
|
||||
|
||||
- name: Clean up on self hosted runner
|
||||
run: |
|
||||
sudo rm -rf build_scrpits/final_installer
|
96
.github/workflows/build-linux-installer.yml
vendored
Normal file
96
.github/workflows/build-linux-installer.yml
vendored
Normal file
@ -0,0 +1,96 @@
|
||||
name: Linux installer on Python 3.8
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Linux installer on Python 3.8
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 40
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: [3.8]
|
||||
os: [ubuntu-18.04]
|
||||
|
||||
steps:
|
||||
- name: Cancel previous runs on the same branch
|
||||
if: ${{ github.ref != 'refs/heads/dev' }}
|
||||
uses: styfle/cancel-workflow-action@0.8.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
||||
- name: Setup Python environment
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: actions/cache@v2.1.4
|
||||
env:
|
||||
cache-name: cache-node-modules
|
||||
with:
|
||||
# npm cache files are stored in `~/.npm` on Linux/macOS
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||
${{ runner.os }}-build-
|
||||
${{ runner.os }}-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v2.1.4
|
||||
with:
|
||||
# Note that new runners may break this https://github.com/actions/cache/issues/292
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
BUILD_VDF_CLIENT: "N"
|
||||
run: |
|
||||
sh install.sh
|
||||
|
||||
- name: Setup Node 12.x
|
||||
uses: actions/setup-node@v2.1.5
|
||||
with:
|
||||
node-version: '12.x'
|
||||
|
||||
- name: Build .deb and .rpm packages
|
||||
run: |
|
||||
. ./activate
|
||||
sudo apt-get -y install rpm
|
||||
ldd --version
|
||||
cd ./chia-blockchain-gui
|
||||
git status
|
||||
cd ../build_scripts
|
||||
sh build_linux.sh amd64
|
||||
|
||||
- name: Upload Linux artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Linux-Installers
|
||||
path: ${{ github.workspace }}/build_scripts/final_installer/
|
88
build_scripts/build_linux.sh
Normal file
88
build_scripts/build_linux.sh
Normal file
@ -0,0 +1,88 @@
|
||||
#!/bin/bash
|
||||
|
||||
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"
|
||||
else
|
||||
PLATFORM="$1"
|
||||
DIR_NAME="chia-blockchain-linux-arm64"
|
||||
fi
|
||||
|
||||
pip install setuptools_scm
|
||||
# The environment variable CHIA_INSTALLER_VERSION needs to be defined
|
||||
# If the env variable NOTARIZE and the username and password variables are
|
||||
# set, this will attempt to Notarize the signed DMG
|
||||
CHIA_INSTALLER_VERSION=$(python installer-version.py)
|
||||
|
||||
if [ ! "$CHIA_INSTALLER_VERSION" ]; then
|
||||
echo "WARNING: No environment variable CHIA_INSTALLER_VERSION set. Using 0.0.0."
|
||||
CHIA_INSTALLER_VERSION="0.0.0"
|
||||
fi
|
||||
echo "Chia Installer Version is: $CHIA_INSTALLER_VERSION"
|
||||
|
||||
echo "Installing npm and electron packagers"
|
||||
npm install electron-packager -g
|
||||
npm install electron-installer-debian -g
|
||||
npm install electron-installer-redhat -g
|
||||
|
||||
echo "Create dist/"
|
||||
rm -rf dist
|
||||
mkdir dist
|
||||
|
||||
echo "Create executables with pyinstaller"
|
||||
pip install pyinstaller==4.2
|
||||
pyinstaller --log-level=INFO daemon.spec
|
||||
cp -r dist/daemon ../chia-blockchain-gui
|
||||
cd .. || exit
|
||||
cd chia-blockchain-gui || exit
|
||||
|
||||
echo "npm build"
|
||||
npm install
|
||||
npm audit fix
|
||||
npm run build
|
||||
LAST_EXIT_CODE=$?
|
||||
if [ "$LAST_EXIT_CODE" -ne 0 ]; then
|
||||
echo >&2 "npm run build failed!"
|
||||
exit $LAST_EXIT_CODE
|
||||
fi
|
||||
|
||||
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
|
||||
LAST_EXIT_CODE=$?
|
||||
if [ "$LAST_EXIT_CODE" -ne 0 ]; then
|
||||
echo >&2 "electron-packager failed!"
|
||||
exit $LAST_EXIT_CODE
|
||||
fi
|
||||
|
||||
mv $DIR_NAME ../build_scripts/dist/
|
||||
cd ../build_scripts || exit
|
||||
|
||||
echo "Create chia-$CHIA_INSTALLER_VERSION.deb"
|
||||
rm -rf final_installer
|
||||
mkdir final_installer
|
||||
electron-installer-debian --src dist/$DIR_NAME/ --dest final_installer/ \
|
||||
--arch "$PLATFORM" --options.version $CHIA_INSTALLER_VERSION
|
||||
LAST_EXIT_CODE=$?
|
||||
if [ "$LAST_EXIT_CODE" -ne 0 ]; then
|
||||
echo >&2 "electron-installer-debian failed!"
|
||||
exit $LAST_EXIT_CODE
|
||||
fi
|
||||
|
||||
if [ "$REDHAT_PLATFORM" = "x86_64" ]; then
|
||||
echo "Create chia-blockchain-$CHIA_INSTALLER_VERSION.rpm"
|
||||
electron-installer-redhat --src dist/$DIR_NAME/ --dest final_installer/ \
|
||||
--arch "$REDHAT_PLATFORM" --options.version $CHIA_INSTALLER_VERSION \
|
||||
--license ../LICENSE
|
||||
LAST_EXIT_CODE=$?
|
||||
if [ "$LAST_EXIT_CODE" -ne 0 ]; then
|
||||
echo >&2 "electron-installer-redhat failed!"
|
||||
exit $LAST_EXIT_CODE
|
||||
fi
|
||||
fi
|
||||
|
||||
ls final_installer/
|
Loading…
Reference in New Issue
Block a user