Skip to content

Commit

Permalink
Merge pull request #32 from ChrGri/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ChrGri authored Jul 12, 2024
2 parents 341680f + 4e79628 commit 2ebd0bf
Show file tree
Hide file tree
Showing 94 changed files with 11,883 additions and 11,920 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/arduino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ jobs:
#- name: List files in dir 2
# run: |
# ls ${{ github.workspace }}

- name: Edit version
run: sed -i "s/\(AssemblyVersion(""\([0-9]\+\.\)\{3\}\)\([0-9]\+\)/\1${{github.run_number}}/" "SimHubPlugin/Properties/AssemblyInfo.cs"

- name: Restore Packages
run: nuget restore "SimHubPlugin/User.PluginSdkDemo.sln"

Expand Down
103 changes: 103 additions & 0 deletions .github/workflows/platformio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: build_firmware

on: [push]


# see e.g. https://cgrotz.github.io/2020-08-24-esp32_ci_cd_part2/

jobs:
buildFirmware:
#runs-on: ubuntu-latest
runs-on: windows-latest

steps:

# Prepare environment
- uses: actions/checkout@main
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install PlatformIO Core
run: pip install --upgrade platformio





# Build ESP code
- name: Build PlatformIO Project ESP32
working-directory: ./ESP32
run: |
pio system info
pio run --environment esp32
pio run --environment esp32s3usbotg
pio run --environment esp32-speedcrafter
# copy files to dir
- name: Copy files to packing dir
run: |
copy ${{ github.workspace }}/ESP32/.pio/build/esp32/firmware.bin ${{ github.workspace }}/Helper/bins/esp32
copy ${{ github.workspace }}/ESP32/.pio/build/esp32/bootloader.bin ${{ github.workspace }}/Helper/bins/esp32
copy ${{ github.workspace }}/ESP32/.pio/build/esp32/partitions.bin ${{ github.workspace }}/Helper/bins/esp32
copy ${{ github.workspace }}/ESP32/.pio/build/esp32s3usbotg/firmware.bin ${{ github.workspace }}/Helper/bins/esp32s3
copy ${{ github.workspace }}/ESP32/.pio/build/esp32s3usbotg/bootloader.bin ${{ github.workspace }}/Helper/bins/esp32s3
copy ${{ github.workspace }}/ESP32/.pio/build/esp32s3usbotg/partitions.bin ${{ github.workspace }}/Helper/bins/esp32s3
copy ${{ github.workspace }}/ESP32/.pio/build/esp32-speedcrafter/firmware.bin ${{ github.workspace }}/Helper/bins/esp32_speedcrafter_PCB_V1p4
copy ${{ github.workspace }}/ESP32/.pio/build/esp32-speedcrafter/bootloader.bin ${{ github.workspace }}/Helper/bins/esp32_speedcrafter_PCB_V1p4
copy ${{ github.workspace }}/ESP32/.pio/build/esp32-speedcrafter/partitions.bin ${{ github.workspace }}/Helper/bins/esp32_speedcrafter_PCB_V1p4






# copy files to dir
- name: List files in dir
run: |
dir ${{ github.workspace }}/Helper/bins/esp32





# zip plugin binaries
- name: ZIP files
run: |
7z a ${{ github.workspace }}/Helper/zip/esp32.zip ${{ github.workspace }}/Helper/bins/esp32/
7z a ${{ github.workspace }}/Helper/zip/esp32s3.zip ${{ github.workspace }}/Helper/bins/esp32s3/
7z a ${{ github.workspace }}/Helper/zip/esp32_speedcrafter.zip ${{ github.workspace }}/Helper/bins/esp32_speedcrafter_PCB_V1p4/
# 7z a ./Helper/zip/esp32.zip @./Helper/zip/filelist_esp32.txt
# 7z a ./Helper/zip/esp32s3.zip @Helper/zip/filelist_esp32s3.txt
# 7z a./Helper/zip/esp32_speedcrafter.zip @Helper/zip/filelist_esp32_speedcrafter.txt





# Publish as build artifact
- name: Attach artifact
uses: actions/upload-artifact@v2
with:
name: firmware_esp32
path: |
./Helper/zip/esp32.zip
./Helper/zip/esp32s3.zip
./Helper/zip/esp32_speedcrafter.zip


29 changes: 29 additions & 0 deletions .github/workflows/publishRelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: build_release


# Only trigger, when the build workflow succeeded, see https://stackoverflow.com/questions/62750603/github-actions-trigger-another-action-after-one-action-is-completed
on:
workflow_run:
workflows: ["build_firmware","build_simhub_plugin"]
types:
- completed

#on: [push]

# This is the list of jobs that will be run concurrently.
# Since we use a build matrix, the actual number of jobs
# started depends on how many configurations the matrix
# will produce.

# https://docs.github.com/de/actions/using-workflows/storing-workflow-data-as-artifacts

