📦 build: implement automated release-build script
This commit is contained in:
+3
-1
@@ -20,8 +20,9 @@ while getopts r:o:bdh args; do
|
||||
h)
|
||||
echo "\
|
||||
colorshell's build script.
|
||||
use \`build:release\` for release builds.
|
||||
|
||||
Options:
|
||||
options:
|
||||
-r \$file: specify gresource's target path (default: \`\$output/resources.gresource\`)
|
||||
-o \$path: specify the build's output directory (default: \`./build\`)
|
||||
-b: only target gresource in the build, keeping the file in the output dir
|
||||
@@ -55,6 +56,7 @@ echo "[info] bundling project"
|
||||
ags bundle src/app.ts $output/colorshell \
|
||||
-r ./src \
|
||||
-d "DEVEL=`[[ $is_devel ]] && echo -n true || echo -n false`" \
|
||||
-d "COLORSHELL_VERSION='`cat package.json | jq -r .version`'" \
|
||||
-d "GRESOURCES_FILE='${gresources_file:-$output/resources.gresource}'"
|
||||
|
||||
echo "[info] cleaning"
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
set -e
|
||||
|
||||
outdir="./build/release"
|
||||
gresource_file='$XDG_LOCAL_HOME/colorshell/resources.gresource' # send literal variable name, so it's interpreted in the shell rather than in the build
|
||||
|
||||
while getopts o:r:h args; do
|
||||
case "$args" in
|
||||
o)
|
||||
outdir=${OPTARG}
|
||||
;;
|
||||
r)
|
||||
gresource_file=${OPTARG}
|
||||
;;
|
||||
h)
|
||||
echo "\
|
||||
colorshell's automated release-build script.
|
||||
|
||||
options:
|
||||
-r \$file: gresource's target path (shell-only, file is kept in \$output. default: \$XDG_LOCAL_HOME/colorshell/resources.gresource)
|
||||
-o \$path: build output path (default: \`./build/release\`)
|
||||
-h: show this help message"
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
pnpm build -o "${outdir:-./build/release}" -b -r "${gresource_file:-\$XDG_LOCAL_HOME/colorshell/resources.gresource}"
|
||||
Reference in New Issue
Block a user