-
Notifications
You must be signed in to change notification settings - Fork 55
74 lines (64 loc) · 2.33 KB
/
update_protos.yml
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
68
69
70
71
72
73
74
name: Update Protos + Open PR
on:
workflow_dispatch:
repository_dispatch:
types:
- protos-updated
jobs:
update-protos:
if: github.repository_owner == 'viamrobotics'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.REPO_READ_TOKEN }}
- uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: "29.2"
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: prune origin
run: git remote prune origin
- name: Setup Python
run: uv python install
- name: Store API version
run: |
uv run python3 etc/_update_version_metadata.py src/viam/version_metadata.py ${{ github.event.client_payload.tag }}
echo "Updated API version to ${{ github.event.client_payload.tag }} in src/viam/version_metadata.py"
- name: Generate buf
run: uv run make buf
env:
BUF_TOKEN: ${{ secrets.BUF_TOKEN }}
- name: Format
run: uv run make format
- name: Add + Commit + Open PR
id: cpr
uses: peter-evans/create-pull-request@v7
with:
commit-message: '[WORKFLOW] Updating protos from ${{ github.event.client_payload.repo_name }}, commit: ${{ github.event.client_payload.sha }}'
branch: 'workflow/update-proto'
delete-branch: true
base: main
title: Automated Protos Update
body: This is an auto-generated PR to update proto definitions. Check the commits to see which repos and commits are responsible for the changes
assignees: njooma
reviewers: njooma
token: ${{ secrets.GIT_ACCESS_TOKEN }}
- name: Notify slack of failure
uses: slackapi/[email protected]
if: ${{ failure() }}
with:
payload: |
{
"text": "Python SDK update protos job has failed",
"username": "Python SDK",
"icon_url": "https://media.tenor.com/bZMubztJxGkAAAAe/charlie-brown-walking-charlie-brown.png"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TEAM_SDK_WEBHOOK_URL }}