Daily update vLLM & vLLM-fork version #109
This file contains hidden or 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
| # Copyright (C) 2025 Intel Corporation | |
| # SPDX-License-Identifier: Apache-2.0 | |
| name: Daily update vLLM & vLLM-fork version | |
| permissions: read-all | |
| on: | |
| schedule: | |
| - cron: "30 22 * * *" | |
| workflow_dispatch: | |
| env: | |
| BRANCH_NAME: "update" | |
| USER_NAME: "CICD-at-OPEA" | |
| USER_EMAIL: "[email protected]" | |
| jobs: | |
| freeze-tag: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - repo: vLLM | |
| repo_name: vllm-project/vllm | |
| ver_name: VLLM_VER | |
| - repo: vLLM-fork | |
| repo_name: HabanaAI/vllm-fork | |
| ver_name: VLLM_FORK_VER | |
| fail-fast: false | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.ref }} | |
| - name: Set up Git | |
| run: | | |
| git config --global user.name ${{ env.USER_NAME }} | |
| git config --global user.email ${{ env.USER_EMAIL }} | |
| git remote set-url origin https://${{ env.USER_NAME }}:"${{ secrets.ACTION_TOKEN }}"@github.com/${{ github.repository }}.git | |
| git fetch | |
| if git ls-remote https://github.com/${{ github.repository }}.git "refs/heads/${{ env.BRANCH_NAME }}_${{ matrix.repo }}" | grep -q "refs/heads/${{ env.BRANCH_NAME }}_${{ matrix.repo }}"; then | |
| echo "branch ${{ env.BRANCH_NAME }}_${{ matrix.repo }} exists" | |
| git checkout ${{ env.BRANCH_NAME }}_${{ matrix.repo }} | |
| else | |
| echo "branch ${{ env.BRANCH_NAME }}_${{ matrix.repo }} not exists" | |
| git checkout -b ${{ env.BRANCH_NAME }}_${{ matrix.repo }} | |
| git push origin ${{ env.BRANCH_NAME }}_${{ matrix.repo }} | |
| echo "branch ${{ env.BRANCH_NAME }}_${{ matrix.repo }} created successfully" | |
| fi | |
| - name: Run script | |
| run: | | |
| latest_vllm_ver=$(curl -s "https://api.github.com/repos/${{ matrix.repo_name }}/tags" | jq '.[0].name' -) | |
| latest_vllm_ver=$(echo "$latest_vllm_ver" | sed 's/"//g') | |
| echo "latest_vllm_ver=${latest_vllm_ver}" >> "$GITHUB_ENV" | |
| find . -type f -name "*.sh" -exec sed -i "s/${{ matrix.ver_name }}=.*/${{ matrix.ver_name }}=${latest_vllm_ver}/" {} \; | |
| - name: Commit changes | |
| run: | | |
| git add . | |
| if git diff-index --quiet HEAD --; then | |
| echo "No changes detected, skipping commit." | |
| exit 1 | |
| else | |
| git commit -s -m "Update ${{ matrix.repo }} version to ${latest_vllm_ver}" | |
| git push --set-upstream origin ${{ env.BRANCH_NAME }}_${{ matrix.repo }} | |
| fi | |
| - name: Create Pull Request | |
| env: | |
| GH_TOKEN: ${{ secrets.ACTION_TOKEN }} | |
| run: | | |
| pr_url="$(gh pr list --head "${{ env.BRANCH_NAME }}_${{ matrix.repo }}" --state open --json url --jq .[].url)" | |
| if [[ -n "${pr_url}" ]]; then | |
| echo "Pull Request exists" | |
| gh pr edit ${pr_url} \ | |
| --title "Update ${{ matrix.repo }} version to ${latest_vllm_ver}" \ | |
| --body "Update ${{ matrix.repo }} version to ${latest_vllm_ver}" | |
| echo "Pull Request updated successfully" | |
| else | |
| echo "Pull Request does not exists..." | |
| gh pr create \ | |
| -B main \ | |
| -H ${{ env.BRANCH_NAME }}_${{ matrix.repo }} \ | |
| --title "Update ${{ matrix.repo }} version to ${latest_vllm_ver}" \ | |
| --body "Update ${{ matrix.repo }} version to ${latest_vllm_ver}" | |
| echo "Pull Request created successfully" | |
| fi |