Files
omarchy-iso/bin/omarchy-iso-release
T

63 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
MAKE_ARGS=()
ISO_REF=quattro
RELEASE_SUFFIX=""
while [[ $# -gt 0 ]]; do
case $1 in
--no-make)
MAKE_ARGS+=("$1")
shift
;;
--rc)
MAKE_ARGS+=("$1")
ISO_REF=rc
RELEASE_SUFFIX="-rc"
shift
;;
-*)
echo "Unknown option: $1"
echo "Usage: omarchy-iso-release [--no-make] [--rc] [version]"
exit 1
;;
*)
if [[ -n "${BUILD_VERSION-}" ]]; then
echo "Usage: omarchy-iso-release [--no-make] [--rc] [version]"
exit 1
fi
BUILD_VERSION="$1"
shift
;;
esac
done
if [[ -z "${BUILD_VERSION-}" ]]; then
echo "Usage: omarchy-iso-release [--no-make] [--rc] [version]"
exit 1
fi
BUILD_ROOT=$(realpath "${BASH_SOURCE[0]%/*}/..")
BUILD_RELEASE_PATH="$BUILD_ROOT/release"
# Make ISOs
if [[ ! " ${MAKE_ARGS[*]} " =~ " --no-make " ]]; then
echo -e "\e[32mMaking $ISO_REF ISO\e[0m"
omarchy-iso-make --no-cache --no-boot-offer "${MAKE_ARGS[@]}"
else
echo -e "\e[31mSkipping remaking ISOs\e[0m"
fi
# Sign and upload ISO
latest_iso=$(\ls -t "$BUILD_RELEASE_PATH"/*x86_64-"$ISO_REF".iso | head -n1)
release_iso="$BUILD_RELEASE_PATH/omarchy-$BUILD_VERSION$RELEASE_SUFFIX.iso"
cp "$latest_iso" "$release_iso"
echo -e "\e[32mSigning $ISO_REF ISO\e[0m"
omarchy-iso-sign "$release_iso"
iso_sha=$(sha256sum "$release_iso")
echo -e "\e[32mSHA256 for $ISO_REF ISO: $iso_sha\e[0m"
omarchy-iso-upload "$release_iso"