Skip to content

Commit

Permalink
check updates for all sources
Browse files Browse the repository at this point in the history
  • Loading branch information
j-hc committed Sep 22, 2023
1 parent 26f2a53 commit 52d3e9a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 14 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ jobs:
${APKS}
"
echo "'$MSG'"
MSG=${MSG:0:9450}
POST="https://api.telegram.org/bot${TG_TOKEN}/sendMessage"
curl -X POST --data-urlencode "parse_mode=Markdown" --data-urlencode "disable_web_page_preview=true" --data-urlencode "text=${MSG}" --data-urlencode "chat_id=${TG_CHAT}" "$POST"
Expand Down
29 changes: 21 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,27 @@ jobs:
}
is_patches_latest() {
PATCHES_SRC=$(toml_get "$(toml_get_table "")" patches-source) || PATCHES_SRC="ReVanced/revanced-patches"
last_patches_url=$(gh_req https://api.github.com/repos/${PATCHES_SRC}/releases/latest - | json_get 'browser_download_url' | grep 'jar')
last_patches=${last_patches_url##*/}
cur_patches=$(sed -n "s/.*Patches: ${PATCHES_SRC%%/*}\/\(.*\)/\1/p" build.md | xargs)
echo "current patches version: $cur_patches"
echo "latest patches version: $last_patches"
if [ -z "$cur_patches" ] || [ -z "$last_patches" ]; then return 1; fi
[ "$cur_patches" != "$last_patches" ] # test success=>build, fail=>dont build
declare -A sources
sources["ReVanced/revanced-patches"]=1
for table_name in $(toml_get_table_names); do
if [ -z "$table_name" ]; then continue; fi
t=$(toml_get_table "$table_name")
enabled=$(toml_get "$t" enabled) || enabled=true
if [ "$enabled" = false ]; then continue; fi
PATCHES_SRC=$(toml_get "$t" patches-source)
if [ "$PATCHES_SRC" ]; then sources[$PATCHES_SRC]=1; fi
done
for PATCHES_SRC in "${!sources[@]}"; do
echo "chk: '$PATCHES_SRC'"
last_patches_url=$(gh_req "https://api.github.com/repos/${PATCHES_SRC}/releases/latest" - | json_get 'browser_download_url' | grep 'jar')
last_patches=${last_patches_url##*/}
cur_patches=$(sed -n "s/.*Patches: ${PATCHES_SRC%%/*}\/\(.*\)/\1/p" build.md | xargs)
echo "current patches version: $cur_patches"
echo "latest patches version: $last_patches"
if [ -z "$cur_patches" ] || [ -z "$last_patches" ]; then continue; fi
if [ "$cur_patches" != "$last_patches" ]; then return 0; fi
done
return 1
}
if ! git checkout update; then
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ bash <(curl -sSf https://raw.githubusercontent.com/j-hc/revanced-magisk-module/m

## On Desktop
```console
$ git clone --recurse https://github.com/j-hc/revanced-magisk-module
$ git clone https://github.com/j-hc/revanced-magisk-module
$ cd revanced-magisk-module
$ ./build.sh
```
6 changes: 1 addition & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,7 @@ for table_name in $(toml_get_table_names); do
cli_src=$(toml_get "$t" cli-source) || cli_src=$DEF_CLI_SRC
cli_ver=$(toml_get "$t" cli-version) || cli_ver=$DEF_CLI_VER

if [ "${SETPRE:-}" ]; then
if ! set_prebuilts "$integrations_src" "$patches_src" "$cli_src" "$integrations_ver" "$patches_ver" "$cli_ver"; then
abort "couldnt set prebuilts"
fi
else
if ! set_prebuilts "$integrations_src" "$patches_src" "$cli_src" "$integrations_ver" "$patches_ver" "$cli_ver"; then
if ! RVP="$(get_rv_prebuilts "$integrations_src" "$patches_src" "$integrations_ver" "$patches_ver" "$cli_src" "$cli_ver")"; then
abort "could not download rv prebuilts"
fi
Expand Down

0 comments on commit 52d3e9a

Please sign in to comment.