Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix script that upload AppImage to go in correct path #4900

Merged
merged 3 commits into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
- /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
Expand Down
21 changes: 19 additions & 2 deletions admin/linux/upload-appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ 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
export API_BASE_URL=https://api.github.com/repos/$GIT_USERNAME/$GIT_REPO
Expand All @@ -20,10 +28,18 @@ if [ $TAG_NAME != "master" ]; then
RELEASE_BODY="nextcloud/desktop#$PR"
fi

cd /build
cd ${DESKTOP_CLIENT_ROOT}
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})

Expand Down Expand Up @@ -89,6 +105,7 @@ uploadUrl=$(echo $json | jq -r '.upload_url')
if [[ "$uploadUrl" == "null" ]]; then
# Try to create a release
json=$(create_release)
echo $json

releaseId=$(echo $json | jq -r '.id')
uploadUrl=$(echo $json | jq -r '.upload_url')
Expand Down