diff --git a/.github/workflows/release-candidate.yml b/.github/workflows/release-candidate.yml index 23d8fedfc..bfc3469f7 100644 --- a/.github/workflows/release-candidate.yml +++ b/.github/workflows/release-candidate.yml @@ -52,11 +52,17 @@ jobs: - name: Clean Format Test run: make clean better_imports format test + - name: Current version + id: current_version + shell: bash + run: | + echo "current_version=$(poetry version)" >> $GITHUB_OUTPUT + - name: Bump Version id: bump_version shell: bash run: | - if [[ $(poetry version) == *"rc"* ]]; then + if [ ${{ contains(steps.current_version.outputs.current_version, 'rc') }} ]; then poetry version prerelease else poetry version "$(poetry version ${{ inputs.version }} -s --dry-run)"rc1 @@ -80,15 +86,18 @@ jobs: if: | steps.release_exists.outputs.id != '' - - name: Add + Commit + Open PR - uses: peter-evans/create-pull-request@v5 + - name: Add + Commit + uses: EndBug/add-and-commit@v9 + with: + new_branch: rc-${{ env.SDK_VERSION }} + message: Bump version to ${{ env.SDK_RC_VERSION }} + + - name: Open PR + uses: repo-sync/pull-request@v2 with: - commit-message: Bump version to ${{ env.SDK_RC_VERSION }} - branch: rc-${{ env.SDK_VERSION }} - delete-branch: false - base: main - title: rc-${{ env.SDK_VERSION }} - body: This is an auto-generated PR to merge the rc branch back into main upon successful release. + destination_branch: "main" + pr_title: rc-${{ env.SDK_VERSION }} + pr_body: This is an auto-generated PR to merge the rc branch back into main upon successful release. build: needs: prepare diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2702a8246..0c7b08960 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: jobs: prepare: - if: github.repository_owner == 'viamrobotics' && startsWith(github.ref, 'rc-') + if: github.repository_owner == 'viamrobotics' && startsWith(github.ref_name, 'rc-') runs-on: [self-hosted, x64] container: image: ghcr.io/viamrobotics/canon:amd64 @@ -39,8 +39,9 @@ jobs: - name: Bump Version id: bump_version + shell: bash run: | - poetry version ${$(poetry version -s)%rc*} + poetry version $(poetry version -s | sed -e 's/\"//g' -e 's/rc.*//g') echo "SDK_VERSION=$(poetry version -s)" >> $GITHUB_ENV echo "version=$(poetry version -s)" >> $GITHUB_OUTPUT @@ -58,19 +59,22 @@ jobs: if: | steps.release_exists.outputs.id != '' - - name: Add + Commit + Open PR - uses: peter-evans/create-pull-request@v5 + - name: Add + Commit + uses: EndBug/add-and-commit@v9 with: - commit-message: Bump version to ${{ env.SDK_VERSION }} - branch: rc-${{ env.SDK_VERSION }} - delete-branch: true - base: main - title: rc-${{ env.SDK_VERSION }} - body: This is an auto-generated PR to merge the rc branch back into main upon successful release. + new_branch: rc-${{ env.SDK_VERSION }} + message: Bump version to ${{ env.SDK_VERSION }} + + - name: Open PR + uses: repo-sync/pull-request@v2 + with: + destination_branch: "main" + pr_title: rc-${{ env.SDK_VERSION }} + pr_body: This is an auto-generated PR to merge the rc branch back into main upon successful release. build: needs: prepare - if: github.repository_owner == 'viamrobotics' && startsWith(github.ref, 'rc-') + if: github.repository_owner == 'viamrobotics' && startsWith(github.ref_name, 'rc-') runs-on: [self-hosted, x64] container: image: ghcr.io/viamrobotics/canon:amd64 @@ -121,7 +125,7 @@ jobs: release: needs: [prepare, build] - if: github.repository_owner == 'viamrobotics' && startsWith(github.ref, 'rc-') + if: github.repository_owner == 'viamrobotics' && startsWith(github.ref_name, 'rc-') runs-on: [self-hosted, x64] container: image: ghcr.io/viamrobotics/canon:amd64 diff --git a/pyproject.toml b/pyproject.toml index acabf66bd..d8155a9ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "viam-sdk" -version = "0.3.0" +version = "0.3.1" description = "Viam Robotics Python SDK" authors = [ "Naveed " ] license = "Apache-2.0" diff --git a/src/viam/module/module.py b/src/viam/module/module.py index f4189740b..3e1b0169a 100644 --- a/src/viam/module/module.py +++ b/src/viam/module/module.py @@ -2,9 +2,9 @@ from inspect import iscoroutinefunction from threading import Lock from typing import List, Mapping, Optional, Sequence, Tuple -from typing_extensions import Self from grpclib.utils import _service_name +from typing_extensions import Self from viam import logging from viam.components.component_base import ComponentBase