📦 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)
|
h)
|
||||||
echo "\
|
echo "\
|
||||||
colorshell's build script.
|
colorshell's build script.
|
||||||
|
use \`build:release\` for release builds.
|
||||||
|
|
||||||
Options:
|
options:
|
||||||
-r \$file: specify gresource's target path (default: \`\$output/resources.gresource\`)
|
-r \$file: specify gresource's target path (default: \`\$output/resources.gresource\`)
|
||||||
-o \$path: specify the build's output directory (default: \`./build\`)
|
-o \$path: specify the build's output directory (default: \`./build\`)
|
||||||
-b: only target gresource in the build, keeping the file in the output dir
|
-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 \
|
ags bundle src/app.ts $output/colorshell \
|
||||||
-r ./src \
|
-r ./src \
|
||||||
-d "DEVEL=`[[ $is_devel ]] && echo -n true || echo -n false`" \
|
-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}'"
|
-d "GRESOURCES_FILE='${gresources_file:-$output/resources.gresource}'"
|
||||||
|
|
||||||
echo "[info] cleaning"
|
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}"
|
||||||
Vendored
+1
@@ -1,6 +1,7 @@
|
|||||||
declare const SRC: string
|
declare const SRC: string
|
||||||
declare const DEVEL: boolean;
|
declare const DEVEL: boolean;
|
||||||
declare const GRESOURCES_FILE: string;
|
declare const GRESOURCES_FILE: string;
|
||||||
|
declare const VERSION: string;
|
||||||
|
|
||||||
declare module "inline:*" {
|
declare module "inline:*" {
|
||||||
const content: string
|
const content: string
|
||||||
|
|||||||
Reference in New Issue
Block a user