diff --git a/.forgejo/workflows/build_release.yml b/.forgejo/workflows/build_release.yml index 0a0f6604f..6cd3106f0 100755 --- a/.forgejo/workflows/build_release.yml +++ b/.forgejo/workflows/build_release.yml @@ -64,79 +64,6 @@ jobs: java -version fi - - name: Write google-services.json - shell: bash - run: | - set -euo pipefail - RAW_SECRET='${{ secrets.GOOGLE_SERVICES_JSON }}' python3 - <<'PY' - import base64 - import json - import os - from pathlib import Path - - raw = os.environ.get("RAW_SECRET", "") - candidates = [raw, raw.strip()] - - try: - decoded = base64.b64decode(raw, validate=True).decode("utf-8") - candidates.extend([decoded, decoded.strip()]) - except Exception: - pass - - out = Path("app/google-services.json") - for candidate in candidates: - if not candidate: - continue - try: - value = json.loads(candidate) - if isinstance(value, str): - value = json.loads(value) - out.write_text(json.dumps(value, ensure_ascii=False)) - break - except Exception: - continue - else: - raise SystemExit("GOOGLE_SERVICES_JSON is neither valid JSON nor base64 JSON") - PY - python3 -m json.tool app/google-services.json > /dev/null - - - name: Write client_secrets.json - shell: bash - run: | - set -euo pipefail - mkdir -p app/src/main/assets - RAW_SECRET='${{ secrets.GOOGLE_CLIENT_SECRETS_JSON }}' python3 - <<'PY' - import base64 - import json - import os - from pathlib import Path - - raw = os.environ.get("RAW_SECRET", "") - candidates = [raw, raw.strip()] - - try: - decoded = base64.b64decode(raw, validate=True).decode("utf-8") - candidates.extend([decoded, decoded.strip()]) - except Exception: - pass - - out = Path("app/src/main/assets/client_secrets.json") - for candidate in candidates: - if not candidate: - continue - try: - value = json.loads(candidate) - if isinstance(value, str): - value = json.loads(value) - out.write_text(json.dumps(value, ensure_ascii=False)) - break - except Exception: - continue - else: - raise SystemExit("GOOGLE_CLIENT_SECRETS_JSON is neither valid JSON nor base64 JSON") - PY - python3 -m json.tool app/src/main/assets/client_secrets.json > /dev/null - - name: Prepare release metadata id: prepare shell: bash @@ -179,7 +106,7 @@ jobs: run: ./gradlew --no-daemon --max-workers=2 spotlessCheck - name: Build app - run: ./gradlew --no-daemon --max-workers=2 assembleRelease -Pinclude-telemetry -Penable-updater + run: ./gradlew --no-daemon --max-workers=2 assembleRelease -Penable-updater - name: Run unit tests run: ./gradlew --no-daemon --max-workers=2 testReleaseUnitTest