53 lines
1.4 KiB
Bash
Executable file
53 lines
1.4 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
set -eu
|
|
|
|
shutdown() {
|
|
# Get our process group id
|
|
# shellcheck disable=SC2009
|
|
PGID=$(ps -o pgid= $$ | grep -o "[0-9]*")
|
|
|
|
# Kill it in a new new process group
|
|
setsid kill -- -"$PGID"
|
|
exit 0
|
|
}
|
|
|
|
trap "shutdown" SIGINT SIGTERM
|
|
|
|
if [ -z "$1" ]; then
|
|
echo "Need version as argument"
|
|
exit -1
|
|
fi
|
|
|
|
peertube_directory=$(basename $(pwd))
|
|
|
|
version="v$1"
|
|
|
|
directory_name="peertube-$version"
|
|
zip_name="peertube-$version.zip"
|
|
|
|
npm run build -- --source-map
|
|
rm -f "./client/dist/en-US/stats.json"
|
|
rm -f "./client/dist/embed-stats.json"
|
|
|
|
# Creating the archives
|
|
(
|
|
# local variables
|
|
directories_to_archive=("$directory_name/CREDITS.md" "$directory_name/FAQ.md" \
|
|
"$directory_name/LICENSE" "$directory_name/README.md" \
|
|
"$directory_name/client/dist/" "$directory_name/client/yarn.lock" \
|
|
"$directory_name/client/package.json" "$directory_name/config" \
|
|
"$directory_name/dist" "$directory_name/package.json" \
|
|
"$directory_name/scripts" "$directory_name/support" \
|
|
"$directory_name/yarn.lock")
|
|
|
|
# temporary setup
|
|
cd ..
|
|
ln -s "$peertube_directory" "$directory_name"
|
|
|
|
# archive creation
|
|
zip -9 -r "$peertube_directory/$zip_name" "${directories_to_archive[@]}"
|
|
|
|
# temporary setup destruction
|
|
rm "$directory_name"
|
|
)
|