Skip to content

Commit 044fda9

Browse files
Merge pull request #16720 from nextcloud/repo-sync/android-config/master
🔄 synced file(s) with nextcloud/android-config
2 parents c5b0d0f + 4bdc400 commit 044fda9

File tree

4 files changed

+48
-32
lines changed

4 files changed

+48
-32
lines changed

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
with:
4444
swap-size-gb: 10
4545
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@b1bff81932f5cdfc8695c7752dcee935dcd061c8 # v4.33.0
46+
uses: github/codeql-action/init@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
4747
with:
4848
languages: ${{ matrix.language }}
4949
- name: Set up JDK 21
@@ -57,4 +57,4 @@ jobs:
5757
echo "org.gradle.jvmargs=-Xmx3g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > "$HOME/.gradle/gradle.properties"
5858
./gradlew --no-daemon assembleDebug
5959
- name: Perform CodeQL Analysis
60-
uses: github/codeql-action/analyze@b1bff81932f5cdfc8695c7752dcee935dcd061c8 # v4.33.0
60+
uses: github/codeql-action/analyze@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1

.github/workflows/qa.yml

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -54,32 +54,4 @@ jobs:
5454
[ -e app/build.gradle.kts ] && sed -i "/qa/,/\}/ s/versionName .*/versionName = \"${{github.event.number}}\"/" "app/build.gradle.kts"
5555
./gradlew assembleQaDebug
5656
$(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
57-
58-
- name: Upload APK
59-
id: upload-apk
60-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
61-
with:
62-
path: app/build/outputs/apk/qa/debug/*qa-debug*.apk
63-
retention-days: 7
64-
archive: false
65-
66-
- name: Create QR Code
67-
run: |
68-
sudo apt-get -y install qrencode
69-
qrencode -o qr.png "${{ steps.upload-apk.outputs.artifact-url }}"
70-
71-
- name: Upload QR
72-
id: upload-qr
73-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
74-
with:
75-
path: qr.png
76-
retention-days: 7
77-
archive: false
78-
79-
- name: Comment PR
80-
uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b
81-
with:
82-
message: |
83-
APK file: ${{ steps.upload-apk.outputs.artifact-url }}
84-
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
85-
![qrcode](${{ steps.upload-qr.outputs.artifact-url }}) (please click on link to get QR code displayed)
57+
.github/workflows/uploadArtifact.sh "$LOG_USERNAME" "$LOG_PASSWORD" "${{github.event.number}}" "${{github.event.number}}" "$GITHUB_TOKEN"

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ jobs:
4242

4343
# Upload the results to GitHub's code scanning dashboard.
4444
- name: "Upload to code-scanning"
45-
uses: github/codeql-action/upload-sarif@b1bff81932f5cdfc8695c7752dcee935dcd061c8 # v4.33.0
45+
uses: github/codeql-action/upload-sarif@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
4646
with:
4747
sarif_file: results.sarif
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env bash
2+
3+
#
4+
# SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
5+
# SPDX-FileCopyrightText: 2019-2022 Tobias Kaminsky <[email protected]>
6+
# SPDX-License-Identifier: AGPL-3.0-or-later
7+
#
8+
9+
#1: LOG_USERNAME
10+
#2: LOG_PASSWORD
11+
#3: DRONE_BUILD_NUMBER
12+
#4: DRONE_PULL_REQUEST
13+
14+
15+
PUBLIC_URL=https://www.kaminsky.me/nc-dev/android-artifacts
16+
USER=$1
17+
PASS=$2
18+
BUILD=$3
19+
PR=$4
20+
GITHUB_TOKEN=$5
21+
DAV_URL=https://nextcloud.kaminsky.me/remote.php/dav/files/$USER/android-artifacts/
22+
23+
source .github/workflows/lib.sh
24+
REPO=$(cat scripts/repo)
25+
26+
if ! test -e app/build/outputs/apk/qa/debug/*qa-debug*.apk ; then
27+
exit 1
28+
fi
29+
echo "Uploaded artifact to $DAV_URL/$BUILD.apk"
30+
31+
# delete all old comments, starting with "APK file:"
32+
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"|")
33+
34+
echo $oldComments | while read comment ; do
35+
curl_gh -X DELETE https://api.github.com/repos/nextcloud/$REPO/issues/comments/$comment
36+
done
37+
38+
sudo apt-get -y install qrencode
39+
40+
qrencode -o $PR.png "$PUBLIC_URL/$BUILD.apk"
41+
42+
curl -u $USER:$PASS -X PUT $DAV_URL/$BUILD.apk --upload-file app/build/outputs/apk/qa/debug/*qa-debug*.apk
43+
curl -u $USER:$PASS -X PUT $DAV_URL/$BUILD.png --upload-file $PR.png
44+
curl_gh -X POST https://api.github.com/repos/nextcloud/$REPO/issues/$PR/comments -d "{ \"body\" : \"APK file: $PUBLIC_URL/$BUILD.apk <br/><br/> ![qrcode]($PUBLIC_URL/$BUILD.png) <br/><br/>To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app. \" }"

0 commit comments

Comments
 (0)