-
Notifications
You must be signed in to change notification settings - Fork 32
44 lines (40 loc) · 1.43 KB
/
repology_metadata.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
name: Repology metadata
on:
schedule:
- cron: '0 */6 * * *'
workflow_dispatch:
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Clone termux-packages
run: |
mkdir -p /tmp/repos
git clone https://github.com/termux/termux-packages.git /tmp/repos/termux-packages
- name: Generate packages.json
run: |
export TERMUX_SCRIPTDIR=/tmp/repos/termux-packages
pushd /tmp/repos/termux-packages
# Speed up git log by significant amount
# See: https://stackoverflow.com/questions/35186829/how-to-improve-git-log-performance
git config core.commitGraph true
git config gc.writeCommitGraph true
git repack -Ad --max-pack-size=1g
git commit-graph write --changed-paths --reachable
popd
bash ./generate-repology-metadata.sh /tmp/repos/termux-packages > ./packages.json
if ! jq . ./packages.json > /dev/null; then
echo "Error: invalid packages.json" > /dev/stderr
exit 1
fi
if [ $(git diff ./packages.json | wc -l) -gt 0 ]; then
git config --global user.name "Termux Github Actions"
git config --global user.email "[email protected]"
git add ./packages.json
git commit -m "Generate new metadata for Repology"
git push
fi