gbe_fork/package_linux.sh
ota 90b403fb3d + add package scripts
+ add steps: package + release to add packaged build to release when pushing on tag

+ support building on prefixed branch name with wildcard

+ support event trigger on tag

+ support event trigger on workflow dispatch for manual trigger
2023-12-18 02:50:05 +02:00

31 lines
670 B
Bash

#!/usr/bin/env bash
if [ "$(id -u)" -ne 0 ]; then
echo "Please run as root" >&2
exit 1
fi
build_base_dir="build-linux"
out_dir="build-linux/package"
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
[[ "$1" = '' ]] && {
echo "[X] missing build folder";
exit 1;
}
[[ -d "$script_dir/$build_base_dir/$1" ]] || {
echo "[X] build folder wasn't found";
exit 1;
}
apt update || exit 1
apt install tar -y || exit 1
mkdir -p "$script_dir/$out_dir/$1"
archive_file="$script_dir/$out_dir/$1/emu-linux-$1.tar.gz"
[[ -f "$archive_file" ]] && rm -f "$archive_file"
tar -C "$script_dir/$build_base_dir" -c -j -vf "$archive_file" "$1"