Prebuilt APKs updater #59
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
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: Install Git LFS | |
run: git lfs install | |
- name: Download DotGallery APK | |
uses: robinraju/release-downloader@v1.8 | |
with: | |
repository: "IacobIonut01/Gallery" | |
latest: true | |
fileName: "*.apk" | |
- name: Move APKs | |
run: | | |
rm -f *nomaps*.apk | |
rm -f $(ls Gallery*.apk | grep -v "universal") | |
mv -f Gallery*.apk DotGallery/DotGallery.apk | |
- name: Download latest release .zip | |
uses: robinraju/release-downloader@v1.8 | |
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 -f extracted/system/priv-app/com.chiller3.bcr/app-release.apk BCR/ || true | |
- name: Rename BCR.apk | |
run: mv -f 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: Track APKs using Git LFS | |
run: | | |
find . -type f -name "*.apk" -exec git lfs track {} \; | |
git add .gitattributes | |
git lfs ls-files | |
- name: Commit Changes | |
run: | | |
git config --local user.email "droidxuibot@gmail.com" | |
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 }} |