Skip to content

Commit 7b4296b

Browse files
Merge pull request #2789 from nextcloud/repo-sync/android-config/main
πŸ”„ synced file(s) with nextcloud/android-config
2 parents 9c1441a + ff92d1d commit 7b4296b

File tree

11 files changed

+151
-6
lines changed

11 files changed

+151
-6
lines changed
2.18 KB
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
2+
SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only

β€Ž.github/workflows/analysis.ymlβ€Ž

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@ jobs:
7070
run: |
7171
mkdir -p "$HOME/.gradle"
7272
{
73-
echo "org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g"
74-
echo "org.gradle.caching=true"
75-
echo "org.gradle.parallel=true"
73+
echo "org.gradle.jvmargs=-Xmx5g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g"
7674
echo "org.gradle.configureondemand=true"
7775
echo "kapt.incremental.apt=true"
7876
} > "$HOME/.gradle/gradle.properties"

β€Ž.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@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.9
46+
uses: github/codeql-action/init@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.10
4747
with:
4848
languages: ${{ matrix.language }}
4949
- name: Set up JDK 17
@@ -57,4 +57,4 @@ jobs:
5757
echo "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > "$HOME/.gradle/gradle.properties"
5858
./gradlew assembleDebug
5959
- name: Perform CodeQL Analysis
60-
uses: github/codeql-action/analyze@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.9
60+
uses: github/codeql-action/analyze@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.10

β€Ž.github/workflows/qa.ymlβ€Ž

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
2+
# SPDX-FileCopyrightText: 2023 Andy Scherzinger <info@andy-scherzinger.de>
3+
# SPDX-License-Identifier: MIT
4+
name: "QA"
5+
6+
on:
7+
pull_request:
8+
branches: [ main, master, stable-* ]
9+
10+
permissions:
11+
pull-requests: write
12+
contents: read
13+
14+
concurrency:
15+
group: qa-build-${{ github.head_ref || github.run_id }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
qa:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Check if secrets are available
23+
run: echo "ok=${{ secrets.KS_PASS != '' }}" >> "$GITHUB_OUTPUT"
24+
id: check-secrets
25+
26+
- name: Checkout
27+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
28+
if: ${{ steps.check-secrets.outputs.ok == 'true' }}
29+
with:
30+
persist-credentials: false
31+
32+
- name: set up JDK 17
33+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
34+
if: ${{ steps.check-secrets.outputs.ok == 'true' }}
35+
with:
36+
distribution: "temurin"
37+
java-version: 17
38+
39+
- name: Build QA
40+
if: ${{ steps.check-secrets.outputs.ok == 'true' }}
41+
env:
42+
KS_PASS: ${{ secrets.KS_PASS }}
43+
KEY_PASS: ${{ secrets.KEY_PASS }}
44+
LOG_USERNAME: ${{ secrets.LOG_USERNAME }}
45+
LOG_PASSWORD: ${{ secrets.LOG_PASSWORD }}
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
run: |
48+
mkdir -p $HOME/.gradle
49+
echo "org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g" > $HOME/.gradle/gradle.properties
50+
echo "org.gradle.caching=true" >> $HOME/.gradle/gradle.properties
51+
echo "org.gradle.parallel=true" >> $HOME/.gradle/gradle.properties
52+
echo "org.gradle.configureondemand=true" >> $HOME/.gradle/gradle.properties
53+
echo "kapt.incremental.apt=true" >> $HOME/.gradle/gradle.properties
54+
sed -i "/qa/,/\}/ s/versionCode .*/versionCode ${{github.event.number}} /" app/build.gradle
55+
sed -i "/qa/,/\}/ s/versionName .*/versionName \"${{github.event.number}}\"/" app/build.gradle
56+
./gradlew assembleQaDebug
57+
$(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
58+
.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@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.9
45+
uses: github/codeql-action/upload-sarif@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.10
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 <tobias@kaminsky.me>
6+
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
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 scripts/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. \" }"

β€Žapp/build.gradleβ€Ž

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ android {
6969
play {
7070
dimension "version"
7171
}
72+
qa {
73+
applicationIdSuffix ".qa"
74+
dimension "version"
75+
versionCode 11
76+
versionName "1"
77+
}
7278
}
7379

7480
testOptions {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="108dp"
3+
android:height="108dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24">
6+
<path
7+
android:pathData="M15.919,9.768C16.095,9.592 16.095,9.3 15.919,9.134L14.866,8.08C14.7,7.905 14.408,7.905 14.232,8.08L13.404,8.904L15.092,10.591M7.95,14.362L7.95,16.05L9.637,16.05L14.614,11.068L12.927,9.381L7.95,14.362Z"
8+
android:fillColor="@android:color/white" />
9+
<path
10+
android:pathData="m14.185,15.621q0,0.201 -0.065,0.373 -0.065,0.171 -0.187,0.297l0.367,0.359 -0.291,0.238 -0.399,-0.387q-0.082,0.029 -0.171,0.044 -0.088,0.017 -0.183,0.017 -0.41,0 -0.665,-0.267 -0.256,-0.267 -0.256,-0.675l0,-0.399q0,-0.407 0.254,-0.673 0.256,-0.268 0.665,-0.268 0.413,0 0.672,0.268 0.259,0.267 0.259,0.673zM13.74,15.219q0,-0.259 -0.129,-0.425 -0.129,-0.166 -0.356,-0.166 -0.227,0 -0.352,0.166 -0.125,0.164 -0.125,0.425l0,0.402q0,0.263 0.126,0.429 0.126,0.166 0.352,0.166 0.228,0 0.356,-0.166 0.128,-0.166 0.128,-0.429zM15.773,16.052L14.995,16.052L14.844,16.53L14.395,16.53L15.158,14.313l0.455,0l0.76,2.217l-0.449,0zM15.105,15.704l0.559,0L15.39,14.832l-0.009,0z"
11+
android:strokeWidth="2.07924"
12+
android:fillColor="#ffffff" />
13+
</vector>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?><!--
2+
~ Nextcloud Notes - Android Client
3+
~
4+
~ SPDX-FileCopyrightText: 2020-2024 Nextcloud GmbH and Nextcloud contributors
5+
~ SPDX-FileCopyrightText: 2020 Stefan Niedermann <info@niedermann.it>
6+
~ SPDX-License-Identifier: GPL-3.0-or-later
7+
-->
8+
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android"
9+
xmlns:tools="http://schemas.android.com/tools">
10+
<shortcut
11+
android:enabled="true"
12+
android:icon="@drawable/ic_add_blue_24dp"
13+
android:shortcutId="it.niedermann.owncloud.notes"
14+
android:shortcutLongLabel="@string/shortcut_create_long"
15+
android:shortcutShortLabel="@string/action_create"
16+
tools:targetApi="n_mr1">
17+
<intent
18+
android:action="android.intent.action.CREATE_DOCUMENT"
19+
android:targetClass="it.niedermann.owncloud.notes.edit.EditNoteActivity"
20+
android:targetPackage="it.niedermann.owncloud.notes.qa" />
21+
<categories android:name="android.shortcut.conversation" />
22+
</shortcut>
23+
</shortcuts>

0 commit comments

Comments
Β (0)