diff --git a/browser-test-arch.json b/browser-test-arch.json new file mode 100644 index 0000000000000000000000000000000000000000..ed3de0bb6782e59fd0d0027a52960bac78ef8a56 --- /dev/null +++ b/browser-test-arch.json @@ -0,0 +1,15 @@ +{ + "name": "Browser", + "package_name": "foundation.e.browser", + "version_code": 744404801, + "min_sdk": 29, + "version_name": "142.0.7444.48", + "url": "https://gitlab.e.foundation/api/v4/projects/163/jobs/artifacts/v3.7.4/raw/app/build/outputs/apk/release/Notes_official.apk?job=generate-apks", + "urls": { + "arm64-v8a": "https://gitlab.e.foundation/api/v4/projects/163/jobs/artifacts/v3.7.4/raw/app/build/outputs/apk/release/Notes_official.apk?job=generate-apks", + "armeabi-v7a": "https://gitlab.e.foundation/api/v4/projects/163/jobs/artifacts/v3.7.4/raw/app/build/outputs/apk/release/Notes_official.apk?job=generate-apks", + "x86_64": "https://gitlab.e.foundation/api/v4/projects/163/jobs/artifacts/v3.7.4/raw/app/build/outputs/apk/release/Notes_official.apk?job=generate-apks", + "x86": "https://gitlab.e.foundation/api/v4/projects/163/jobs/artifacts/v3.7.4/raw/app/build/outputs/apk/release/Notes_official.apk?job=generate-apks" + }, + "size": 25000000 +} diff --git a/scripts/create-json-files.sh b/scripts/create-json-files.sh index dfa0756d0f3c0d935ae19a8a68ca9ee2a4e875b3..83f1ceeb85c3951b9a21ba483c0fc6a5865a4ff0 100755 --- a/scripts/create-json-files.sh +++ b/scripts/create-json-files.sh @@ -55,10 +55,12 @@ editJson() { } # Generate update info about community or official builds. -# Args: file_name apk_download_url +# Args: file_name apk_download_url [build_type] generateJsonFile() { local fileName="$1" local url="$2" + local buildType="$3" # community, official, or test + echo "{}" > $fileName editJson $fileName "name" "$application_label" editJson $fileName "package_name" "$package_name" @@ -66,6 +68,48 @@ generateJsonFile() { editJson $fileName "min_sdk" "$min_sdk" editJson $fileName "version_name" "$version_name" editJson $fileName "url" "$url" + + # Add architecture-specific URLs if enabled and APK files exist + if [[ "${ENABLE_ARCH_URLS}" == "true" ]]; then + local base_url="https://gitlab.e.foundation/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/${CI_COMMIT_TAG}/raw/$APK_PATH" + local arch_urls_json="" + local arch_count=0 + + # Check each architecture APK exists before adding to URLs + if [[ -f "${buildType}-arm64-v8a.apk" ]]; then + [[ $arch_count -gt 0 ]] && arch_urls_json+=',' + arch_urls_json+='"arm64-v8a":"'${base_url}'/'${buildType}'-arm64-v8a.apk?job=generate-apks"' + arch_count=$((arch_count + 1)) + fi + + if [[ -f "${buildType}-armeabi-v7a.apk" ]]; then + [[ $arch_count -gt 0 ]] && arch_urls_json+=',' + arch_urls_json+='"armeabi-v7a":"'${base_url}'/'${buildType}'-armeabi-v7a.apk?job=generate-apks"' + arch_count=$((arch_count + 1)) + fi + + if [[ -f "${buildType}-x86_64.apk" ]]; then + [[ $arch_count -gt 0 ]] && arch_urls_json+=',' + arch_urls_json+='"x86_64":"'${base_url}'/'${buildType}'-x86_64.apk?job=generate-apks"' + arch_count=$((arch_count + 1)) + fi + + if [[ -f "${buildType}-x86.apk" ]]; then + [[ $arch_count -gt 0 ]] && arch_urls_json+=',' + arch_urls_json+='"x86":"'${base_url}'/'${buildType}'-x86.apk?job=generate-apks"' + arch_count=$((arch_count + 1)) + fi + + # Only add urls field if we found at least one architecture-specific APK + if [[ $arch_count -gt 0 ]]; then + arch_urls_json='{'${arch_urls_json}'}' + editJson $fileName "urls" "$arch_urls_json" + echo "Added $arch_count architecture-specific URLs for $buildType" + else + echo "No architecture-specific APKs found for $buildType, skipping urls field" + fi + fi + if [[ -n ${PRIORITY} ]]; then editJson $fileName "priority" "${PRIORITY}"; fi if [[ -n ${AUTHOR} ]]; then editJson $fileName "author" "${AUTHOR}"; fi if [[ -n ${BLOCKED_ANDROID} ]]; then editJson $fileName "blocked_android" "${BLOCKED_ANDROID}"; fi @@ -96,16 +140,16 @@ echo "File size for - $TEST_APK - $apk_size_test" # Generate json files ==================== if [[ "$BLOCKED_COMMUNITY" != "true" ]]; then - generateJsonFile community.json "https://gitlab.e.foundation/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/${CI_COMMIT_TAG}/raw/$APK_PATH/$COMMUNITY_APK?job=generate-apks" + generateJsonFile community.json "https://gitlab.e.foundation/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/${CI_COMMIT_TAG}/raw/$APK_PATH/$COMMUNITY_APK?job=generate-apks" "community" editJson community.json "size" "$apk_size_community" fi if [[ "$BLOCKED_OFFICIAL" != "true" ]]; then - generateJsonFile official.json "https://gitlab.e.foundation/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/${CI_COMMIT_TAG}/raw/$APK_PATH/$OFFICIAL_APK?job=generate-apks" + generateJsonFile official.json "https://gitlab.e.foundation/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/${CI_COMMIT_TAG}/raw/$APK_PATH/$OFFICIAL_APK?job=generate-apks" "official" editJson official.json "size" "$apk_size_official" fi -generateJsonFile test.json "https://gitlab.e.foundation/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/${CI_COMMIT_TAG}/raw/$APK_PATH/$TEST_APK?job=generate-apks" +generateJsonFile test.json "https://gitlab.e.foundation/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/${CI_COMMIT_TAG}/raw/$APK_PATH/$TEST_APK?job=generate-apks" "test" editJson test.json "size" "$apk_size_test" # Move json file for artifacts ==================== diff --git a/updatable_system_apps_arch.json b/updatable_system_apps_arch.json new file mode 100644 index 0000000000000000000000000000000000000000..96ab9e89509651ef5a714b487acd52ad3da858dc --- /dev/null +++ b/updatable_system_apps_arch.json @@ -0,0 +1,3 @@ +[ + { "packageName": "foundation.e.browser", "projectId": 269 } +]