Skip to content

Build pif

Build pif #1470

Workflow file for this run

name: Build pif
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: "*/30 * * * *"
jobs:
build:
runs-on: ubuntu-latest
outputs:
start_relase: ${{ steps.differencescheck.outputs.value }}
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
id: differencescheck
run: |
if git diff --exit-code custom.pif.json; then
echo "custom.pif.json is the same, no need to commit."
elif
git diff | grep -P '.*MANUFACTURER.*null.*'; then
echo "Something is wrong with the new custom.pif.json, not commit."
else
echo "value=build" >> "$GITHUB_OUTPUT"
echo "NOW=$(date +'%Y.%m.%d')" >> $GITHUB_ENV
cat custom.pif.json
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
fi
- name: 🔖 Create Github Release
uses: softprops/action-gh-release@v2
if: steps.differencescheck.outputs.value == 'build'
with:
tag_name: ${{ env.NOW }}
files: custom.pif.json
- name: 🔖 Upload artifact
uses: actions/upload-artifact@v4
if: steps.differencescheck.outputs.value == 'build'
with:
name: custom.pif.json
path: custom.pif.json