Skip to content

Merge pull request #150 from pollen-robotics/149-generate-new-api-ver… #53

Merge pull request #150 from pollen-robotics/149-generate-new-api-ver…

Merge pull request #150 from pollen-robotics/149-generate-new-api-ver… #53

Workflow file for this run

name: Generate Code
on:
push:
branches:
- '*'
tags:
- '!v*'
jobs:
generate-python:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install grpcio-tools==1.59.3 mypy-protobuf==3.5.0
- name: Generate Protobuf Python Code
run: |
python -m grpc_tools.protoc -I./protos --python_out=./python/reachy2_sdk_api --grpc_python_out=./python/reachy2_sdk_api --mypy_out=./python/reachy2_sdk_api --mypy_grpc_out=./python/reachy2_sdk_api ./protos/*.proto
- name: Commit and push changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "Generated Protobuf Python Code" || echo "No changes to commit"
git push
generate-csharp:
runs-on: windows-2022
needs: generate-python
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Restore NuGet packages
run: nuget restore 'csharp/reachy_sdk/reachy_sdk.sln'
- name: Build solution
run: msbuild 'csharp\reachy_sdk\reachy_sdk.sln' /p:Configuration=Release
- name: Commit and push changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "Generated Protobuf C# Code" || echo "No changes to commit"
git push