forked from j-hc/revanced-magisk-module
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
222 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,67 @@ | ||
name: CI | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 16 * * *" | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Should build? | ||
id: should_build | ||
shell: bash | ||
run: | | ||
source utils.sh | ||
toml_prep "$(cat config.toml)" | ||
is_youtube_latest() { | ||
v=$(toml_get "YouTube" "version") || version="" | ||
if [ "$v" = latest ]; then | ||
declare -r cur_yt=$(sed -n 's/.*YouTube: \(.*\)/\1/p' build.md | xargs) | ||
[ -z "$cur_yt" ] && return 1 # empty, fail=>dont build | ||
declare -r last_ver=$(get_apk_vers "https://www.apkmirror.com/uploads/?appcategory=youtube" | get_largest_ver) | ||
echo "current yt version: $cur_yt" | ||
echo "latest yt version: $last_ver" | ||
[ "$cur_yt" != "$last_ver" ] # test success=>build, fail=>dont build | ||
else | ||
return 1 # not experimental, dont build | ||
fi | ||
} | ||
is_patches_latest() { | ||
declare -r last_patches_url=$(wget -nv --header="Authorization: token ${{ secrets.GITHUB_TOKEN }}" -O- https://api.github.com/repos/revanced/revanced-patches/releases/latest | json_get 'browser_download_url' | grep 'jar') | ||
declare -r last_patches=${last_patches_url##*/} | ||
cur_patches=$(sed -n 's/.*Patches: \(.*\)/\1/p' build.md | xargs) | ||
echo "current patches version: $cur_patches" | ||
echo "latest patches version: $last_patches" | ||
[ "$cur_patches" != "$last_patches" ] # test success=>build, fail=>dont build | ||
} | ||
if ! git checkout update; then | ||
echo "first time building!" | ||
echo "SHOULD_BUILD=1" >> $GITHUB_OUTPUT | ||
elif is_patches_latest || is_youtube_latest; then | ||
echo "build!" | ||
echo "SHOULD_BUILD=1" >> $GITHUB_OUTPUT | ||
else | ||
echo "dont build!" | ||
echo "SHOULD_BUILD=0" >> $GITHUB_OUTPUT | ||
fi | ||
outputs: | ||
SHOULD_BUILD: ${{ steps.should_build.outputs.SHOULD_BUILD }} | ||
|
||
build: | ||
needs: check | ||
uses: ./.github/workflows/build.yml | ||
if: ${{ needs.check.outputs.SHOULD_BUILD == 1 }} | ||
secrets: inherit | ||
name: CI | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 16 * * *" | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Should build? | ||
id: should_build | ||
shell: bash | ||
run: | | ||
source utils.sh | ||
toml_prep "$(cat config.toml)" | ||
is_youtube_latest() { | ||
v=$(toml_get "YouTube" "version") || version="" | ||
if [ "$v" = latest ]; then | ||
declare -r cur_yt=$(sed -n 's/.*YouTube: \(.*\)/\1/p' build.md | xargs) | ||
[ -z "$cur_yt" ] && return 1 # empty, fail=>dont build | ||
declare -r last_ver=$(get_apk_vers "https://www.apkmirror.com/uploads/?appcategory=youtube" | get_largest_ver) | ||
echo "current yt version: $cur_yt" | ||
echo "latest yt version: $last_ver" | ||
[ "$cur_yt" != "$last_ver" ] # test success=>build, fail=>dont build | ||
else | ||
return 1 # not experimental, dont build | ||
fi | ||
} | ||
is_patches_latest() { | ||
declare -r last_patches_url=$(wget -nv --header="Authorization: token ${{ secrets.GITHUB_TOKEN }}" -O- https://api.github.com/repos/revanced/revanced-patches/releases/latest | json_get 'browser_download_url' | grep 'jar') | ||
declare -r last_patches=${last_patches_url##*/} | ||
cur_patches=$(sed -n 's/.*Patches: \(.*\)/\1/p' build.md | xargs) | ||
echo "current patches version: $cur_patches" | ||
echo "latest patches version: $last_patches" | ||
[ "$cur_patches" != "$last_patches" ] # test success=>build, fail=>dont build | ||
} | ||
if ! git checkout update; then | ||
echo "first time building!" | ||
echo "SHOULD_BUILD=1" >> $GITHUB_OUTPUT | ||
elif is_patches_latest || is_youtube_latest; then | ||
echo "build!" | ||
echo "SHOULD_BUILD=1" >> $GITHUB_OUTPUT | ||
else | ||
echo "dont build!" | ||
echo "SHOULD_BUILD=0" >> $GITHUB_OUTPUT | ||
fi | ||
outputs: | ||
SHOULD_BUILD: ${{ steps.should_build.outputs.SHOULD_BUILD }} | ||
|
||
build: | ||
permissions: write-all | ||
needs: check | ||
uses: ./.github/workflows/build.yml | ||
if: ${{ needs.check.outputs.SHOULD_BUILD == 1 }} | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,43 @@ | ||
# Config | ||
|
||
Adding a new app is as easy as this: | ||
```toml | ||
[Some-App] | ||
apkmirror-dlurl = "https://www.apkmirror.com/apk/inc/app" # download url for the app. if not set, uptodown is used. | ||
``` | ||
|
||
## If you'd like to get to know more about other options: | ||
|
||
There exists an example below with all defaults and all the keys explicitly set. | ||
Almost all keys are optional and are assigned their default values if not set explicitly. | ||
|
||
```toml | ||
[Some-App] | ||
app-name = "SomeApp" # if set, app name becomes SomeApp instead of Some-App. default is same as table name. | ||
enabled = true # whether to build the app. default: true | ||
build-mode = "both" # 'both', 'apk' or 'module'. default: apk | ||
allow-alpha-version = false # allow downloading alpha versions from apkmirror. default: false | ||
rip-libs = false # removes all native libs from the app. default: false | ||
excluded-patches = "some-patch" # whitespace seperated list of patches to exclude. default: "" (empty) | ||
included-patches = "patch-name" # whitespace seperated list of patches to include. default: "" (empty) | ||
version = "auto" # 'auto', 'latest' or a custom one e.g. '17.40.41'. default: auto | ||
exclusive-patches = false # exclude all patches by default. default: false | ||
microg-patch = "microg-support" # name of the microg-patch if exists for the app. default: "" (empty) | ||
apkmirror-dlurl = "https://www.apkmirror.com/apk/inc/app" # download url for the app. if not set, uptodown is used. | ||
module-prop-name = "ytrv-magisk" # explicit magisk module prop name. not explicitly needed to be set. | ||
merge-integrations = true # whether to merge revanced integrations. default: false | ||
arch = "arm64-v8a" # 'arm64-v8a', 'arm-v7a' or 'all'. | ||
# this option is sometimes needed to be able to download the apks from apkmirror. default: all | ||
apkmirror-regex = 'APK</span>[^@]*@\([^#]*\)' # regex used to get the dl url in apkmirror. default: APK</span>[^@]*@\([^#]*\) | ||
# this default gets the url to the non-bundle apk. | ||
``` | ||
# Config | ||
|
||
Adding a new app is as easy as this: | ||
```toml | ||
[Some-App] | ||
apkmirror-dlurl = "https://www.apkmirror.com/apk/inc/app" # download url for the app. | ||
``` | ||
|
||
or: | ||
```toml | ||
[Some-App] | ||
uptodown-dlurl = "https://app.en.uptodown.com/android" # uptodown url. | ||
``` | ||
|
||
## If you'd like to get to know more about other options: | ||
|
||
There exists an example below with all defaults and all the keys explicitly set. | ||
Almost all keys are optional and are assigned their default values if not set explicitly. | ||
|
||
```toml | ||
[Some-App] | ||
app-name = "SomeApp" # if set, app name becomes SomeApp instead of Some-App. default is same as table name. | ||
# this affects the release name and stuff like that | ||
enabled = true # whether to build the app. default: true | ||
build-mode = "both" # 'both', 'apk' or 'module'. default: apk | ||
allow-alpha-version = false # allow downloading alpha versions from apkmirror. default: false | ||
rip-libs = false # removes all native libs from the app. default: false | ||
excluded-patches = "some-patch" # whitespace seperated list of patches to exclude. default: "" (empty) | ||
included-patches = "patch-name" # whitespace seperated list of patches to include. default: "" (empty) | ||
version = "auto" # 'auto', 'latest' or a custom one e.g. '17.40.41'. default: auto | ||
exclusive-patches = false # exclude all patches by default. default: false | ||
microg-patch = "microg-support" # name of the microg-patch if exists for the app. default: "" (empty) | ||
apkmirror-dlurl = "https://www.apkmirror.com/apk/inc/app" # download url. if not set, uptodown dl url is used. | ||
uptodown-dlurl = "https://spotify.en.uptodown.com/android" # uptodown url. if not set, apkmirror dl url is used. apkmirror is prioritized | ||
module-prop-name = "ytrv-magisk" # explicit magisk module prop name. not explicitly needed to be set. | ||
merge-integrations = true # whether to merge revanced integrations. default: false | ||
arch = "arm64-v8a" # 'arm64-v8a', 'arm-v7a' or 'all'. | ||
# this option is sometimes needed to be able to download the apks from apkmirror. default: all | ||
# and does not affect anything else | ||
|
||
apkmirror-regex = 'APK</span>[^@]*@\([^#]*\)' # regex used to get the dl url in apkmirror. default: APK</span>[^@]*@\([^#]*\) | ||
# this default gets the url to the non-bundle apk. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.