diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aec9cf5..415ee3b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -121,7 +121,7 @@ jobs: MODULES=${MODULES#"$NL"} APKS=${APKS#"$NL"} - BODY="$(sed 's/^\* \*\*/↪ \*\*/g; s/^\* `/↪ \*\*/g; s/`/\*/g; s/\*\*/\*/g; s/###//g;' ../build.md)" + BODY="$(sed 's/^\* \*\*/↪ \*\*/g; s/^\* `/↪ \*\*/g; s/`/\*/g; s/\*\*/\*/g; s/###//g;' ../build.md)" MSG="*New build!* ${BODY} @@ -136,3 +136,8 @@ jobs: echo "'$MSG'" POST="https://api.telegram.org/bot${TG_TOKEN}/sendMessage" curl -X POST --data-urlencode "parse_mode=Markdown" --data-urlencode "text=${MSG}" --data-urlencode "chat_id=${TG_CHAT}" "$POST" + + - uses: actions/upload-artifact@v3 + with: + name: logs + path: logs diff --git a/.gitignore b/.gitignore index ead3811..11527f9 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,8 @@ /temp /build /test +/logs build.md cmpr test.toml -options.toml \ No newline at end of file +options.toml diff --git a/build.sh b/build.sh index 87002e3..3b822ba 100755 --- a/build.sh +++ b/build.sh @@ -10,15 +10,17 @@ mkdir -p "$BUILD_DIR" "$TEMP_DIR" toml_prep "$(cat 2>/dev/null "${1:-config.toml}")" || abort "could not find config file '${1}'" main_config_t=$(toml_get_table "") -COMPRESSION_LEVEL=$(toml_get "$main_config_t" compression-level) -ENABLE_MAGISK_UPDATE=$(toml_get "$main_config_t" enable-magisk-update) -PARALLEL_JOBS=$(toml_get "$main_config_t" parallel-jobs) -UPDATE_PREBUILTS=$(toml_get "$main_config_t" update-prebuilts) -BUILD_MINDETACH_MODULE=$(toml_get "$main_config_t" build-mindetach-module) +COMPRESSION_LEVEL=$(toml_get "$main_config_t" compression-level) || abort "ERROR: compression-level is missing" +ENABLE_MAGISK_UPDATE=$(toml_get "$main_config_t" enable-magisk-update) || abort "ERROR: enable-magisk-update is missing" +PARALLEL_JOBS=$(toml_get "$main_config_t" parallel-jobs) || abort "ERROR: parallel-jobs is missing" +UPDATE_PREBUILTS=$(toml_get "$main_config_t" update-prebuilts) || abort "ERROR: update-prebuilts is missing" +BUILD_MINDETACH_MODULE=$(toml_get "$main_config_t" build-mindetach-module) || abort "ERROR: build-mindetach-module is missing" +LOGGING_F=$(toml_get "$main_config_t" logging-to-file) || LOGGING_F=false if ((COMPRESSION_LEVEL > 9)) || ((COMPRESSION_LEVEL < 0)); then abort "compression-level must be from 0 to 9"; fi if [ "$UPDATE_PREBUILTS" = true ]; then get_prebuilts; else set_prebuilts; fi if [ "$BUILD_MINDETACH_MODULE" = true ]; then : >$PKGS_LIST; fi +if [ "$LOGGING_F" = true ]; then mkdir -p logs; fi jq --version >/dev/null || abort "\`jq\` is not installed. install it with 'apt install jq' or equivalent" get_cmpr @@ -62,7 +64,13 @@ for table_name in $(toml_get_table_names); do [ "$merge_integrations" = true ] && app_args[patcher_args]="${app_args[patcher_args]} -m ${RV_INTEGRATIONS_APK}" [ "$exclusive_patches" = true ] && app_args[patcher_args]="${app_args[patcher_args]} --exclusive" - build_rv app_args & + if [ "$LOGGING_F" = true ]; then + logf=logs/"${table_name,,}.log" + : >"$logf" + (build_rv 2>&1 app_args | tee "$logf") & + else + build_rv app_args & + fi done wait diff --git a/config.toml b/config.toml index 8dc8477..27eca36 100644 --- a/config.toml +++ b/config.toml @@ -1,6 +1,7 @@ # see https://github.com/j-hc/revanced-magisk-module/blob/main/CONFIG.md for more detailed explanations compression-level = 9 # compression level for module zips. between 1 and 9 +logging-to-file = true # enables logging of every patch process to a seperate file enable-magisk-update = true # set this to false if you do not want to receive updates for the module in magisk app parallel-jobs = 3 # max number of concurrent building jobs update-prebuilts = true # dont touch this