Skip to content

Commit 345c132

Browse files
authored
New release workflow (#283)
1 parent 879e95f commit 345c132

File tree

5 files changed

+30
-15
lines changed

5 files changed

+30
-15
lines changed

.github/workflows/release.yml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ jobs:
2525
container:
2626
image: ghcr.io/viamrobotics/canon:amd64
2727
outputs:
28-
sha: ${{ steps.commit.outputs.commit_long_sha }}
2928
version: ${{ steps.bump_version.outputs.version }}
3029
steps:
3130
- name: Check if organization member
@@ -36,20 +35,18 @@ jobs:
3635
username: ${{ github.actor }}
3736
token: ${{ secrets.GITHUB_TOKEN }}
3837

39-
- name: cancelling
38+
- name: Cancelling - user not part of organization
4039
uses: andymckay/cancel-action@0.2
4140
if: |
4241
steps.is_organization_member.outputs.result == 'false'
4342
4443
- name: Checkout Code
4544
uses: actions/checkout@v3
46-
with:
47-
token: ${{ secrets.REPO_READ_TOKEN }}
4845

4946
- name: Install Poetry
5047
uses: snok/install-poetry@v1
5148

52-
- name: Install package
49+
- name: Install Package
5350
run: poetry install
5451

5552
- name: Clean Format Test
@@ -60,14 +57,31 @@ jobs:
6057
run: |
6158
poetry version ${{ inputs.version }}
6259
echo "SDK_VERSION=$(poetry version -s)" >> $GITHUB_ENV
63-
echo "::set-output name=version::$(poetry version -s)"
60+
echo "version=$(poetry version -s)" >> $GITHUB_OUTPUT
61+
62+
- name: Check if release exists
63+
uses: cardinalby/git-get-release-action@1.2.4
64+
id: release_exists
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
with:
68+
releaseName: v${{ env.SDK_VERSION }}
69+
doNotFailIfNotFound: 'true'
70+
71+
- name: Cancelling - release already exists
72+
uses: andymckay/cancel-action@0.2
73+
if: |
74+
steps.release_exists.outputs.id != ''
6475
65-
- name: Commit + Push
66-
id: commit
67-
uses: EndBug/add-and-commit@v9.0.0
76+
- name: Add + Commit + Open PR
77+
uses: peter-evans/create-pull-request@v5
6878
with:
69-
default_author: github_actions
70-
message: Bumping version to v${{ env.SDK_VERSION }} [skip ci]
79+
commit-message: Bump version to ${{ env.SDK_VERSION }}
80+
branch: rc-${{ env.SDK_VERSION }}
81+
delete-branch: true
82+
base: main
83+
title: rc-${{ env.SDK_VERSION }}
84+
body: This is an auto-generated PR to merge the rc branch back into main upon successful release.
7185

7286
build:
7387
needs: prepare
@@ -97,7 +111,7 @@ jobs:
97111
- name: Checkout Code
98112
uses: actions/checkout@v3
99113
with:
100-
ref: ${{ needs.prepare.outputs.sha }}
114+
ref: rc-${{ needs.prepare.outputs.version }}
101115

102116
- name: Install Poetry
103117
uses: snok/install-poetry@v1

.github/workflows/update_protos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
run: make format
4040

4141
- name: Add + Commit + Open PR
42-
uses: peter-evans/create-pull-request@v3
42+
uses: peter-evans/create-pull-request@v5
4343
with:
4444
commit-message: '[WORKFLOW] Updating protos from ${{ github.event.client_payload.repo_name }}, commit: ${{ github.event.client_payload.sha }}'
4545
branch: 'workflow/update-protos'

src/viam/resource/manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
from viam.resource.base import ResourceBase
66
from viam.resource.registry import Registry
77

8-
from ..services.service_base import ServiceBase
98
from ..components.component_base import ComponentBase
109
from ..errors import DuplicateResourceError, ResourceNotFoundError
10+
from ..services.service_base import ServiceBase
1111

1212
ResourceType = TypeVar("ResourceType", bound=ResourceBase)
1313

src/viam/services/mlmodel/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from typing import Dict, Mapping, Optional
2+
23
from grpclib.client import Channel
34

45
from viam.proto.common import DoCommandRequest, DoCommandResponse

src/viam/services/mlmodel/mlmodel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import abc
2-
32
from typing import Dict, Final, Optional
3+
44
from viam.proto.service.mlmodel import Metadata
55
from viam.resource.types import RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_SERVICE, Subtype
66
from viam.utils import ValueTypes

0 commit comments

Comments
 (0)