From 90af57fc0d141c2977a4767fb3b6da2c1c360824 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Mon, 26 Apr 2021 16:33:54 +0200 Subject: [PATCH] use correct path to apk Signed-off-by: Andy Scherzinger --- .github/workflows/qa.yml | 9 +-------- scripts/uploadArtifact.sh | 10 +++++----- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml index 3a82d39b0..a29519ce0 100644 --- a/.github/workflows/qa.yml +++ b/.github/workflows/qa.yml @@ -25,12 +25,5 @@ jobs: sed -i "/qa/,/\}/ s/versionCode .*/versionCode ${{github.event.number}} /" build.gradle sed -i "/qa/,/\}/ s/versionName .*/versionName \"${{github.event.number}}\"/" build.gradle ./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 scripts/QA_keystore.jks build/outputs/apk/qa/debug/qa-debug-*.apk + $(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 scripts/QA_keystore.jks app/build/outputs/apk/qa/debug/app-qa-*.apk sudo scripts/uploadArtifact.sh $LOG_USERNAME $LOG_PASSWORD ${{github.event.number}} ${{github.event.number}} ${{ secrets.GITHUB_TOKEN }} - - name: Archive apk - uses: actions/upload-artifact@v2 - if: ${{ always() }} - with: - name: Nextcloud-APK - path: app/build/outputs/apk/**/**/qa*.apk - retention-days: 5 \ No newline at end of file diff --git a/scripts/uploadArtifact.sh b/scripts/uploadArtifact.sh index e14f48ad1..1e484f8c3 100644 --- a/scripts/uploadArtifact.sh +++ b/scripts/uploadArtifact.sh @@ -14,22 +14,22 @@ BUILD=$3 PR=$4 GITHUB_TOKEN=$5 -if ! test -e build/outputs/apk/qa/debug/qa-debug-*.apk ; then +if ! test -e app/build/outputs/apk/qa/debug/app-qa-*.apk ; then exit 1 fi echo "Uploaded artifact to $DAV_URL/$BUILD.apk" # delete all old comments, starting with "APK file:" -oldComments=$(curl 2>/dev/null --header "authorization: Bearer $GITHUB_TOKEN" -X GET https://api.github.com/repos/nextcloud/android/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"|") +oldComments=$(curl 2>/dev/null --header "authorization: Bearer $GITHUB_TOKEN" -X GET https://api.github.com/repos/nextcloud/talk-android/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 2>/dev/null --header "authorization: Bearer $GITHUB_TOKEN" -X DELETE https://api.github.com/repos/nextcloud/android/issues/comments/$comment + curl 2>/dev/null --header "authorization: Bearer $GITHUB_TOKEN" -X DELETE https://api.github.com/repos/nextcloud/talk-android/issues/comments/$comment done 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 build/outputs/apk/qa/debug/qa-debug-*.apk +curl -u $USER:$PASS -X PUT $DAV_URL/$BUILD.apk --upload-file app/build/outputs/apk/qa/debug/app-qa-*.apk curl -u $USER:$PASS -X PUT $DAV_URL/$BUILD.png --upload-file $PR.png -curl --header "authorization: Bearer $GITHUB_TOKEN" -X POST https://api.github.com/repos/nextcloud/android/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. \" }" +curl --header "authorization: Bearer $GITHUB_TOKEN" -X POST https://api.github.com/repos/nextcloud/talk-android/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 Talk app. \" }"