Skip to content

Commit 703deb2

Browse files
authored
Add API workflow user input (#1015)
1 parent 4753880 commit 703deb2

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ jobs:
3535
uses: actions/checkout@v4
3636

3737
- name: Install uv
38-
uses: astral-sh/setup-uv@v3
39-
40-
- name: Setup Python
41-
run: uv python install 3.12
38+
uses: astral-sh/setup-uv@v7
39+
with:
40+
python-version: "3.12"
4241

4342
- name: Install Package
4443
run: uv sync --all-extras

.github/workflows/update_protos.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: Update Protos + Open PR
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
api_version:
7+
description: "The API version, including the `v`"
8+
type: string
9+
required: true
510
repository_dispatch:
611
types:
712
- protos-updated
@@ -27,6 +32,16 @@ jobs:
2732
python-version: "3.13"
2833
enable-cache: true
2934

35+
- name: API Version - Repository Dispatch
36+
if: github.event.client_payload.tag != ''
37+
run: |
38+
echo "API_VERSION=${{github.event.client_payload.tag}}" >> $GITHUB_ENV
39+
40+
- name: API Version - User Input
41+
if: inputs.api_version != ''
42+
run: |
43+
echo "API_VERSION=${{inputs.api_version}}" >> $GITHUB_ENV
44+
3045
- name: prune origin
3146
run: git remote prune origin
3247

@@ -35,8 +50,8 @@ jobs:
3550

3651
- name: Store API version
3752
run: |
38-
uv run python3 etc/_update_version_metadata.py src/viam/version_metadata.py ${{ github.event.client_payload.tag }}
39-
echo "Updated API version to ${{ github.event.client_payload.tag }} in src/viam/version_metadata.py"
53+
uv run python3 etc/_update_version_metadata.py src/viam/version_metadata.py ${{ env.API_VERSION }}
54+
echo "Updated API version to ${{ env.API_VERSION }} in src/viam/version_metadata.py"
4055
4156
- name: Generate buf
4257
run: uv run make buf

0 commit comments

Comments
 (0)