diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml new file mode 100644 index 0000000..fad9ee6 --- /dev/null +++ b/.github/workflows/auto-release.yml @@ -0,0 +1,46 @@ +name: Auto release Revanced + +on: + push: + branches: [main] + +jobs: + auto-release-revanced: + name: Auto release Revanced + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup JDK + uses: actions/setup-java@v3 + with: + distribution: zulu + java-version: 17 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + - run: pip install -r requirements.txt + + - name: Auto build Revanced + run: python auto-build.py + + - name: Set current date as env variable + run: echo "date_now=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + + - name: Auto release Revanced + uses: softprops/action-gh-release@v0.1.15 + with: + prerelease: false + name: ${{ env.date_now }} + tag_name: ${{ env.date_now }} + generate_release_notes: true + files: | + build/*.apk + revanced-tools/microg.apk \ No newline at end of file diff --git a/.github/workflows/experimental.yml b/.github/workflows/experimental.yml deleted file mode 100644 index dd92e56..0000000 --- a/.github/workflows/experimental.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: ReVanced Experimental Build - -on: - workflow_dispatch: - -permissions: - contents: write - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Setup Java JDK - uses: actions/setup-java@v3.10.0 - with: - java-version: "17" - distribution: "zulu" - - - name: Download APKs from APKMirror - run: ./download_apkmirror.sh - - - name: Build APKs, force patches on untested YouTube versions - run: ./build_revanced.sh experimental - - - name: Set current date as env variable - run: echo "date_now=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - - - uses: marvinpinto/action-automatic-releases@latest - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest" - draft: true - title: "Release ${{ env.date_now }}" - files: | - build/*.apk - vanced-microG.apk diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 8faa456..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: ReVanced Build - -on: - workflow_dispatch: - -permissions: - contents: write - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Setup Java JDK - uses: actions/setup-java@v3.10.0 - with: - java-version: "17" - distribution: "zulu" - - - name: Download APKs from APKMirror - run: ./download_apkmirror.sh - - - name: Build APKs - run: ./build_revanced.sh - - - name: Set current date as env variable - run: echo "date_now=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - - - uses: marvinpinto/action-automatic-releases@latest - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest" - draft: true - title: "Release ${{ env.date_now }}" - files: | - build/*.apk - vanced-microG.apk diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 9a6f5cc..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: ReVanced Test Build - -on: - push: - branches: [main] - pull_request: - branches: [main] -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Setup Java JDK - uses: actions/setup-java@v3.10.0 - with: - java-version: "17" - distribution: "zulu" - - - name: Download APKs from APKMirror - run: ./download_apkmirror.sh - - - name: Test Build APKs - run: | - ./build_revanced.sh - for filename in build/*.apk; do - if [ -e "$filename" ]; then - printf '"%s" exists\n' "$filename" - else - echo "APK build failed" - exit 1 - fi - done - rm -rf build diff --git a/.gitignore b/.gitignore index 096edb2..466b44e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,9 @@ -*.apk -*.jar -apkeep -*.dex -revanced-cache/ +# Folders +.venv/ build/ -.editorconfig -patches.txt -.vscode/ +downloaded/ +revanced-cache/ +revanced-tools/ + +# Files +options.json \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index 0859dab..0000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,30 +0,0 @@ -# See https://pre-commit.com for more information -# See https://pre-commit.com/hooks.html for more hooks ---- -# fail_fast: true -minimum_pre_commit_version: 1.18.1 -repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.3.0 - hooks: - - id: trailing-whitespace - exclude: ".(md|rst)$" - - id: end-of-file-fixer - - id: check-merge-conflict - - id: mixed-line-ending - - id: check-added-large-files - - repo: https://github.com/jumanjihouse/pre-commit-hooks - rev: 2.1.5 - hooks: - - id: git-check # Configure in .gitattributes - - id: shellcheck - exclude: ".bats$" - args: [ "-e", "SC2068" ] - - id: shfmt - exclude: ".bats$" - args: ["-i", "4"] - - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.1.7 - hooks: - - id: remove-crlf - exclude: ".bat$" diff --git a/PATCHES_GUIDE.md b/PATCHES_GUIDE.md deleted file mode 100644 index 4297dd8..0000000 --- a/PATCHES_GUIDE.md +++ /dev/null @@ -1,47 +0,0 @@ -# Customizing ReVanced Builds - -**Please read the following information before beginning.** - -By default the script will build ReVanced with ALL default* patches. Edit `patches.txt` to customize your build of ReVanced. - -*Default: All patches except those which have to be ***included*** explicitly, i.e, using the `-i` flag while manually using the ReVanced CLI - -## !IMPORTANT! -1. Each patch name MUST start from a NEWLINE AND there should be only ONE patch PER LINE -2. DO NOT add any other type of symbol or character, it will break the script! You have been warned! -3. Anything starting with a hash (`#`) will be ignored. Also, do not add hash or any other character after a patch's name -4. Both YT Music ReVanced & YT ReVanced are supported -5. DO NOT add `microg-patch` to the list of excluding patches. -6. `patches.txt` contains some predefined lines starting with `#`. DO NOT remove them. - -## Example -Example content of `patches.txt`: - -- Exclude pure black theme and keep `create` button: -``` -amoled -disable-create-button -``` - -- Exclude patches for both Music & YouTube (order doesn't matter) -``` -amoled -exclusive-background-playback -disable-create-button -premium-heading -tasteBuilder-remover -``` - -- Include patches for both Music & YouTube (order doesn't matter) -``` -compact-header -hdr-auto-brightness -autorepeat-by-default -enable-debugging -force-vp9-codec -enable-wide-searchbar -``` - -## List of Available Patches - -Refer to Official ReVanced [list of available patches](https://github.com/revanced/revanced-patches#-patches). diff --git a/README.md b/README.md index 2431ae5..f87d784 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,67 @@ -# Revanced Build -This repo template will allow you to build ReVanced using Github Actions. This will helps people who don't want to setup build environments on their machines. +# Revanced Auto Build +[![Auto release Revanced](https://github.com/hardingadonis/revanced-auto-build/actions/workflows/auto-release.yml/badge.svg)](https://github.com/hardingadonis/revanced-auto-build/actions/workflows/auto-release.yml) +[![Repository size](https://img.shields.io/github/repo-size/hardingadonis/revanced-auto-build)](https://github.com/hardingadonis/revanced-auto-build) -## Notes -- The script will download the **selected compatible version**([see here](versions.json)) of Youtube on APKMirror, **NOT** latest official version on Google Play. -- Under **NO CIRCUMSTANCES** any APKs will be uploaded to this repository to avoid DMCA. +> Auto build *Revanced (non-root)* for individual with GitHub Actions 😎😎 -## How to setup -1. Fork or create a new repository using this repository as a template ([Guide](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template)). DO NOT FORK if you need to set the new repo to private. -2. That's it! You can now build ReVanced using Github Actions. +## Requirements +- OS: Windows, MacOS or Linux. +- Tools: + - Python >= 3.10 + - JDK >= 17 -## Customize your build -If you wish to continue with the default settings, you may skip this step. +## Setup +- Step 1: Clone this repository +```shell +git clone https://github.com/hardingadonis/revanced-auto-build.git +cd revanced-auto-build +``` +- Step 2: Install **virtualenv** +```shell +pip install virtualenv +``` +- Step 3: Install Python libraries +```shell +virtualenv .venv +".venv/Scripts/activate" +pip install -r requirements.txt +``` +- Step 4: Run Python script +```shell +python auto-build.py +``` -All supported ReVanced apps are built by default by the script. If you wish to modify this behaviour and build only the apps that you specify, edit the 'build.targets' file with your preferred text editor. For the apps that you wish to be built, set the value of variable associated with the app to "true". Any variable with a value that is not "true" will be skip the associated app from being built. +## Development +> Just for those who want to build more Revanced apps. -For example, if you wish to skip TikTok ReVanced from being built, change the value of TIKTOK_NONROOT to "false". +List all apps that Revanced support: [link](https://github.com/revanced/revanced-patches). -By default this will build ReVanced apps with ALL available patches. Follow [this guide](PATCHES_GUIDE.md) to exclude/customizing patches for your build. +To add more app for building, check [packages.yml](packages.yml) -## How to build -1. Go to Actions -> All workflows -> ReVanced Build ([Example](images/workflow_run.png)) -2. Run the `build` workflow (try to use `experimental_build` if the logs show not all patches applied correctly while revanced is not yet released) -3. Download the APKs from the draft releases ([Example](images/build_release.png)) +Template: +```yaml +: + - version: + - uptodown: + - exclude_options: + -