updates/fluffychat: move from manual build to static release

This commit is contained in:
Milan 2025-02-24 09:58:44 +01:00
parent 530f3355dc
commit d67e10b988

View File

@ -1,25 +1,37 @@
#!/bin/bash #!/bin/bash
set -e set -e
# ! wip !
# if failing: $HOME/tools/flutter/bin/flutter upgrade
basedir=$HOME/fluffychat basedir=$HOME
flutter=$HOME/tools/flutter/bin/flutter deploydir="$basedir/fluffychat"
homeserver="hostsharing.net"
tmpdir=/tmp/$USER
release=`curl -L https://api.github.com/repos/krille-chan/fluffychat/releases/latest -s | jq -r '.tag_name'` release=`curl -L https://api.github.com/repos/krille-chan/fluffychat/releases/latest -s | jq -r '.tag_name'`
current=v`cat $basedir/build/web/version.json|jq .version|tr -d '"'` current=v`cat $deploydir/build/web/version.json|jq .version|tr -d '"'`
echo ">>> latest Fluffychat appears to be $release, we are on $current." echo ">>> latest Fluffychat appears to be $release, we are on $current."
if [[ ! $release == $current ]] if [[ ! $release == $current ]]
then then
echo ">>> checking out Fluffychat $release" mkdir -p $tmpdir
cd $HOME/fluffychat cd $tmpdir
git fetch
git checkout $release echo ">>> downloading and extracting Fluffychat $release"
$flutter build web --release wget -q --show-progress https://github.com/krille-chan/fluffychat/releases/download/$release/fluffychat-web.tar.gz
tar -zxf fluffychat-web.tar.gz
echo
echo ">>> syncing $tmpdir/build/ to $deploydir/"
rsync -aAX --delete --exclude="config.json" $tmpdir/build/ $deploydir/build/
echo ">>> clearing tmpdir of any .gz and build/"
rm -r $tmpdir/{build,*.gz}
echo ">>> done." echo ">>> done."
echo ">>> Fluffychat is now at $release." echo ">>> Fluffychat is now at $release."
echo ">>> Checking version.js"
echo
cat $deploydir/build/web/version.json|jq
echo
else else
echo ">>> nothing to do:" echo ">>> nothing to do:"
cat $basedir/build/web/version.json|jq cat $deploydir/build/web/version.json|jq
fi fi