Skip to content

Added STATE_OF_CHARGE CAN message #88

Added STATE_OF_CHARGE CAN message

Added STATE_OF_CHARGE CAN message #88

Workflow file for this run

name: Generate and Release
on:
push:
branches:
- main
jobs:
generate-dbc:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.9' # Specify the Python version
- name: Install cantools
run: python -m pip install cantools # Install cantools library
- name: Convert SYM to DBC
run: |
cantools convert ${{ github.workspace }}/PCAN_project/hytech.sym hytech.dbc
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: dbcfile
path: hytech.dbc
generate-and-release:
needs: generate-dbc
runs-on: ubuntu-latest
container:
image: ghcr.io/rcmast3r/ccoderdbc:main
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: dbcfile
path: /dbc
- name: generate code
run: |
mkdir -p /hytech_can_lib
cd /app
./build/coderdbc -rw -dbc /dbc/hytech.dbc -out /hytech_can_lib -drvname hytech
mkdir -p /output
echo "{\n\"name\": \"can_lib\",\n\"version\": \"1.0.0\",\n\"build\": {\n\t\"flags\": [\n\t\t\"-Iinc\",\n\t\t\"-Ilib\",\n\t\t\"-Iconf\"\n\t]\n}\n}" >> /hytech_can_lib/library.json
tar -czvf /output/can_lib.tar.gz /hytech_can_lib
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.run_number }}
release_name: Release ${{ github.run_number }}
draft: false
prerelease: false
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /output/can_lib.tar.gz
asset_name: can_lib.tar.gz
asset_content_type: application/zip
- name: Upload hytech.dbc
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /dbc/hytech.dbc
asset_name: hytech.dbc
asset_content_type: text/plain