Repology metadata #166
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
fetch-depth: 0 | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install json tools | |
run: | | |
sudo apt update | |
sudo apt install -yq jq | |
- name: Clone TUR | |
run: | | |
mkdir -p /tmp/repos | |
git clone https://github.com/termux-user-repository/tur.git /tmp/repos/tur | |
git clone https://github.com/termux/termux-packages.git /tmp/repos/termux-packages | |
cp -r /tmp/repos/termux-packages/scripts /tmp/repos/tur/ | |
- name: Generate packages.json | |
run: | | |
export TERMUX_SCRIPTDIR=/tmp/repos/tur | |
bash ./generate-repology-metadata.sh /tmp/repos/tur > ./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 "TUR Github Actions" | |
git config --global user.email "[email protected]" | |
git add ./packages.json | |
git commit -m "Generate new metadata for Repology" | |
git push | |
fi |