Skip to content

Build pif

Build pif #3993

Workflow file for this run

name: Build pif
on:
push:
branches: [ "main" ]
schedule:
- cron: "*/30 * * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install apktool
run: sudo apt-get install -y apktool
- name: Grant execute permission for script
run: chmod +x pif.sh
- name: Generate JSON file
run: ./pif.sh
- name: Check differences in custom.pif.json
run: |
if git diff --exit-code custom.pif.json; then
echo "custom.pif.json is the same, no need to commit."
echo "value=none" >> $GITHUB_ENV
elif git diff | grep -v '"FIRST_API_LEVEL": "null"' | grep '"null"'; then
echo "Something is wrong with the new custom.pif.json, not committing."
echo "status=error" >> $GITHUB_ENV
else
echo "status=build" >> $GITHUB_ENV
fi
- name: Update custom.pif.json
if: env.status == 'build'
run: |
echo "date=$(date +'%Y.%m.%d')" >> $GITHUB_ENV
git config --global user.name "tzagim"
git config --global user.email "[email protected]"
git add custom.pif.json
git commit -m "Update custom.pif.json"
git push
- name: 🔖 Create GitHub Release
uses: softprops/action-gh-release@v2
if: env.status == 'build'
with:
tag_name: ${{ env.date }}
files: custom.pif.json
- name: 🔖 Upload artifact
uses: actions/upload-artifact@v4
if: env.status == 'build'
with:
name: custom.pif.json
path: custom.pif.json
- name: Prevent workflow deactivation
uses: gautamkrishnar/keepalive-workflow@v2
with:
committer_username: "tzagim"
committer_email: "[email protected]"