jobs:
generateRelase:
runs-on: ubuntu-latest
steps:
- name: Download math result for job 2
uses: actions/download-artifact@v4
- name: Print the final result
shell: bash
run: |
echo The result is good
32 changes: 32 additions & 0 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: build_release


# Only trigger, when the build workflow succeeded, see https://stackoverflow.com/questions/62750603/github-actions-trigger-another-action-after-one-action-is-completed
on:
workflow_run:
workflows: ["build_firmware","build_simhub_plugin"]
types:
- completed



# This is the list of jobs that will be run concurrently.
# Since we use a build matrix, the actual number of jobs
# started depends on how many configurations the matrix
# will produce.

# https://docs.github.com/de/actions/using-workflows/storing-workflow-data-as-artifacts

jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
steps:
- name: Download math result for job 2
uses: actions/download-artifact@v4
with:
name: ["simhub_plugin","firmware_esp32"]
- name: Print the final result
shell: bash
run: |
echo The result is good
86 changes: 86 additions & 0 deletions .github/workflows/simhubPlugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: build_simhub_plugin

on: [push]


# see e.g. https://cgrotz.github.io/2020-08-24-esp32_ci_cd_part2/

jobs:
########################################################################
# Build SimHub plugin
########################################################################
buildSimhubPlugin:
runs-on: windows-2019

steps:
- uses: actions/checkout@v2
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1

- name: Setup NuGet
uses: NuGet/[email protected]

- name: Setup MS Build Systems
uses: microsoft/[email protected]

- uses: actions/cache@v3
name: Restore Caches
id: cache
with:
path: |
innounp050.rar
SimHub.8.01.2.zip
key: SimHub.8.01.2

- name: Download Requirements # Used to download the SimHub DLLs - only if not in cache.
if: steps.cache.outputs.cache-hit != 'true'
run: |
aria2c -j1 -o innounp050.rar "https://sourceforge.net/projects/innounp/files/innounp/innounp%200.50/innounp050.rar/download"
aria2c -j1 -o SimHub.8.01.2.zip "https://github.com/SHWotever/SimHub/releases/download/9.1.22/SimHub.9.01.22.zip"
- name: Extract Requirements # Used to extract the SimHub DLLs
run: |
7z x innounp050.rar
7z x SimHub.8.01.2.zip
dir
mkdir "C:\Program Files (x86)\SimHub\"
${{ github.workspace }}\innounp.exe -v -x -b -e -d"C:\Program Files (x86)\SimHub\" SimHubSetup_9.1.22.exe
- name: List files in dir
run: |
ls "C:\Program Files (x86)\SimHub\"
#- name: List files in dir 2
# run: |
# ls ${{ github.workspace }}
- name: Edit version
run: sed -i "s/\(AssemblyVersion(""\([0-9]\+\.\)\{3\}\)\([0-9]\+\)/\1${{github.run_number}}/" "SimHubPlugin/Properties/AssemblyInfo.cs"

- name: Restore Packages
run: nuget restore "SimHubPlugin/User.PluginSdkDemo.sln"

- name: Build solution
run: msbuild "SimHubPlugin/User.PluginSdkDemo.sln" -t:rebuild -property:Configuration=Release






# zip plugin binaries
- name: ZIP files
run: |
7z a ./SimHubPlugin/bin/SimHub_plugin.zip ./SimHubPlugin/bin/*
# Publish as build artifact
- name: Attach artifact
uses: actions/upload-artifact@v2
with:
name: simhub_plugin
path: |
./SimHubPlugin/bin/SimHub_plugin.zip
8 changes: 7 additions & 1 deletion Arduino/Esp32/Main/Main.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@

#define BLUETOOTH_GAMEPAD
//#define USB_JOYSTICK
#define SERIAL_COOMUNICATION_TASK_DELAY_IN_MS 1
#endif


Expand All @@ -113,6 +114,7 @@

//#define BLUETOOTH_GAMEPAD
#define USB_JOYSTICK
#define SERIAL_COOMUNICATION_TASK_DELAY_IN_MS 1
#endif


Expand Down Expand Up @@ -146,7 +148,7 @@

#define BLUETOOTH_GAMEPAD
//#define USB_JOYSTICK

#define SERIAL_COOMUNICATION_TASK_DELAY_IN_MS 1
#endif


Expand Down Expand Up @@ -177,6 +179,7 @@
#define BLUETOOTH_GAMEPAD
//#define USB_JOYSTICK

#define SERIAL_COOMUNICATION_TASK_DELAY_IN_MS 1
#endif


Expand Down Expand Up @@ -207,6 +210,7 @@

#define BLUETOOTH_GAMEPAD
//#define USB_JOYSTICK
#define SERIAL_COOMUNICATION_TASK_DELAY_IN_MS 1
#endif


Expand Down Expand Up @@ -248,5 +252,7 @@

//#define BLUETOOTH_GAMEPAD
#define USB_JOYSTICK

#define SERIAL_COOMUNICATION_TASK_DELAY_IN_MS 15
#endif

Loading

0 comments on commit 2ebd0bf

Please sign in to comment.