Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Travis: Build and upload AppImage snapshot
- Loading branch information
Showing
3 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
error() { | ||
echo error: "$@" | ||
exit 1 | ||
} | ||
|
||
[[ -f CMakeCache.txt ]] || error "this does not look like a build directory" | ||
|
||
DESTDIR=appdir cmake --build . --target install || error "install failed" | ||
|
||
linuxdeployqt=linuxdeployqt-continuous-x86_64.AppImage | ||
if [[ ! -x $linuxdeployqt ]]; then | ||
wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/$linuxdeployqt" \ | ||
|| error "could not download linuxdeployqt" | ||
chmod a+x $linuxdeployqt | ||
fi | ||
|
||
export ARCH=$(uname -m) | ||
|
||
./$linuxdeployqt appdir/usr/share/applications/openclonk.desktop -appimage \ | ||
|| error "AppImage creation has failed" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
error() { | ||
echo error: "$@" | ||
exit 1 | ||
} | ||
|
||
revision=$(git rev-parse --short=9 HEAD) | ||
[[ -n $revision ]] || error "could not get git revision" | ||
|
||
branch=$(git symbolic-ref --short HEAD) | ||
# Travis checks out a concrete revision, so we have to get the branch name from | ||
# the environment instead. | ||
: ${branch:=$TRAVIS_BRANCH} | ||
[[ -n $branch ]] || error "could not get branch name" | ||
|
||
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} | ||
|
||
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" |