From 633f0c4b91c3420c7107d6ca5bd2cd6932f19887 Mon Sep 17 00:00:00 2001 From: nextcloud-android-bot Date: Tue, 1 Dec 2026 18:38:23 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=94=84=20created=20local=20'.github/w?= =?UTF-8?q?orkflows/'=20from=20remote=20'config/workflows/'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nextcloud-android-bot --- .github/workflows/QA_keystore.jks | Bin 0 -> 2236 bytes .github/workflows/QA_keystore.jks.license | 2 + .github/workflows/analysis.yml | 78 ++++++++++++ .github/workflows/autoApproveSync.yml | 40 +++++++ .github/workflows/codeql.yml | 68 +++++++++++ .github/workflows/detectNewJavaFiles.yml | 43 +++++++ .github/workflows/lib.sh | 27 +++++ .github/workflows/lib.sh.license | 2 + .github/workflows/pr-feedback.yml | 55 +++++++++ .github/workflows/qa.yml | 120 +++++++++++++++++++ .github/workflows/renovate-approve-merge.yml | 61 ++++++++++ .github/workflows/scorecard.yml | 47 ++++++++ .github/workflows/stale.yml | 35 ++++++ 13 files changed, 578 insertions(+) create mode 100644 .github/workflows/QA_keystore.jks create mode 100644 .github/workflows/QA_keystore.jks.license create mode 100644 .github/workflows/analysis.yml create mode 100644 .github/workflows/autoApproveSync.yml create mode 100644 .github/workflows/codeql.yml create mode 100644 .github/workflows/detectNewJavaFiles.yml create mode 100644 .github/workflows/lib.sh create mode 100644 .github/workflows/lib.sh.license create mode 100644 .github/workflows/pr-feedback.yml create mode 100644 .github/workflows/qa.yml create mode 100644 .github/workflows/renovate-approve-merge.yml create mode 100644 .github/workflows/scorecard.yml create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/QA_keystore.jks b/.github/workflows/QA_keystore.jks new file mode 100644 index 0000000000000000000000000000000000000000..2b8fb9bc231219ab7954a6e0a5fea47b5f4c61f8 GIT binary patch literal 2236 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 UT$x~>$nZXtB6{SH*t-|@7tCJSiU0rr literal 0 HcmV?d00001 diff --git a/.github/workflows/QA_keystore.jks.license b/.github/workflows/QA_keystore.jks.license new file mode 100644 index 0000000..f070b8a --- /dev/null +++ b/.github/workflows/QA_keystore.jks.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors +SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml new file mode 100644 index 0000000..ee40370 --- /dev/null +++ b/.github/workflows/analysis.yml @@ -0,0 +1,78 @@ +# synced from @nextcloud/android-config + +# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-FileCopyrightText: 2025 Alper Ozturk +# SPDX-FileCopyrightText: 2023 Tobias Kaminsky +# SPDX-FileCopyrightText: 2023 Andy Scherzinger +# SPDX-FileCopyrightText: 2023 Josh Richards +# SPDX-FileCopyrightText: 2025 Marcel Hibbe +# SPDX-License-Identifier: GPL-3.0-or-later + +name: "Analysis" + +on: + pull_request: + branches: [ "master", "main", "stable-*" ] + push: + branches: [ "master", "main", "stable-*" ] + +permissions: + pull-requests: write + contents: write + +concurrency: + group: analysis-wrapper-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + analysis: + runs-on: ubuntu-latest-max + steps: + - name: Disabled on forks + if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }} + run: | + echo 'Can not analyze PRs from forks' + exit 1 + - name: Setup variables # zizmor: ignore[template-injection] + id: get-vars + run: | + if [ -z "$GITHUB_HEAD_REF" ]; then + # push + { + echo "branch=$GITHUB_REF_NAME" + echo "pr=$GITHUB_RUN_ID" + echo "repo=${{ github.repository }}" + } >> "$GITHUB_OUTPUT" + else + # pull request + { + echo "branch=$GITHUB_HEAD_REF" + echo "pr=${{ github.event.pull_request.number }}" + echo "repo=${{ github.event.pull_request.head.repo.full_name }}" + } >> "$GITHUB_OUTPUT" + fi + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + repository: ${{ steps.get-vars.outputs.repo }} + ref: ${{ steps.get-vars.outputs.branch }} + - name: Set up JDK 21 + uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 # v6.3.0 + with: + distribution: "temurin" + java-version: 25 + - name: Setup Gradle + uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1 + - name: Install dependencies + run: | + sudo apt install python3-defusedxml + - name: Run analysis wrapper + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + mkdir -p "$HOME/.gradle" + { + echo "org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8" + echo "org.gradle.configureondemand=true" + } > "$HOME/.gradle/gradle.properties" + scripts/analysis/analysis-wrapper.sh "${{ steps.get-vars.outputs.branch }}" "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" "$GITHUB_RUN_NUMBER" "${{ steps.get-vars.outputs.pr }}" diff --git a/.github/workflows/autoApproveSync.yml b/.github/workflows/autoApproveSync.yml new file mode 100644 index 0000000..123b682 --- /dev/null +++ b/.github/workflows/autoApproveSync.yml @@ -0,0 +1,40 @@ +# synced from @nextcloud/android-config + +# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-FileCopyrightText: 2023 Álvaro Brey +# SPDX-License-Identifier: GPL-3.0-or-later + +name: Auto approve sync +on: + pull_request_target: # zizmor: ignore[dangerous-triggers] + branches: + - master + - main + types: + - opened + - reopened + - synchronize + - labeled + +concurrency: + group: sync-approve-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + pull-requests: write + +jobs: + auto-approve: + name: Auto approve sync + runs-on: ubuntu-latest-low + if: ${{ contains(github.event.pull_request.labels.*.name, 'sync') && github.actor == 'nextcloud-android-bot' }} + steps: + - name: Disabled on forks + if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} + run: | + echo 'Can not approve PRs from forks' + exit 1 + + - uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..4257de4 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,68 @@ +# synced from @nextcloud/android-config + +# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-FileCopyrightText: 2026 Alper Ozturk +# SPDX-FileCopyrightText: 2023-2024 Andy Scherzinger +# SPDX-FileCopyrightText: 2022 Tobias Kaminsky +# SPDX-FileCopyrightText: 2022 Álvaro Brey +# SPDX-FileCopyrightText: 2025 Marcel Hibbe +# SPDX-License-Identifier: GPL-3.0-or-later + +name: "CodeQL" + +on: + push: + branches: [ "master", "main", "stable-*" ] + pull_request: + branches: [ "master", "main" ] + schedule: + - cron: '24 18 * * 3' + +permissions: + contents: read + +concurrency: + group: codeql-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest-max + timeout-minutes: 90 + permissions: + actions: read + contents: read + security-events: write + strategy: + fail-fast: false + matrix: + language: [ 'java' ] + steps: + - name: Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Set Swap Space + if: runner.environment == 'github-hosted' + uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c # v1.0 + with: + swap-size-gb: 10 + - name: Initialize CodeQL + uses: github/codeql-action/init@915412ff23e8b7659517e607487dbeae018f2934 # v4.39.5 + with: + languages: ${{ matrix.language }} + - name: Set up JDK 21 + uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 # v6.3.0 + with: + distribution: "temurin" + java-version: 25 + - name: Setup Gradle + uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1 + - name: Assemble + run: | + mkdir -p "$HOME/.gradle" + echo "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > "$HOME/.gradle/gradle.properties" + ./gradlew --no-daemon assembleDebug + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@915412ff23e8b7659517e607487dbeae018f2934 # v4.39.5 diff --git a/.github/workflows/detectNewJavaFiles.yml b/.github/workflows/detectNewJavaFiles.yml new file mode 100644 index 0000000..8bcb972 --- /dev/null +++ b/.github/workflows/detectNewJavaFiles.yml @@ -0,0 +1,43 @@ +# synced from @nextcloud/android-config + +# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-FileCopyrightText: 2023 Andy Scherzinger +# SPDX-FileCopyrightText: 2022 Tobias Kaminsky +# SPDX-FileCopyrightText: 2022 Álvaro Brey +# SPDX-License-Identifier: GPL-3.0-or-later + +name: "Detect new java files" + +on: + pull_request: + branches: [ master, main, stable-* ] + +permissions: read-all + +concurrency: + group: detect-new-java-files-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + detectNewJavaFiles: + runs-on: ubuntu-latest-low + steps: + - id: file_changes + uses: trilom/file-changes-action@a6ca26c14274c33b15e6499323aac178af06ad4b # v1.2.4 + with: + output: ',' + - name: Detect new java files + run: | + if [ -z '${{ steps.file_changes.outputs.files_added }}' ]; then + echo "No new files added" + exit 0 + fi + new_java=$(echo '${{ steps.file_changes.outputs.files_added }}' | tr ',' '\n' | grep '\.java$' | cat) + if [ -n "$new_java" ]; then + # shellcheck disable=SC2016 + printf 'New java files detected:\n```\n%s\n```\n' "$new_java" | tee "$GITHUB_STEP_SUMMARY" + exit 1 + else + echo "No new java files detected" + exit 0 + fi diff --git a/.github/workflows/lib.sh b/.github/workflows/lib.sh new file mode 100644 index 0000000..3bb8b10 --- /dev/null +++ b/.github/workflows/lib.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# +# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-FileCopyrightText: 2022 Álvaro Brey +# SPDX-License-Identifier: AGPL-3.0-or-later +# + +## This file is intended to be sourced by other scripts + + +function err() { + echo >&2 "$@" +} + + +function curl_gh() { + if [[ -n "$GITHUB_TOKEN" ]] + then + curl \ + --silent \ + --header "Authorization: token $GITHUB_TOKEN" \ + "$@" + else + err "WARNING: No GITHUB_TOKEN found. Skipping API call" + fi + +} diff --git a/.github/workflows/lib.sh.license b/.github/workflows/lib.sh.license new file mode 100644 index 0000000..23bad5c --- /dev/null +++ b/.github/workflows/lib.sh.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2019-2025 Nextcloud GmbH and Nextcloud contributors +SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/.github/workflows/pr-feedback.yml b/.github/workflows/pr-feedback.yml new file mode 100644 index 0000000..a0bd43a --- /dev/null +++ b/.github/workflows/pr-feedback.yml @@ -0,0 +1,55 @@ +# This workflow is provided via the organization template repository +# +# https://github.com/nextcloud/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization + +# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-FileCopyrightText: 2023 Marcel Klehr +# SPDX-FileCopyrightText: 2023 Joas Schilling <213943+nickvergessen@users.noreply.github.com> +# SPDX-FileCopyrightText: 2023 Daniel Kesselberg +# SPDX-FileCopyrightText: 2023 Florian Steffens +# SPDX-License-Identifier: MIT + +name: 'Ask for feedback on PRs' +on: + schedule: + - cron: '30 1 * * *' + +permissions: + contents: read + pull-requests: write + +jobs: + pr-feedback: + if: ${{ github.repository_owner == 'nextcloud' }} + runs-on: ubuntu-latest-low + steps: + - name: The get-github-handles-from-website action + uses: marcelklehr/get-github-handles-from-website-action@06b2239db0a48fe1484ba0bfd966a3ab81a08308 # v1.0.1 + id: scrape + with: + website: 'https://nextcloud.com/team/' + + - name: Get blocklist + id: blocklist + run: | + blocklist=$(curl https://raw.githubusercontent.com/nextcloud/.github/master/non-community-usernames.txt | paste -s -d, -) + echo "blocklist=$blocklist" >> "$GITHUB_OUTPUT" + + - uses: nextcloud/pr-feedback-action@4738cf661995d96df3512409ec17c900a4081d33 # main + with: + feedback-message: | + Hello there, + Thank you so much for taking the time and effort to create a pull request to our Nextcloud project. + + We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. + + Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 + + Thank you for contributing to Nextcloud and we hope to hear from you soon! + + (If you believe you should not receive this message, you can add yourself to the [blocklist](https://github.com/nextcloud/.github/blob/master/non-community-usernames.txt).) + days-before-feedback: 14 + start-date: '2024-04-30' + exempt-authors: '${{ steps.blocklist.outputs.blocklist }},${{ steps.scrape.outputs.users }}' + exempt-bots: true diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml new file mode 100644 index 0000000..0be1898 --- /dev/null +++ b/.github/workflows/qa.yml @@ -0,0 +1,120 @@ +# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-FileCopyrightText: 2026 Alper Ozturk +# SPDX-FileCopyrightText: 2023 Andy Scherzinger +# SPDX-License-Identifier: MIT +name: "QA" + +on: + pull_request: + branches: [ main, master, stable-* ] + +permissions: + pull-requests: write + contents: read + +concurrency: + group: qa-build-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + qa: + runs-on: ubuntu-latest-max + steps: + - name: Check if secrets are available + run: echo "ok=${{ secrets.KS_PASS != '' }}" >> "$GITHUB_OUTPUT" + id: check-secrets + + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + if: ${{ steps.check-secrets.outputs.ok == 'true' }} + with: + persist-credentials: false + + - name: set up JDK 21 + uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 # v6.3.0 + if: ${{ steps.check-secrets.outputs.ok == 'true' }} + with: + distribution: "temurin" + java-version: 25 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1 + if: ${{ steps.check-secrets.outputs.ok == 'true' }} + + - name: Build QA + id: build-qa + if: ${{ steps.check-secrets.outputs.ok == 'true' }} + env: + KS_PASS: ${{ secrets.KS_PASS }} + KEY_PASS: ${{ secrets.KEY_PASS }} + LOG_USERNAME: ${{ secrets.LOG_USERNAME }} + LOG_PASSWORD: ${{ secrets.LOG_PASSWORD }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + mkdir -p "$HOME/.gradle" + { + echo "org.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g" + echo "org.gradle.caching=true" + echo "org.gradle.parallel=true" + echo "org.gradle.configureondemand=true" + } > "$HOME/.gradle/gradle.properties" + [ -e app/build.gradle ] && sed -i "/qa/,/\}/ s/versionCode .*/versionCode ${{github.event.number}} /" "app/build.gradle" + [ -e app/build.gradle ] && sed -i "/qa/,/\}/ s/versionName .*/versionName \"${{github.event.number}}\"/" "app/build.gradle" + [ -e app/build.gradle.kts ] && sed -i "/qa/,/\}/ s/versionCode .*/versionCode = ${{github.event.number}} /" "app/build.gradle.kts" + [ -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 + apk=$(find app/build/outputs/apk/qa/debug -name '*qa-debug*.apk' | head -n1) + { + echo "apk-path=$apk" + echo "apk-name=$(basename "$apk")" + echo "apk-size=$(du -h "$apk" | cut -f1)" + } >> "$GITHUB_OUTPUT" + + - 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 + if: ${{ steps.check-secrets.outputs.ok == 'true' }} + env: + ARTIFACT_URL: ${{ steps.upload-apk.outputs.artifact-url }} + run: | + sudo apt-get -y install qrencode + qrencode -s 8 -o qr.png "$ARTIFACT_URL" + + - name: Upload QR + id: upload-qr + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f + with: + path: qr.png + if-no-files-found: error + retention-days: 7 + archive: false + + - name: Comment PR + if: ${{ steps.check-secrets.outputs.ok == 'true' }} + uses: thollander/actions-comment-pull-request@e4a76dd2b0a3c2027c3fd84147a67c22ee4c90fa + with: + comment-tag: qa-apk + mode: upsert + message: | + ### :iphone: QA build + + | | | + |---|---| + | **Download** | [${{ steps.build-qa.outputs.apk-name }}](${{ steps.upload-apk.outputs.artifact-url }}) | + | **QR code** | [Open the QR code for this download](${{ steps.upload-qr.outputs.artifact-url }}) | + | **Commit** | ${{ github.event.pull_request.head.sha }} | + | **Version** | `${{ github.event.number }}` | + | **Available until** | 7 days after this build | + + The QA build installs alongside a released Nextcloud app, so you can keep + using your existing install while testing. + + Downloading the file requires a GitHub account, so open this link on the + device you want to test on, or transfer the APK to it. \ No newline at end of file diff --git a/.github/workflows/renovate-approve-merge.yml b/.github/workflows/renovate-approve-merge.yml new file mode 100644 index 0000000..507ad36 --- /dev/null +++ b/.github/workflows/renovate-approve-merge.yml @@ -0,0 +1,61 @@ +# This workflow is provided via the organization template repository +# +# https://github.com/nextcloud/.github +# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization +# +# SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: MIT + +name: Auto approve renovate PRs + +on: + pull_request_target: # zizmor: ignore[dangerous-triggers] + branches: + - main + - master + - stable* + +permissions: + contents: read + +concurrency: + group: renovate-approve-merge-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + auto-approve-merge: + if: github.event.pull_request.user.login == 'renovate[bot]' + runs-on: ubuntu-latest-low + permissions: + # for hmarr/auto-approve-action to approve PRs + pull-requests: write + + steps: + - name: Disabled on forks + if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} + run: | + echo 'Can not approve PRs from forks' + exit 1 + + - uses: mdecoleman/pr-branch-name@55795d86b4566d300d237883103f052125cc7508 # v3.0.0 + id: branchname + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + + # GitHub actions bot approve + - uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0 + if: github.actor == 'renovate[bot]' + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + ref: ${{ github.head_ref }} + + # Enable GitHub auto merge + - name: Enable Pull Request Automerge + if: github.actor == 'renovate[bot]' + run: gh pr merge --merge --auto + env: + GH_TOKEN: ${{ secrets.AUTOMERGE }} + diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml new file mode 100644 index 0000000..e4f804b --- /dev/null +++ b/.github/workflows/scorecard.yml @@ -0,0 +1,47 @@ +# synced from @nextcloud/android-config + +# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-FileCopyrightText: 2023 Andy Scherzinger +# SPDX-License-Identifier: GPL-3.0-or-later + +name: Scorecard supply-chain security +on: + branch_protection_rule: + schedule: + - cron: '32 23 * * 4' + push: + branches: [ "main", "master" ] + +# Declare default permissions as read only. +permissions: read-all + +concurrency: + group: scorecard-supply-chain-security-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + analysis: + name: Scorecard analysis + runs-on: ubuntu-latest + permissions: + # Needed to upload the results to code-scanning dashboard. + security-events: write + + steps: + - name: "Checkout code" + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: "Run analysis" + uses: ossf/scorecard-action@23f22cd43608bae7a1f1fa2603d7314dee9538a5 # v2.6.0 + with: + results_file: results.sarif + results_format: sarif + publish_results: false + + # Upload the results to GitHub's code scanning dashboard. + - name: "Upload to code-scanning" + uses: github/codeql-action/upload-sarif@915412ff23e8b7659517e607487dbeae018f2934 # v4.39.5 + with: + sarif_file: results.sarif diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..e9c1f29 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,35 @@ +# synced from @nextcloud/android-config + +# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-FileCopyrightText: 2023 Tobias Kaminsky +# SPDX-FileCopyrightText: 2022 Álvaro Brey +# SPDX-License-Identifier: GPL-3.0-or-later + +name: 'Close stale issues' +on: + schedule: + - cron: '0 0 * * *' + +# Declare default permissions as read only. +permissions: read-all + +jobs: + stale: + runs-on: ubuntu-latest-low + permissions: + issues: write + pull-requests: write + steps: + - uses: actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93 # v11.0.0 + with: + days-before-stale: 28 + days-before-close: 14 + days-before-pr-close: -1 + only-labels: 'bug,needs info' + exempt-issue-labels: 'no-stale' + stale-issue-message: >- + This bug report did not receive an update in the last 4 weeks. + Please take a look again and update the issue with new details, + otherwise the issue will be automatically closed in 2 weeks. Thank you! + exempt-all-pr-milestones: true + labels-to-remove-when-unstale: 'needs info' From 68157755cd00302d02ab54682a894e2d6cf691c5 Mon Sep 17 00:00:00 2001 From: nextcloud-android-bot Date: Tue, 1 Dec 2026 18:38:23 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=94=84=20created=20local=20'fastlane/?= =?UTF-8?q?'=20from=20remote=20'config/fastlane/'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nextcloud-android-bot --- fastlane/Pluginfile | 5 + fastlane/Pluginfile.license | 2 + fastlane/common.Fastfile | 391 ++++++++++++++++++++++++++++ fastlane/common.Fastfile.license | 3 + fastlane/fdroid.init.gradle | 46 ++++ fastlane/fdroid.init.gradle.license | 2 + 6 files changed, 449 insertions(+) create mode 100644 fastlane/Pluginfile create mode 100644 fastlane/Pluginfile.license create mode 100644 fastlane/common.Fastfile create mode 100644 fastlane/common.Fastfile.license create mode 100644 fastlane/fdroid.init.gradle create mode 100644 fastlane/fdroid.init.gradle.license diff --git a/fastlane/Pluginfile b/fastlane/Pluginfile new file mode 100644 index 0000000..67ece58 --- /dev/null +++ b/fastlane/Pluginfile @@ -0,0 +1,5 @@ +# Autogenerated by fastlane +# +# Ensure this file is checked in to source control! + +gem 'fastlane-plugin-huawei_appgallery_connect' diff --git a/fastlane/Pluginfile.license b/fastlane/Pluginfile.license new file mode 100644 index 0000000..bad8888 --- /dev/null +++ b/fastlane/Pluginfile.license @@ -0,0 +1,2 @@ +# SPDX-FileCopyrightText: 2017-2026 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/fastlane/common.Fastfile b/fastlane/common.Fastfile new file mode 100644 index 0000000..2370440 --- /dev/null +++ b/fastlane/common.Fastfile @@ -0,0 +1,391 @@ +# install fastlane via bundle +# cd fastlane +# bundle config set path fastlane +# bundle install +# bundle exec fastlane add_plugin huawei_appgallery_connect + +# run fastlane +# bundle exec fastlane + +# update fastlane +# bundle update fastlane + +# update plugins +# bundle exec fastlane update_plugins + +BUILD_NUMBER_RC_START = 51 +BUILD_NUMBER_FINAL_START = 90 + +MAJOR_MULTIPLIER = 10000000 +MINOR_MULTIPLIER = 10000 +PATCH_MULTIPLIER = 100 + +FDROID_ABI_VERSION_CODES = { "armeabi-v7a" => 1, "arm64-v8a" => 2, "x86" => 3, "x86_64" => 4 }.freeze +FDROID_ABI_MULTIPLIER = 10 + +TYPE_ALPHA = "alpha" +TYPE_RC = "rc" +TYPE_FINAL = "final" + +BUNDLE_PATH = "app/build/outputs/bundle/gplayRelease/app-gplay-release.aab" + +default_platform(:android) + +ENV['SUPPLY_UPLOAD_MAX_RETRIES']='10' + +platform :android do + # Usage: fastlane incrementVersion type:(major|minor|patch|rc|final) + # For major, minor, and patch: will increment that version number by 1 and set the smaller ones to 0 + # For rc, final: will set build number to first rc/first final or increment it by 1 + desc "Increment version code and version name" + lane :incrementVersion do |options| + versionInfo = getVersionInfo() + versionComponents = parseVersionCode(versionInfo) + newVersionComponents = incrementVersionComponents(versionComponents: versionComponents, type: options[:type]) + versionNameGenerated = generateVersionName(newVersionComponents) + versionCodeGenerated = generateVersionCode(newVersionComponents) + + promptYesNo(text: "Version code: #{versionInfo["versionCode"]} -> #{versionCodeGenerated}\n" + + "Version name: #{versionInfo["versionName"]} -> #{versionNameGenerated}" + ) + writeVersions(versionCode: versionCodeGenerated, versionName: versionNameGenerated) + end + + desc "Run tests and build app" + lane :releasePhase1 do + sh("rm -rf ../release/ && mkdir -p ../release") + gradle(task: 'clean') + + versionInfo = getVersionInfo() + test() # needs to be overwritten in apps + + buildBundle() + buildAPKs(code: versionInfo["versionCode"]) + end + + desc "Release phase 2: checks, tag, create GH release, upload to appstores" + lane :releasePhase2 do + ensure_git_status_clean(show_uncommitted_changes: true) + versionInfo = getVersionInfo() + versionComponents = parseVersionCode(versionInfo) + checkReleasable(versionComponents) + storeTrack = getPlayStoreTrack(versionComponents) + isPrerelease = isPrerelease(versionComponents) + tagName = getTagName(versionComponents) + preReleaseChecks(versionInfo: versionInfo, tagName: tagName, type: versionComponents["type"], track: storeTrack, isPrerelease: isPrerelease) + checkArtifactsExist() + repoSpecificChecks(isPrerelease: isPrerelease) # needs to be overwritten in apps + tag(name: tagName) + createGithubRelease(name: versionInfo["versionName"], tag: tagName, versionCode: versionInfo["versionCode"], isPrerelease: isPrerelease) + uploadToPlayStore(track: storeTrack) + uploadToHuawei(versionCode: versionInfo["versionCode"], isPrerelease: isPrerelease) + end + + desc "Build ABI APKs for F-Droid in app/build/fdroid/" + lane :buildFdroid do + gradle( + task: ":app:assembleGenericRelease", + flags: "--init-script fastlane/fdroid.init.gradle", + properties: { "fdroidAbiSplit" => true } + ) + end + + desc "Print version info" + lane :printVersionInfo do + versionInfo = getVersionInfo() + versionComponents = parseVersionCode(versionInfo) + print "Version code: #{versionInfo["versionCode"]}\n" + print "Version name: #{versionInfo["versionName"]}\n" + print "Major: #{versionComponents["major"]}\n" + print "Minor: #{versionComponents["minor"]}\n" + print "Patch: #{versionComponents["patch"]}\n" + print "Build: #{versionComponents["build"]}\n" + fdroidAbiVersionCodes(versionCode: versionInfo["versionCode"]).each do |abi, versionCode| + print "F-Droid #{abi} version code: #{versionCode}\n" + end + end + + desc "Upload Alpha version to play store" + lane :uploadAlphaToPlayStore do |options| + upload_to_play_store( + skip_upload_images: true, + skip_upload_aab: true, + skip_upload_changelogs: true, + skip_upload_metadata: true, + skip_upload_screenshots: true, + track: 'alpha', + apk: "/home/androiddaily/apks-#{APP}/android-#{APP}-" + options[:version] + ".apk", + ) + end + + + desc "Parse major, minor, patch and build from versionCode" + private_lane :parseVersionCode do |versionInfo| + versionCode = versionInfo["versionCode"] + build = versionCode % 100 + patch = (versionCode / PATCH_MULTIPLIER) % 100 + minor = (versionCode / MINOR_MULTIPLIER) % 100 + major = (versionCode / MAJOR_MULTIPLIER) % 100 + + type = getVersionType(build: build) + + + { "major" => major, "minor" => minor, "patch" => patch, "build" => build, "type" => type } + end + + desc "Get version type from build number" + private_lane :getVersionType do |options| + build = options[:build] + if build < BUILD_NUMBER_RC_START + type = TYPE_ALPHA + elsif build < BUILD_NUMBER_FINAL_START + type = TYPE_RC + else + type = TYPE_FINAL + end + type + end + + desc "Generate versionCode from version components" + private_lane :generateVersionCode do |versionComponents| + puts "Generating version code from #{versionComponents}" + major = versionComponents["major"] + minor = versionComponents["minor"] + patch = versionComponents["patch"] + build = versionComponents["build"] + test = major * MAJOR_MULTIPLIER + minor * MINOR_MULTIPLIER + patch * PATCH_MULTIPLIER + build + test + end + + desc "Generate F-Droid versionCode per ABI, must match fdroid.init.gradle" + private_lane :fdroidAbiVersionCodes do |options| + versionCode = options[:versionCode] + base = (versionCode / MAJOR_MULTIPLIER) * MAJOR_MULTIPLIER + (versionCode % MAJOR_MULTIPLIER) * FDROID_ABI_MULTIPLIER + FDROID_ABI_VERSION_CODES.transform_values { |abiCode| base + abiCode } + end + + desc "Compute version name from version code" + private_lane :generateVersionName do |versionComponents| + suffix = "" + buildNumber = versionComponents["build"] + puts "Generating version name from #{versionComponents}\n" + case + when versionComponents["type"] == TYPE_RC + rcNumber = (buildNumber - BUILD_NUMBER_RC_START) + 1 + suffix = " RC#{rcNumber}" + when versionComponents["type"] == TYPE_ALPHA + suffix = " Alpha#{buildNumber + 1}" + end + "#{versionComponents["major"]}.#{versionComponents["minor"]}.#{versionComponents["patch"]}#{suffix}" + end + + desc "Read versions from gradle file" + private_lane :getVersionInfo do + File.open("../app/build.gradle.kts","r") do |file| + text = file.read + versionName = text.match(/versionName = "(.*)"$/)[1] + versionCode = text.match(/versionCode = ([0-9]*)$/)[1].to_i + + { "versionCode" => versionCode, "versionName" => versionName } + end + end + + desc "Write versions to gradle file" + private_lane :writeVersions do |options| + File.open("../app/build.gradle.kts","r+") do |file| + text = file.read + text.sub!(/versionName = "(.*)"$/, "versionName = \"#{options[:versionName]}\"") + text.sub!(/versionCode = ([0-9]*)$/, "versionCode = #{options[:versionCode]}") + file.rewind + file.write(text) + file.truncate(file.pos) + end + end + + private_lane :incrementVersionComponents do |options| + versionComponents = options[:versionComponents] + case options[:type] + when "major" + versionComponents["major"] = versionComponents["major"] + 1 + versionComponents["minor"] = 0 + versionComponents["patch"] = 0 + versionComponents["build"] = 0 + when "minor" + versionComponents["minor"] = versionComponents["minor"] + 1 + versionComponents["patch"] = 0 + versionComponents["build"] = 0 + when "patch" + versionComponents["patch"] = versionComponents["patch"] + 1 + versionComponents["build"] = 0 + when "rc" + if versionComponents["type"] != TYPE_RC + versionComponents["build"] = BUILD_NUMBER_RC_START + else + versionComponents["build"] = versionComponents["build"] + 1 + end + when "final" + if versionComponents["type"] != TYPE_FINAL + versionComponents["build"] = BUILD_NUMBER_FINAL_START + else + versionComponents["build"] = versionComponents["build"] + 1 + end + else + UI.user_error!("Unknown or missing version increment type #{options[:type]}. Usage: incrementVersion type:(major|minor|patch|rc|final)") + end + versionComponents["type"] = getVersionType(build: versionComponents["build"]) + versionComponents + end + + desc "Get tag name from version components" + private_lane :getTagName do |versionComponents| + if versionComponents["type"] == TYPE_FINAL + tag = "#{versionComponents["major"]}.#{versionComponents["minor"]}.#{versionComponents["patch"]}" + elsif versionComponents["type"] == TYPE_RC + rcNumber = (versionComponents["build"] - BUILD_NUMBER_RC_START) + 1 + rcNumberPadded = "%02d" % rcNumber + tag = "rc-#{versionComponents["major"]}.#{versionComponents["minor"]}.#{versionComponents["patch"]}-#{rcNumberPadded}" + else + UI.user_error!("Build number cannot be tagged: #{versionComponents["build"]}") + end + end + + desc "Check if version is releasable" + private_lane :checkReleasable do |versionComponents| + if versionComponents["type"] != TYPE_FINAL && versionComponents["type"] != TYPE_RC + UI.user_error!("Version is not releasable: #{versionComponents["type"]}") + end + end + + desc "Get play store track from version type" + private_lane :getPlayStoreTrack do |versionComponents| + case versionComponents["type"] + when TYPE_RC + track = "beta" + when TYPE_FINAL + track = "production" + else + UI.user_error!("Version is not releasable: #{versionComponents["type"]}") + end + end + + desc "check if release is a prerelease" + private_lane :isPrerelease do |versionComponents| + case versionComponents["type"] + when TYPE_RC + isPrerelease = true + when TYPE_FINAL + isPrerelease = false + else + UI.user_error!("Version is not releasable: #{versionComponents["type"]}") + end + end + + desc "Build app bundle" + private_lane :buildBundle do + gradle( + task: 'bundle', + flavor: 'Gplay', + build_type: 'Release', + print_command: false, + properties: GRADLE_SIGNING_PROPERTIES + ) + end + + desc "Build signed APK" + private_lane :SignedRelease do |options| + gradle( + task: 'assemble', + flavor: options[:flavor], + build_type: 'Release', + print_command: false, + properties: defined?(APK_SIGNING_PROPERTIES) ? APK_SIGNING_PROPERTIES : GRADLE_SIGNING_PROPERTIES + ) + + sh("mv ../app/build/outputs/apk/#{options[:flavor]}/release/*.apk ../release/nextcloud-#{APP}-#{options[:flavor]}-#{options[:versionCode]}.apk") + end + + desc "Build all APKs" + private_lane :buildAPKs do |options| + SignedRelease(flavor: "generic", versionCode: options[:code]) + SignedRelease(flavor: "gplay", versionCode: options[:code]) + + if APP == "files" + SignedRelease(flavor: "huawei", versionCode: options[:code]) + end + end + + desc "Create release tag" + private_lane :tag do |options| + tagName = options[:name] + add_git_tag( + tag: tagName, + sign: true + ) + push_git_tags(tag: tagName) + end + + desc "Upload release artifacts to Google Play" + private_lane :uploadToPlayStore do |options| + upload_to_play_store( + skip_upload_images: true, + skip_upload_apk: true, + track: options[:track], + aab: BUNDLE_PATH + ) + end + + desc "Check if release artifacts exist" + private_lane :checkArtifactsExist do + if !File.exist?("../#{BUNDLE_PATH}") + UI.user_error!("Bundle not found at #{BUNDLE_PATH}") + end + end + + desc "Show versions and prompt for confirmation" + private_lane :preReleaseChecks do |options| + versionInfo = options[:versionInfo] + tagName = options[:tagName] + currentBranch = git_branch() + text = "Version code: #{versionInfo["versionCode"]}\n" + + "Version name: #{versionInfo["versionName"]}\n" + + "Current branch: #{currentBranch}\n" + + "Version type: #{options[:type]}\n" + + "Tag: #{tagName}\n" + + "Track: #{options[:track]}\n" + + "Prerelease: #{options[:isPrerelease]}" + promptYesNo(text: text) + end + + private_lane :createGithubRelease do |options| + set_github_release( + repository_name: REPO, + api_token: ENV["FASTLANE_NEXTCLOUD_GITHUB_API_TOKEN"], + name: options[:name], + is_prerelease: options[:isPrerelease], + tag_name: options[:tag], + description: (File.read("metadata/android/en-US/changelogs/#{options[:versionCode]}.txt") rescue "No changelog provided"), + upload_assets: Dir.glob(File.expand_path("../release/*.apk")) + ) + end + + private_lane :uploadToHuawei do |options| + if APP == "files" && options[:isPrerelease] == false + huawei_appgallery_connect( + client_id: ENV["FASTLANE_NEXTCLOUD_HUAWEI_CLIENT_ID"], + client_secret: ENV["FASTLANE_NEXTCLOUD_HUAWEI_CLIENT_SECRET"], + app_id: ENV["FASTLANE_NEXTCLOUD_HUAWEI_APP_ID"], + apk_path: "release/nextcloud-#{APP}-huawei-#{options[:versionCode]}.apk", + submit_for_review: true, + delay_before_submit_for_review: 30, + ) + end + end +end + +private_lane :promptYesNo do |options| + puts "\n" + options[:text] + answer = prompt(text: "is this okay?", boolean: true) + if !answer + UI.user_error!("Aborting") + end +end diff --git a/fastlane/common.Fastfile.license b/fastlane/common.Fastfile.license new file mode 100644 index 0000000..8362977 --- /dev/null +++ b/fastlane/common.Fastfile.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors +SPDX-FileCopyrightText: 2023 Álvaro Brey +SPDX-License-Identifier: GPL-3.0-or-later diff --git a/fastlane/fdroid.init.gradle b/fastlane/fdroid.init.gradle new file mode 100644 index 0000000..9b15457 --- /dev/null +++ b/fastlane/fdroid.init.gradle @@ -0,0 +1,46 @@ +gradle.beforeProject { project -> + if (project.path != ':app' || !project.providers.gradleProperty('fdroidAbiSplit').isPresent()) { + return + } + if (project.extensions.extraProperties.has('nextcloudFdroidConfigured')) { + return + } + project.extensions.extraProperties.set('nextcloudFdroidConfigured', true) + + project.pluginManager.withPlugin('com.android.application') { + def abiVersionCodes = ['armeabi-v7a': 1, 'arm64-v8a': 2, 'x86': 3, 'x86_64': 4] + def majorMultiplier = 10000000 + def abiMultiplier = 10 + def androidComponents = project.extensions.getByName('androidComponents') + + def buildDirectory = project.layout.buildDirectory.get() + project.layout.buildDirectory.set(buildDirectory.dir('fdroid')) + + androidComponents.finalizeDsl { android -> + ([android.defaultConfig] + android.buildTypes.toList() + android.productFlavors.toList()).each { config -> + config.ndk.abiFilters.clear() + } + android.splits.abi.enable = true + android.splits.abi.reset() + android.splits.abi.include(*abiVersionCodes.keySet().toArray(new String[0])) + android.splits.abi.universalApk = false + } + + androidComponents.beforeVariants(androidComponents.selector().all()) { variant -> + variant.enable = variant.name == 'genericRelease' + } + + androidComponents.onVariants(androidComponents.selector().withName('genericRelease')) { variant -> + variant.outputs.each { output -> + def abi = output.filters.find { it.filterType.name() == 'ABI' }?.identifier + if (!abiVersionCodes.containsKey(abi)) { + throw new GradleException("Unexpected F-Droid APK ABI: ${abi}") + } + def versionCode = output.versionCode.get() + def base = versionCode.intdiv(majorMultiplier) * majorMultiplier + + (versionCode % majorMultiplier) * abiMultiplier + output.versionCode.set(base + abiVersionCodes[abi]) + } + } + } +} diff --git a/fastlane/fdroid.init.gradle.license b/fastlane/fdroid.init.gradle.license new file mode 100644 index 0000000..b6fc737 --- /dev/null +++ b/fastlane/fdroid.init.gradle.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors +SPDX-License-Identifier: GPL-3.0-or-later From 4cdd344003fc30e0dd158318bf43738d6a3c288e Mon Sep 17 00:00:00 2001 From: nextcloud-android-bot Date: Tue, 1 Dec 2026 18:38:23 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=94=84=20synced=20local=20'.'=20with?= =?UTF-8?q?=20remote=20'config/root/'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nextcloud-android-bot --- Gemfile | 7 ++ Gemfile.license | 2 + Gemfile.lock | 270 +++++++++++++++++++++++++++++++++++++++++++ Gemfile.lock.license | 2 + 4 files changed, 281 insertions(+) create mode 100644 Gemfile create mode 100644 Gemfile.license create mode 100644 Gemfile.lock create mode 100644 Gemfile.lock.license diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..906ddc5 --- /dev/null +++ b/Gemfile @@ -0,0 +1,7 @@ +source "https://rubygems.org" + +gem "fastlane" +gem "abbrev" + +plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') +eval_gemfile(plugins_path) if File.exist?(plugins_path) diff --git a/Gemfile.license b/Gemfile.license new file mode 100644 index 0000000..7a2ef8e --- /dev/null +++ b/Gemfile.license @@ -0,0 +1,2 @@ +# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: CC0-1.0 diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..fc9c042 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,270 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.8) + abbrev (0.1.2) + addressable (2.9.2) + public_suffix (>= 2.0.2, < 8.0) + artifactory (3.0.17) + atomos (0.1.3) + aws-eventstream (1.4.1) + aws-partitions (1.1301.0) + aws-sdk-core (3.264.0) + aws-eventstream (~> 1, >= 1.4.1) + aws-partitions (~> 1, >= 1.992.0) + aws-sigv4 (~> 1.9) + base64 + bigdecimal + jmespath (~> 1, >= 1.6.1) + logger + rexml (~> 3.4, >= 3.4.2) + aws-sdk-kms (1.139.0) + aws-sdk-core (~> 3, >= 3.264.0) + aws-sigv4 (~> 1.5) + aws-sdk-s3 (1.238.0) + aws-sdk-core (~> 3, >= 3.264.0) + aws-sdk-kms (~> 1) + aws-sigv4 (~> 1.5) + aws-sigv4 (1.12.1) + aws-eventstream (~> 1, >= 1.0.2) + babosa (1.0.4) + base64 (0.3.0) + benchmark (0.5.0) + bigdecimal (4.1.3) + cgi (0.5.2) + claide (1.1.0) + colored (1.2) + colored2 (3.1.2) + commander (4.6.0) + highline (~> 2.0.0) + csv (3.3.7) + declarative (0.0.20) + digest-crc (0.7.0) + rake (>= 12.0.0, < 14.0.0) + domain_name (0.7.20261031) + dotenv (2.8.1) + emoji_regex (3.2.3) + erb (6.0.7) + excon (1.10.0) + faraday (2.15.1) + faraday-net_http (>= 2.0, < 3.6) + json + logger + faraday-cookie_jar (0.0.8) + faraday (>= 0.8.0) + http-cookie (>= 1.0.0) + faraday-follow_redirects (0.5.0) + faraday (>= 1, < 3) + faraday-multipart (1.2.0) + multipart-post (~> 2.0) + faraday-net_http (3.5.0) + net-http (~> 0.5) + faraday-retry (2.4.0) + faraday (~> 2.0) + fastimage (2.4.3) + fastlane (2.241.2) + CFPropertyList (>= 2.3, < 5.0.0) + abbrev (~> 0.1) + addressable (>= 2.9.0, < 3.0.0) + artifactory (~> 3.0) + aws-sdk-s3 (~> 1.197) + babosa (>= 1.0.3, < 2.0.0) + base64 (~> 0.2) + benchmark (>= 0.1.0) + bundler (>= 2.4.0, < 5.0.0) + cgi (~> 0.4) + colored (~> 1.2) + commander (~> 4.6) + csv (~> 3.3) + dotenv (>= 2.1.1, < 3.0.0) + emoji_regex (>= 0.1, < 4.0) + erb (>= 4.0, < 7.0) + excon (>= 1.0.0, < 2.0.0) + faraday (~> 2.7) + faraday-cookie_jar (~> 0.0.8) + faraday-follow_redirects (~> 0.3) + faraday-multipart (~> 1.0) + faraday-retry (~> 2.0) + fastimage (>= 2.1.0, < 3.0.0) + fastlane-sirp (>= 1.1.0) + gh_inspector (>= 1.1.2, < 2.0.0) + google-apis-androidpublisher_v3 (~> 0.99) + google-apis-playcustomapp_v1 (~> 0.1) + google-cloud-env (>= 1.6.0, < 2.5.0) + google-cloud-storage (~> 1.31) + highline (~> 2.0) + irb (>= 1.8) + json (< 3.0.0) + jwt (>= 2.10.3, < 4) + logger (>= 1.6, < 2.0) + mini_magick (>= 4.9.4, < 5.0.0) + multi_json (~> 1.12) + multipart-post (>= 2.0.0, < 3.0.0) + mutex_m (~> 0.3) + naturally (~> 2.2) + nkf (~> 0.2) + optparse (>= 0.1.1, < 1.0.0) + ostruct (>= 0.1.0) + plist (>= 3.1.0, < 4.0.0) + rubyzip (>= 3.4.0, < 4.0.0) + security (~> 0.3) + simctl (~> 1.6.3) + terminal-notifier (>= 3.1.0, < 4.0.0) + terminal-table (~> 4) + tty-screen (>= 0.6.3, < 1.0.0) + tty-spinner (>= 0.8.0, < 1.0.0) + word_wrap (~> 1.0.0) + xcodeproj (>= 1.13.0, < 2.0.0) + xcpretty (~> 0.4.1) + xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) + fastlane-plugin-huawei_appgallery_connect (1.1.3) + cgi + fastlane-sirp (1.1.0) + gh_inspector (1.1.3) + google-apis-androidpublisher_v3 (0.111.0) + google-apis-core (>= 0.15.0, < 2.a) + google-apis-core (1.4.1) + addressable (~> 2.9) + faraday (~> 2.13) + faraday-follow_redirects (~> 0.3) + googleauth (~> 1.14) + mini_mime (~> 1.1) + multi_json (~> 1.21, >= 1.21.2) + representable (~> 3.3, >= 3.3.1) + retriable (>= 3.1, < 5.0) + google-apis-iamcredentials_v1 (0.28.0) + google-apis-core (>= 0.15.0, < 2.a) + google-apis-playcustomapp_v1 (0.18.0) + google-apis-core (>= 0.15.0, < 2.a) + google-apis-storage_v1 (0.70.0) + google-apis-core (>= 0.15.0, < 2.a) + google-cloud-core (1.9.1) + google-cloud-env (>= 1.0, < 3.a) + google-cloud-errors (~> 1.0) + google-cloud-env (2.4.1) + base64 (~> 0.2) + faraday (>= 1.0, < 3.a) + google-cloud-errors (1.7.1) + google-cloud-storage (1.62.1) + addressable (~> 2.8) + digest-crc (~> 0.4) + google-apis-core (>= 0.18, < 2) + google-apis-iamcredentials_v1 (~> 0.18) + google-apis-storage_v1 (>= 0.42) + google-cloud-core (~> 1.6) + googleauth (~> 1.9) + mini_mime (~> 1.0) + google-logging-utils (0.2.2) + googleauth (1.17.7) + faraday (>= 1.0, < 3.a) + google-cloud-env (~> 2.2) + google-logging-utils (~> 0.1) + jwt (>= 1.4, < 4.0) + os (>= 0.9, < 2.0) + pstore (~> 0.1) + signet (>= 0.16, < 2.a) + highline (2.0.3) + http-cookie (1.1.6) + domain_name (~> 0.5) + io-console (0.9.5) + irb (1.18.0) + pp (>= 0.6.0) + prism (>= 1.3.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + jmespath (1.6.2) + json (2.21.2) + jwt (3.3.0) + base64 + logger (1.7.0) + mini_magick (4.13.2) + mini_mime (1.1.5) + multi_json (1.21.2) + multipart-post (2.4.1) + mutex_m (0.3.0) + nanaimo (0.4.0) + naturally (2.3.0) + net-http (0.10.0) + net-protocol (>= 0.3.0) + uri (>= 0.11.1) + net-protocol (0.4.0) + timeout + nkf (0.3.0) + optparse (0.8.1) + os (1.1.4) + ostruct (0.6.3) + plist (3.7.2) + pp (0.6.4) + prettyprint + prettyprint (0.2.1) + prism (2.1.0-x86_64-linux-gnu) + pstore (0.3.0) + public_suffix (7.0.5) + rake (13.4.2) + rbs (4.2.0) + logger + prism (>= 1.6.0) + tsort + rdoc (8.1.0) + erb + prism (>= 1.6.0) + rbs (>= 4.0.0) + tsort + reline (0.7.0) + io-console (~> 0.5) + representable (3.3.1) + declarative (< 0.1.0) + trailblazer-option (>= 0.1.1, < 0.2.0) + uber (< 0.2.0) + retriable (4.2.0) + rexml (3.4.4) + rouge (3.28.0) + rubyzip (3.7.0) + security (0.4.0) + signet (0.22.2) + addressable (~> 2.8) + faraday (>= 0.17.5, < 3.a) + jwt (>= 1.5, < 4.0) + simctl (1.6.10) + CFPropertyList + naturally + terminal-notifier (3.1.0) + terminal-table (4.0.0) + unicode-display_width (>= 1.1.1, < 4) + timeout (0.6.1) + trailblazer-option (0.1.2) + tsort (0.2.0) + tty-cursor (0.7.1) + tty-screen (0.8.2) + tty-spinner (0.9.3) + tty-cursor (~> 0.7) + uber (0.1.0) + unicode-display_width (3.3.0) + unicode-emoji (~> 4.3) + unicode-emoji (4.3.0) + uri (1.1.2) + word_wrap (1.0.0) + xcodeproj (1.28.1) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + base64 + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.4.0) + nkf + rexml (>= 3.3.6, < 4.0) + xcpretty (0.4.1) + rouge (~> 3.28.0) + xcpretty-travis-formatter (1.0.1) + xcpretty (~> 0.2, >= 0.0.7) + +PLATFORMS + x86_64-linux + +DEPENDENCIES + abbrev + fastlane + fastlane-plugin-huawei_appgallery_connect + +BUNDLED WITH + 4.0.24 diff --git a/Gemfile.lock.license b/Gemfile.lock.license new file mode 100644 index 0000000..7a2ef8e --- /dev/null +++ b/Gemfile.lock.license @@ -0,0 +1,2 @@ +# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: CC0-1.0