Skip to content

Prebuilt APKs updater #31

Prebuilt APKs updater

Prebuilt APKs updater #31

Workflow file for this run

name: Prebuilt APKs updater
on:
workflow_dispatch:
schedule:
- cron: "0 3 * * 0" # Run every Sunday at 9 AM IST (3:30 AM UTC)
jobs:
update-apps:
runs-on: ubuntu-latest
env:
ACCESS_TOKEN: ${{ secrets.TOKEN }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: "adopt"
java-version: "11"
- name: Download DotGallery APK
uses: robinraju/[email protected]
with:
repository: "IacobIonut01/Gallery"
latest: true
fileName: "*.apk"
- name: Move APKs
run: |
rm -f *nomaps*.apk
mv Gallery*.apk DotGallery/DotGallery.apk
- name: Download latest release .zip
uses: robinraju/[email protected]
with:
repository: "chenxiaolong/BCR"
latest: true
fileName: BCR*.zip
- name: Extract BCR*.zip
run: unzip BCR*.zip -d extracted
- name: Move app-release.apk to BCR directory
run: |
shopt -s nullglob
mv extracted/system/priv-app/com.chiller3.bcr/app-release.apk BCR/ || true
- name: Rename BCR.apk
run: mv BCR/app-release.apk BCR/BCR.apk
- name: Clean up
run: rm -rf BCR*.zip extracted/
- name: Check for Updated Apps
id: check_updates
run: |
CHANGED_FILES=$(git diff --name-only)
UPDATED_APPS=""
if echo "$CHANGED_FILES" | grep -q "DotGallery"; then
UPDATED_APPS+="DotGallery, "
fi
if echo "$CHANGED_FILES" | grep -q "BCR"; then
UPDATED_APPS+="BCR, "
fi
if [ -n "$UPDATED_APPS" ]; then
echo "UPDATED_APPS=$UPDATED_APPS" >> $GITHUB_ENV
else
echo "No apps updated, skipping further steps."
exit 0
fi
- name: Commit Changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "TheDroidxBot"
curl -sL "https://raw.githubusercontent.com/hipexscape/Scripts/tsm/commit_id.sh" | bash
if [ -n "$(git status --porcelain)" ]; then
UPDATED_APPS=$(echo $UPDATED_APPS | sed 's/,$//')
git add .
git commit -sm "prebuilts: Incorporate latest $UPDATED_APPS improvements"
else
echo "No changes to commit."
fi
- name: Push Changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ env.ACCESS_TOKEN }}