Check LLVM Releases #1257
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: Check LLVM Releases | |
on: | |
schedule: | |
- cron: '0 * * * *' # Run at the start of every hour | |
workflow_dispatch: # Allow manual triggering | |
jobs: | |
check-llvm-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check for new LLVM release | |
id: check-release | |
run: | | |
# Fetch the latest release tag from LLVM | |
LATEST_TAG=$(curl -s https://api.github.com/repos/llvm/llvm-project/releases/latest | jq -r .tag_name) | |
LATEST_VERSION=${LATEST_TAG#llvmorg-} | |
# Fetch the latest release tag from this repository | |
CURRENT_TAG=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name) | |
CURRENT_VERSION=${CURRENT_TAG#v} | |
echo "Latest LLVM version: $LATEST_VERSION" | |
echo "Current version: $CURRENT_VERSION" | |
if [ "$LATEST_VERSION" != "$CURRENT_VERSION" ]; then | |
echo "new_version=$LATEST_VERSION" >> $GITHUB_OUTPUT | |
echo "update_needed=true" >> $GITHUB_OUTPUT | |
else | |
echo "update_needed=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Trigger build workflow | |
if: steps.check-release.outputs.update_needed == 'true' | |
uses: peter-evans/repository-dispatch@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
event-type: update-llvm-version | |
client-payload: '{"version": "${{ steps.check-release.outputs.new_version }}"}' |