diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml index 770d09d9be25..2fa310dd5b3f 100644 --- a/.github/workflows/qa.yml +++ b/.github/workflows/qa.yml @@ -54,4 +54,23 @@ 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 + uses: roshangm1/qr-code-commenter-action@ef11477a76fa017e4f70b4dd7c56694c985099ce + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + content: "${{ steps.upload-apk.outputs.artifact-url }}" + comment: | + 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} + + diff --git a/.github/workflows/uploadArtifact.sh b/.github/workflows/uploadArtifact.sh index bf96572045ab..69f203bbf5c4 100755 --- a/.github/workflows/uploadArtifact.sh +++ b/.github/workflows/uploadArtifact.sh @@ -18,6 +18,7 @@ PASS=$2 BUILD=$3 PR=$4 GITHUB_TOKEN=$5 +URL=$6 DAV_URL=https://nextcloud.kaminsky.me/remote.php/dav/files/$USER/android-artifacts/ source .github/workflows/lib.sh @@ -26,7 +27,7 @@ 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" +echo "Uploaded artifact to $URL" # 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"|") @@ -37,8 +38,7 @@ done sudo apt-get -y install qrencode -qrencode -o $PR.png "$PUBLIC_URL/$BUILD.apk" +qrencode -o $PR.png "$URL" -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. \" }"