CI: test automatic README.md updating #5
Workflow file for this run
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: "Update README daily" | |
on: | |
push: | |
# schedule: | |
# - cron: "33 3 * * *" | |
# workflow_dispatch: | |
jobs: | |
update_readme: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install prereqs | |
run: pip install -U yq | |
- name: Get local package versions | |
shell: bash | |
run: | | |
cd recipes | |
find * -maxdepth 1 -name config.yml | sort | while read f; do pkg=$(dirname "$f"); yq --raw-output '.versions | "'"$pkg/"'" + keys_unsorted[]' $f | sort; done | tee valgur.list | |
- name: Checkout upstream | |
run: | | |
git remote add upstream https://github.com/conan-io/conan-center-index.git | |
git fetch upstream | |
git checkout upstream/master | |
- name: Get upstream package versions | |
shell: bash | |
run: | | |
cd recipes | |
find * -maxdepth 1 -name config.yml | sort | while read f; do pkg=$(dirname "$f"); yq --raw-output '.versions | "'"$pkg/"'" + keys_unsorted[]' $f | sort; done | tee conan-io.list | |
- name: Compare package versions | |
run: comm -13 conan-io.list valgur.list | tee diff.list | |
- name: Update README | |
run: | | |
cd .. | |
# Replace <date> with today's date and <versions> with the diff | |
sed "s/<date>/$(date +%Y-%m-%d)/" .github/README_TEMPLATE.md | sed "/<versions>/r recipes/diff.list" | sed "/<versions>/d" > README.md | |
cat README.md |