Nighty Uplift #82
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
# This workflow automates creation of uplift pull requests. | |
# Uplift PR is created daily to uplift the submodule to the latest version. | |
name: Nighty Uplift | |
on: | |
schedule: | |
- cron: '0 6 * * *' # Runs at 06:00 UTC every day | |
workflow_dispatch: # Manual trigger | |
jobs: | |
uplift-pr: | |
runs-on: ubuntu-latest | |
env: | |
TT_METAL_SUBMODULE_PATH: third_party/tt-metal | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
ref: main | |
- name: Set env variable for today's date | |
run: | | |
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | |
- name: Fetch latest SHA of tt-metal submodule | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
LATEST_TT_METAL_VERSION=$(gh api repos/tenstorrent/tt-metal/commits/main --jq '.sha') | |
echo "LATEST_TT_METAL_VERSION=$LATEST_TT_METAL_VERSION" >> $GITHUB_ENV | |
- name: Update tt-metal reference in third_party/CMakeLists.txt | |
run: | | |
echo "Updating tt-metal to SHA: ${{ env.LATEST_TT_METAL_VERSION }}" | |
sed -i "s/set(TT_METAL_VERSION \".*\")/set(TT_METAL_VERSION \"${{ env.LATEST_TT_METAL_VERSION }}\")/" third_party/CMakeLists.txt | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v7 | |
id: create-pr | |
with: | |
branch: uplift | |
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | |
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com> | |
base: main | |
commit-message: "Uplift ${{ env.TT_METAL_SUBMODULE_PATH }} to ${{ env.LATEST_TT_METAL_VERSION }} ${{ env.TODAY }}" | |
title: "Uplift ${{ env.TT_METAL_SUBMODULE_PATH }} to ${{ env.LATEST_TT_METAL_VERSION }} ${{ env.TODAY }}" | |
body: "This PR uplifts the ${{ env.TT_METAL_SUBMODULE_PATH }} to the ${{ env.LATEST_TT_METAL_VERSION }}" | |
labels: uplift | |
delete-branch: true | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Approve Pull Request | |
if: ${{ steps.create-pr.outputs.pull-request-number }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_APPROVE_TOKEN }} | |
run: | | |
echo "Pull Request Number - ${{ steps.create-pr.outputs.pull-request-number }}" | |
echo "Pull Request URL - ${{ steps.create-pr.outputs.pull-request-url }}" | |
gh pr review ${{ steps.create-pr.outputs.pull-request-number }} --approve | |
# Note: Dissable auto-merge for now until we are more confident | |
# that uplift won't break the downstream projects | |
# | |
# - name: Enable Pull Request Automerge | |
# if: ${{ steps.create-pr.outputs.pull-request-number }} | |
# run: gh pr merge --squash --auto "${{ steps.create-pr.outputs.pull-request-number }}" | |
# env: | |
# GH_TOKEN: ${{ secrets.GH_TOKEN }} |