mirror of
https://github.com/Nezumi-2711/revanced-apk-build.git
synced 2026-09-22 20:02:00 +00:00
51 lines
1.3 KiB
YAML
Executable File
51 lines
1.3 KiB
YAML
Executable File
name: CI
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: "0 16 * * *"
|
|
|
|
jobs:
|
|
check:
|
|
permissions: write-all
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Should build?
|
|
id: should_build
|
|
shell: bash
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
if ! git checkout origin/update build.md; then
|
|
echo "first time building!"
|
|
echo "SHOULD_BUILD=1" >> $GITHUB_OUTPUT
|
|
else
|
|
UPDATE_CFG=$(./build.sh config.toml --config-update)
|
|
if [ "$UPDATE_CFG" ]; then
|
|
echo "'$UPDATE_CFG'"
|
|
echo "SHOULD_BUILD=1" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "SHOULD_BUILD=0" >> $GITHUB_OUTPUT
|
|
fi
|
|
fi
|
|
|
|
- name: Clear older runs
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
gh run list -L400 --json databaseId -q '.[].databaseId' | tail -n+10 | xargs -IID gh api "repos/$GITHUB_REPOSITORY/actions/runs/ID" -X DELETE || :
|
|
|
|
outputs:
|
|
SHOULD_BUILD: ${{ steps.should_build.outputs.SHOULD_BUILD }}
|
|
|
|
build:
|
|
permissions: write-all
|
|
needs: check
|
|
uses: ./.github/workflows/build.yml
|
|
if: ${{ needs.check.outputs.SHOULD_BUILD == 0 }}
|
|
secrets: inherit
|