Get latest release version #3750
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: Get latest release version | |
on: | |
schedule: | |
- cron: '0 */3 * * *' | |
workflow_dispatch: | |
jobs: | |
get-version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.REPO_SCOPED_TOKEN }} | |
- name: Fetch yt-dlp release version | |
run: | | |
curl -sL https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest | \ | |
jq -r ".tag_name" > dependency-versions/yt-dlp-latest.txt | |
- name: Fetch aria2c release version | |
run: | | |
curl -sL https://api.github.com/repos/aria2/aria2/releases/latest | \ | |
jq -r ".tag_name" | \ | |
sed 's/release-//' > dependency-versions/aria2-latest.txt | |
- name: Fetch libwebp release version | |
run: | | |
curl -sL 'https://chromium.googlesource.com/webm/libwebp/+refs?format=JSON' | \ | |
tail -n +2 | \ | |
jq -r 'keys' | \ | |
grep 'refs/tags' | \ | |
grep -v '\-rc' | \ | |
tail -1 | \ | |
xargs echo | \ | |
sed 's/refs\/tags\///' | \ | |
sed 's/,//' | \ | |
sed 's/v//' > dependency-versions/libwebp-latest.txt | |
- name: Check for modified files | |
id: git-check | |
run: echo modified=$([ -z "`git status --porcelain`" ] && echo "false" || echo "true") >> $GITHUB_OUTPUT | |
- name: Commit latest release version | |
if: steps.git-check.outputs.modified == 'true' | |
run: | | |
git config --global user.name 'Andy Huang' | |
git config --global user.email '[email protected]' | |
git commit -am "New release version" | |
git push |