You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
662 B
24 lines
662 B
#!/bin/bash
|
|
|
|
set -eu
|
|
RELEASES=$(curl https://api.github.com/repos/M66B/FairEmail/releases)
|
|
|
|
# FIXME Test whether asset name matches "full-github"
|
|
LATEST_GITHUB_RELEASE=$(echo $RELEASES | jq '[.[] | select(.assets | length > 0)] | first')
|
|
if [ "$LATEST_GITHUB_RELEASE" == null ]; then
|
|
echo "No github release eavailable"
|
|
exit 1
|
|
fi
|
|
|
|
APK_FILENAME=$(echo $LATEST_GITHUB_RELEASE | jq -r ' .assets[0].name')
|
|
TAG_NAME=$(echo $LATEST_GITHUB_RELEASE | jq -r ' .tag_name')
|
|
|
|
set +e
|
|
rsync sillywalk.de:/srv/www/sillywalk.de/root/releases/$APK_FILENAME
|
|
if [ $? -eq 0 ]; then
|
|
echo "$TAG_NAME already released. Aborting."
|
|
exit 1
|
|
fi
|
|
set -e
|
|
|
|
./build.sh $TAG_NAME
|
|
|