From da975357e4f1d429dd32141e620050852a8d0353 Mon Sep 17 00:00:00 2001 From: andreika-git Date: Mon, 15 Jan 2024 22:00:23 +0200 Subject: [PATCH] Simplify board name usage https://github.com/rusefi/fw-custom-example/issues/1 --- .github/workflows/build-firmware.yaml | 24 +++++++++++++++++++++++- board.mk | 4 ++-- meta-info.env | 1 + meta-info.txt | 2 -- 4 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 meta-info.env delete mode 100644 meta-info.txt diff --git a/.github/workflows/build-firmware.yaml b/.github/workflows/build-firmware.yaml index 50b16cf..bca524e 100644 --- a/.github/workflows/build-firmware.yaml +++ b/.github/workflows/build-firmware.yaml @@ -8,10 +8,32 @@ on: workflow_dispatch: jobs: + read-meta-info: + runs-on: ubuntu-latest + outputs: + short_board_name: ${{ steps.read_meta.outputs.SHORT_BOARD_NAME }} + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Read meta-info file with the board description + id: read_meta + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' + run: | + echo "$(cat ./meta-info.env)" >> $GITHUB_OUTPUT + + - name: Debug output of the board name + run: | + echo "SHORT_BOARD_NAME = ${{ steps.read_meta.outputs.SHORT_BOARD_NAME }}" + call-workflow-passing-data: + needs: read-meta-info uses: rusefi/rusefi/.github/workflows/custom-board-build.yaml@master secrets: inherit permissions: contents: write with: - shortBoardName: XXX + shortBoardName: ${{ needs.read-meta-info.outputs.SHORT_BOARD_NAME }} + rusefi_dir: ext/rusefi + relative_board_dir: ../.. diff --git a/board.mk b/board.mk index fe7da01..d92fb6b 100644 --- a/board.mk +++ b/board.mk @@ -2,8 +2,8 @@ BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp BOARDINC += $(BOARD_DIR)/generated/controllers/generated -# todo: use meta-info.txt -SHORT_BOARD_NAME=XXX +# defines SHORT_BOARD_NAME +include $(BOARD_DIR)/meta-info.env # reduce memory usage monitoring DDEFS += -DRAM_UNUSED_SIZE=100 diff --git a/meta-info.env b/meta-info.env new file mode 100644 index 0000000..6e1ec59 --- /dev/null +++ b/meta-info.env @@ -0,0 +1 @@ +SHORT_BOARD_NAME=XXX diff --git a/meta-info.txt b/meta-info.txt deleted file mode 100644 index 53850cb..0000000 --- a/meta-info.txt +++ /dev/null @@ -1,2 +0,0 @@ -# todo: find a way for build-firmware.yaml to consume this file? maybe the other way around? -shortBoardName=XXX \ No newline at end of file