Merge pull request #238 from nikhilbadyal/new-apps

 Check new supported apps
This commit is contained in:
Nikhil Badyal
2023-08-05 20:13:53 +05:30
committed by GitHub
7 changed files with 83 additions and 40 deletions
+2 -2
View File
@@ -64,7 +64,7 @@ jobs:
steps:
- name: Download Already Built APKs
uses: actions/download-artifact@v3
uses: actions/download-artifact@main
with:
name: Built-APKs
- name: Get Date
@@ -80,7 +80,7 @@ jobs:
RELEASE_PATTERN: "Build*"
- name: Upload Build Artifact
uses: ncipollo/release-action@v1.12.0
uses: ncipollo/release-action@main
with:
artifacts: "*-output.apk"
token: ${{ secrets.GITHUB_TOKEN }}
+4 -4
View File
@@ -38,7 +38,7 @@ jobs:
steps:
- name: Check out Git repository
uses: actions/checkout@v3.5.3
uses: actions/checkout@main
- name: Update Env for custom build
run: |
@@ -77,7 +77,7 @@ jobs:
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
uses: mxschmitt/action-tmate@master
if: ${{ github.event_name == 'workflow_dispatch' && inputs.DEBUG_ENABLED }}
- name: Build Revanced APKs
@@ -85,7 +85,7 @@ jobs:
docker-compose up --build
- name: Upload Build APKS
uses: actions/upload-artifact@v3.1.2
uses: actions/upload-artifact@main
with:
name: Built-APKs
path: |
@@ -95,7 +95,7 @@ jobs:
- name: Commit Update file
if: ${{ inputs.COMMIT_CHANGELOG }}
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@master
with:
branch: changelogs
skip_checkout: true
-34
View File
@@ -1,34 +0,0 @@
name: CodeQL Analysis
on:
workflow_dispatch:
jobs:
analyze:
if: github.repository == 'nikhilbadyal/docker-py-revanced'
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'python' ]
steps:
- name: Checkout repository
uses: actions/checkout@v3.5.3
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
+41
View File
@@ -0,0 +1,41 @@
name: Check for new apps
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
status_check:
if: github.repository == 'nikhilbadyal/docker-py-revanced'
runs-on: ubuntu-latest
steps:
- name: checkout repo content
uses: actions/checkout@main
- name: setup python
uses: actions/setup-python@main
with:
python-version: '3.10'
- name: install python packages
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Execute Status Check
run: |
output=$(python -m scripts.status_check)
echo "changelog=$output" >>$GITHUB_OUTPUT
id: status
- name: Update Check
run: echo "${{ steps.status.outputs.changelog }}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5.0.2
with:
token: ${{ secrets.GH_TOKEN }}
branch: revanced-update/status-check
title: Revanced apps
commit-message: revanced-app
body: ${{ steps.status.outputs.changelog }}
View File
+31
View File
@@ -0,0 +1,31 @@
"""Status check."""
import requests
from src.patches import Patches
from src.utils import handle_response
def main() -> None:
repo_url = "https://api.revanced.app/v2/patches/latest"
response = requests.get(repo_url)
handle_response(response)
parsed_data = response.json()
compatible_packages = parsed_data["patches"]
possible_apps = set()
for package in compatible_packages:
for compatible_package in package["compatiblePackages"]:
possible_apps.add(compatible_package["name"])
supported_app = set(Patches.support_app().keys())
missing_support = possible_apps.difference(supported_app)
output = "New app found which aren't supported yet.<br>"
for index, app in enumerate(missing_support):
output += f"{index+1}. [{app}](https://play.google.com/store/apps/details?id={app})<br>"
print(output)
if __name__ == "__main__":
main()
+5
View File
@@ -64,6 +64,11 @@ class Patches(object):
key: (value, "_" + value) for key, value in _revanced_extended_app_ids.items()
}
@staticmethod
def support_app() -> Dict[str, str]:
"""Return supported apps."""
return Patches._revanced_app_ids
@staticmethod
def check_java(dry_run: bool) -> None:
"""Check if Java17 is installed."""