From b3853da16ac03ef7538ae12a9b48ea41340af7de Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Mon, 16 Mar 2026 10:05:09 +0100 Subject: [PATCH] QA APK on GitHub Signed-off-by: tobiasKaminsky --- .github/workflows/qa.yml | 30 +++++++++++++++++++- .github/workflows/uploadArtifact.sh | 44 ----------------------------- 2 files changed, 29 insertions(+), 45 deletions(-) delete mode 100755 .github/workflows/uploadArtifact.sh diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml index 770d09d9be25..6cfc3e14d0a6 100644 --- a/.github/workflows/qa.yml +++ b/.github/workflows/qa.yml @@ -54,4 +54,32 @@ jobs: [ -e app/build.gradle.kts ] && sed -i "/qa/,/\}/ s/versionName .*/versionName = \"${{github.event.number}}\"/" "app/build.gradle.kts" ./gradlew assembleQaDebug $(find /usr/local/lib/android/sdk/build-tools/*/apksigner | sort | tail -n1) sign --ks-pass pass:"$KS_PASS" --key-pass pass:"$KEY_PASS" --ks-key-alias key0 --ks ".github/workflows/QA_keystore.jks" app/build/outputs/apk/qa/debug/*qa-debug*.apk - .github/workflows/uploadArtifact.sh "$LOG_USERNAME" "$LOG_PASSWORD" "${{github.event.number}}" "${{github.event.number}}" "$GITHUB_TOKEN" + + - name: Upload APK + id: upload-apk + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f + with: + path: app/build/outputs/apk/qa/debug/*qa-debug*.apk + retention-days: 7 + archive: false + + - name: Create QR Code + run: | + sudo apt-get -y install qrencode + qrencode -o qr.png "${{ steps.upload-apk.outputs.artifact-url }}" + + - name: Upload QR + id: upload-qr + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f + with: + path: qr.png + retention-days: 7 + archive: false + + - name: Comment PR + uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b + with: + message: | + APK file: ${{ steps.upload-apk.outputs.artifact-url }} + To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app. + ![qrcode](${{ steps.upload-qr.outputs.artifact-url }}) (please click on link to get QR code displayed) diff --git a/.github/workflows/uploadArtifact.sh b/.github/workflows/uploadArtifact.sh deleted file mode 100755 index bf96572045ab..000000000000 --- a/.github/workflows/uploadArtifact.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash - -# -# SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors -# SPDX-FileCopyrightText: 2019-2022 Tobias Kaminsky -# SPDX-License-Identifier: AGPL-3.0-or-later -# - -#1: LOG_USERNAME -#2: LOG_PASSWORD -#3: DRONE_BUILD_NUMBER -#4: DRONE_PULL_REQUEST - - -PUBLIC_URL=https://www.kaminsky.me/nc-dev/android-artifacts -USER=$1 -PASS=$2 -BUILD=$3 -PR=$4 -GITHUB_TOKEN=$5 -DAV_URL=https://nextcloud.kaminsky.me/remote.php/dav/files/$USER/android-artifacts/ - -source .github/workflows/lib.sh -REPO=$(cat scripts/repo) - -if ! test -e app/build/outputs/apk/qa/debug/*qa-debug*.apk ; then - exit 1 -fi -echo "Uploaded artifact to $DAV_URL/$BUILD.apk" - -# delete all old comments, starting with "APK file:" -oldComments=$(curl_gh -X GET https://api.github.com/repos/nextcloud/$REPO/issues/$PR/comments | jq '.[] | (.id |tostring) + "|" + (.user.login | test("github-actions") | tostring) + "|" + (.body | test("APK file:.*") | tostring)' | grep "true|true" | tr -d "\"" | cut -f1 -d"|") - -echo $oldComments | while read comment ; do - curl_gh -X DELETE https://api.github.com/repos/nextcloud/$REPO/issues/comments/$comment -done - -sudo apt-get -y install qrencode - -qrencode -o $PR.png "$PUBLIC_URL/$BUILD.apk" - -curl -u $USER:$PASS -X PUT $DAV_URL/$BUILD.apk --upload-file app/build/outputs/apk/qa/debug/*qa-debug*.apk -curl -u $USER:$PASS -X PUT $DAV_URL/$BUILD.png --upload-file $PR.png -curl_gh -X POST https://api.github.com/repos/nextcloud/$REPO/issues/$PR/comments -d "{ \"body\" : \"APK file: $PUBLIC_URL/$BUILD.apk

![qrcode]($PUBLIC_URL/$BUILD.png)

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app. \" }"