diff --git a/contrib/build_bin.sh b/contrib/build_bin.sh index f060ef002..42264c1b7 100755 --- a/contrib/build_bin.sh +++ b/contrib/build_bin.sh @@ -1,5 +1,6 @@ #! /bin/bash # Script for building standalone binary releases deterministically +# Usage: First script parameter can be `--without-gui` to build without UI support set -ex @@ -8,8 +9,14 @@ eval "$(pyenv virtualenv-init -)" pip install -U pip pip install poetry +gui_support="${1:---with-gui}"; + # Setup poetry and install the dependencies -poetry install -E qt +if [[ $gui_support == "--with-gui" ]]; then + poetry install -E qt +else + poetry install +fi # We also need to change the timestamps of all of the base library files lib_dir=`pyenv root`/versions/3.9.7/lib/python3.9 @@ -18,8 +25,12 @@ TZ=UTC find ${lib_dir} -name '*.py' -type f -execdir touch -t "201901010000.00" # Make the standalone binary export PYTHONHASHSEED=42 poetry run pyinstaller hwi.spec -poetry run contrib/generate-ui.sh -poetry run pyinstaller hwi-qt.spec + +if [[ $gui_support == "--with-gui" ]]; then + poetry run contrib/generate-ui.sh + poetry run pyinstaller hwi-qt.spec +fi + unset PYTHONHASHSEED # Make the final compressed package @@ -30,12 +41,20 @@ if [[ $OS == "darwin" ]]; then OS="mac" fi target_tarfile="hwi-${VERSION}-${OS}-amd64.tar.gz" -tar -czf $target_tarfile hwi hwi-qt + +if [[ $gui_support == "--with-gui" ]]; then + tar -czf $target_tarfile hwi hwi-qt +else + tar -czf $target_tarfile hwi +fi # Copy the binaries to subdir for shasum target_dir="$target_tarfile.dir" mkdir $target_dir mv hwi $target_dir -mv hwi-qt $target_dir + +if [[ $gui_support == "--with-gui" ]]; then + mv hwi-qt $target_dir +fi popd diff --git a/contrib/build_dist.sh b/contrib/build_dist.sh index 6edc4681f..e15b9e5d9 100755 --- a/contrib/build_dist.sh +++ b/contrib/build_dist.sh @@ -1,5 +1,6 @@ #! /bin/bash # Script for building pypi distribution archives deterministically +# Usage: First script parameter can be `--without-gui` to build without UI support set -ex @@ -8,8 +9,14 @@ eval "$(pyenv virtualenv-init -)" pip install -U pip pip install poetry +gui_support="${1:---with-gui}"; + # Setup poetry and install the dependencies -poetry install -E qt +if [[ $gui_support == "--with-gui" ]]; then + poetry install -E qt +else + poetry install +fi # Make the distribution archives for pypi poetry build -f wheel diff --git a/docs/development/release-process.rst b/docs/development/release-process.rst index caa9cb1f6..9e764b84f 100644 --- a/docs/development/release-process.rst +++ b/docs/development/release-process.rst @@ -3,7 +3,7 @@ Release Process 1. Bump version number in ``pyproject.toml`` and ``hwilib/__init__.py``, generate the setup.py file, and git tag release 2. Build distribution archives for PyPi with ``contrib/build_dist.sh`` -3. For MacOS and Linux, use ``contrib/build_bin.sh``. This needs to be run on a MacOS machine for the MacOS binary and on a Linux machine for the linux one. +3. For MacOS and Linux, use ``contrib/build_bin.sh``. This needs to be run on a macOS machine for the macOS binary and on a Linux machine for the linux one. 4. For Windows, use ``contrib/build_wine.sh`` to build the Windows binary using wine 5. Make ``SHA256SUMS.txt`` using ``contrib/make_shasums.sh``. 6. Make ``SHA256SUMS.txt.asc`` using ``gpg --clearsign SHA256SUMS.txt``