Permalink
Browse files

Travis: Add update information for AppImage snapshots

  • Loading branch information...
lluchs committed Oct 3, 2018
1 parent 55c34ec commit 04535b5438bd7907147fb1428a3436fd09c2d490
Showing with 23 additions and 8 deletions.
  1. +1 −1 .travis.yml
  2. +15 −2 tools/create_appimage.sh
  3. +7 −5 tools/upload_snapshot.sh
View
@@ -80,5 +80,5 @@ after_success:
echo "Creating AppImage..." &&
tools/create_appimage.sh &&
echo "Uploading snapshot..." &&
tools/upload_snapshot.sh OpenClonk-x86_64.AppImage ||
tools/upload_snapshot.sh OpenClonk-x86_64.AppImage OpenClonk-x86_64.AppImage.zsync ||
echo "Snapshot creation has failed"
View
@@ -7,6 +7,10 @@ error() {
[[ -f CMakeCache.txt ]] || error "this does not look like a build directory"
# Read current branch from the CMake-generated C4Version.h.
branch=$(cpp -dM C4Version.h | awk '$2 == "C4REVISION_BRANCH" { print gensub("^\"|\"$", "", "g", $3) }')
[[ -n $branch ]] || error "could not get branch name"
DESTDIR=appdir cmake --build . --target install || error "install failed"
linuxdeployqt=linuxdeployqt-continuous-x86_64.AppImage
@@ -18,5 +22,14 @@ fi
export ARCH=$(uname -m)
./$linuxdeployqt appdir/usr/share/applications/openclonk.desktop -appimage \
|| error "AppImage creation has failed"
# We need to run appimagetool manually to be able to specify an update URL.
coproc { exec stdbuf -oL ./$linuxdeployqt --appimage-mount; }
trap "kill -SIGINT $COPROC_PID" EXIT
read -r -u "${COPROC[0]}" mount_path
PATH="$mount_path/usr/bin:$PATH"
linuxdeployqt appdir/usr/share/applications/openclonk.desktop -bundle-non-qt-libs \
|| error "linuxdeployqt has failed"
appimagetool appdir --verbose -n -u "zsync|https://releases.openclonk.org/snapshots/latest-$branch/OpenClonk-x86_64.AppImage.zsync" \
|| error "appimagetool has failed"
View
@@ -17,11 +17,13 @@ branch=$(git symbolic-ref --short HEAD)
date=$(date --date="$(git show -s --format=%ci)" -u -Is | sed 's/+00:\?00$/Z/')
[[ -n $date ]] || error "could not get commit date"
file=${1:?no file to upload given}
: ${OC_REL_URL:?target URL not set}
(($# > 0)) || error "no files to upload given"
upload_path="/snapshots/$date-$branch-$revision/$(basename "$file")"
echo "uploading $upload_path"
for file in "$@"; do
upload_path="/snapshots/$date-$branch-$revision/$(basename "$file")"
echo "uploading $upload_path"
curl -XPOST "$OC_REL_URL$upload_path" --data-binary "@$file" \
|| error "file upload failed"
curl -XPOST "$OC_REL_URL$upload_path" --data-binary "@$file" \
|| error "file upload failed"
done

0 comments on commit 04535b5

Please sign in to comment.