Skip to content

Merge branch '132-automatically-generate-c-code' of https://github.co… #2

Merge branch '132-automatically-generate-c-code' of https://github.co…

Merge branch '132-automatically-generate-c-code' of https://github.co… #2

Workflow file for this run

name: Generate Code
on: [push]
jobs:
generate-python:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- 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
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
with:
vs-version: '[17.10,17.11)'
- 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