-
Notifications
You must be signed in to change notification settings - Fork 6
67 lines (59 loc) · 3.16 KB
/
update-ttnn-wheel.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Create PR with Dependency Update
on:
schedule:
- cron: '0 8 * * *' # Runs at 08:00 UTC every day
workflow_dispatch: # Manual trigger
jobs:
fetch-release-and-create-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: main
- name: Fetch Latest Pre-release from Another Repo
id: fetch_release
run: |
# Fetch the latest pre-release tag from the target repository
latest_pre_release=$(curl -s https://api.github.com/repos/tenstorrent/tt-metal/releases | jq -r '[.[] | select(.prerelease == true)][0].tag_name')
# Strip leading 'v' from the tag (e.g., v0.51.0 -> 0.51.0)
latest_version="${latest_pre_release#v}"
# Set the output using the new environment file
echo "release=$latest_version" >> $GITHUB_OUTPUT
- name: Update requirements.txt
id: update-requirements
run: |
latest_version=${{ steps.fetch_release.outputs.release }}
# Remove any existing ttnn lines (adjust the regex if needed)
sed -i '/^ttnn @ https:\/\/github\.com\/tenstorrent\/tt-metal\/releases\//d' requirements.txt
# Append the two lines for the different python versions.
echo "ttnn @ https://github.com/tenstorrent/tt-metal/releases/download/v${latest_version}/ttnn-$latest_version_short+any-cp38-cp38-linux_x86_64.whl ; python_version==\"3.8\"" >> requirements.txt
echo "ttnn @ https://github.com/tenstorrent/tt-metal/releases/download/v${latest_version}/ttnn-$latest_version_short+any-cp310-cp310-linux_x86_64.whl ; python_version==\"3.10\"" >> requirements.txt
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
id: create-pr
with:
branch: update-dependency
branch-suffix: timestamp
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: "Update dependencies to ${{ steps.fetch_release.outputs.release }}"
title: "Update TT-NN to ${{ steps.fetch_release.outputs.release }}"
body: "This PR updates TT-NN wheel to the latest pre-release version."
labels: ttnn-wheel-update
delete-branch: true
token: ${{ secrets.GH_TOKEN }}
- name: Approve Pull Request
if: ${{ steps.create-pr.outputs.pull-request-number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_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
- name: Enable Pull Request Automerge
if: ${{ steps.create-pr.outputs.pull-request-number }}
run: gh pr merge --merge --auto "${{ steps.create-pr.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}