generated from j-hc/revanced-magisk-module
-
Notifications
You must be signed in to change notification settings - Fork 81
executable file
·49 lines (44 loc) · 1.3 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: CI
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
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 "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 == 1 }}
secrets: inherit