n0k0m3 / revanced-build-template

Github Template for building Revanced
GNU General Public License v3.0
139 stars 154 forks source link

Does this always pull the latest revanced patch ? #57

Open casual-coderr opened 1 year ago

casual-coderr commented 1 year ago

Hi, I am sort of new and i don't actually understand how this script always get the latest revanced patch from their repo

get_artifact_download_url() {
    # Usage: get_download_url <repo_name> <artifact_name> <file_type>
    local api_url result
    api_url="https://api.github.com/repos/$1/releases/latest"
    # shellcheck disable=SC2086
    result=$(curl -s $api_url | jq ".assets[] | select(.name | contains(\"$2\") and contains(\"$3\") and (contains(\".sig\") | not)) | .browser_download_url")
    echo "${result:1:-1}"
}

When i run this in actions, It would be helpful to display the version of the artifacts being downloaded instead of showing

Downloading revanced-patches.jar
Downloading revanced-integrations.apk
Downloading revanced-cli.jar

Better show

Downloading revanced-patches-(2.42.0).jar
Downloading revanced-integrations-(0.36.0).apk
Downloading revanced-cli-(2.9.3).jar

in the Runtime

n0k0m3 commented 1 year ago

https://api.github.com/repos/<repo-path>/releases/latest is the latest release endpoints of github so it guarantees to download latest patches. I won't do the echoes that you exampled as the file name needs to be constant for the scripts to run, but I can try to print st like Downloading revanced-patches.jar ver x.y.z

casual-coderr commented 1 year ago

@n0k0m3 Thanks for the explanation for the api. I like your implementation as well, because any kind of intimation of version number will be useful.