diff --git a/.drone.yml b/.drone.yml index 60eadb59f..80772184a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -106,7 +106,7 @@ steps: from_secret: CI_UPLOAD_GIT_USERNAME commands: - BUILDNR=$DRONE_BUILD_NUMBER VERSION_SUFFIX=$DRONE_PULL_REQUEST BUILD_UPDATER=ON DESKTOP_CLIENT_ROOT=$DRONE_WORKSPACE /bin/bash -c "./admin/linux/build-appimage.sh" - - DESKTOP_CLIENT_ROOT=$DRONE_WORKSPACE /bin/bash -c "./admin/linux/upload-appimage.sh" || echo "Upload failed, however this is an optional step." + - BUILDNR=$DRONE_BUILD_NUMBER VERSION_SUFFIX=$DRONE_PULL_REQUEST DESKTOP_CLIENT_ROOT=$DRONE_WORKSPACE /bin/bash -c "./admin/linux/upload-appimage.sh" || echo "Upload failed, however this is an optional step." trigger: branch: - master diff --git a/admin/linux/upload-appimage.sh b/admin/linux/upload-appimage.sh index 3fb86aeab..87f2a6c6a 100755 --- a/admin/linux/upload-appimage.sh +++ b/admin/linux/upload-appimage.sh @@ -5,7 +5,14 @@ export BUILD=${DRONE_BUILD_NUMBER} export PR=${DRONE_PULL_REQUEST} export GIT_USERNAME=${CI_UPLOAD_GIT_USERNAME} export GIT_TOKEN=${CI_UPLOAD_GIT_TOKEN} + +# Needed to get it working on drone +export SUFFIX=${DRONE_PULL_REQUEST:=master} +if [ $SUFFIX != "master" ]; then + SUFFIX="PR-$SUFFIX" +fi export DESKTOP_CLIENT_ROOT=${DESKTOP_CLIENT_ROOT:-/home/user} +export APPNAME=${APPNAME:-nextcloud} # Defaults export GIT_REPO=ci-builds @@ -26,7 +33,13 @@ echo `pwd` ls # AppImage -export APPIMAGE=$(readlink -f ./Nextcloud*.AppImage) +if [ ! -z "$DRONE_COMMIT" ] +then + export APPIMAGE=$(readlink -f ./${APPNAME}-${SUFFIX}-${DRONE_COMMIT}-x86_64.AppImage) +else + export APPIMAGE=$(readlink -f ./Nextcloud*.AppImage) +fi + export UPDATE=$(readlink -f ./Nextcloud*.AppImage.zsync) export BASENAME=$(basename ${APPIMAGE})