From 8cf0bec994426b5dbe832fbd777e079cfc5aecd1 Mon Sep 17 00:00:00 2001 From: brentfpage Date: Fri, 30 Jan 2026 00:09:02 -0800 Subject: [PATCH 01/19] draft workflow (.yml and .pro) edits to automate firmware compilation; also removed hard-coded firmware version macros in the Desktop Interface and the firmware --- .github/workflows/avr.yml | 58 +++++++ .github/workflows/continuous.yml | 37 ++-- .github/workflows/mac.yml | 50 +++++- AVR_Code/Makefile | 249 +++++++++++++++++++++++++++ AVR_Code/USB_BULK_TEST/Makefile | 242 -------------------------- AVR_Code/USB_BULK_TEST/src/globals.h | 4 +- Desktop_Interface/Labrador.pro | 2 + Desktop_Interface/genericusbdriver.h | 2 +- 8 files changed, 383 insertions(+), 261 deletions(-) create mode 100644 .github/workflows/avr.yml create mode 100755 AVR_Code/Makefile delete mode 100755 AVR_Code/USB_BULK_TEST/Makefile diff --git a/.github/workflows/avr.yml b/.github/workflows/avr.yml new file mode 100644 index 000000000..330d8a632 --- /dev/null +++ b/.github/workflows/avr.yml @@ -0,0 +1,58 @@ +name: Build firmware + +permissions: + contents: read + pull-requests: write + +on: + workflow_call: + outputs: + firstword: + description: the run-id of the workflow run + value: ${{ jobs.build-hex.outputs.output1 }} + workflow_dispatch: + push: + + +jobs: + build-hex: + runs-on: ubuntu-latest + outputs: + output1: ${{ steps.step_get_run_id.outputs.RUN_ID }} + steps: + - name : Checkout repository + uses: actions/checkout@v4 + + - name : make 01 + uses: bazhenov/action-avr-make@v1.1 + with: + dir: AVR_Code + target: '01' + env: + FIRMWARE_VERSION_ID: ${{ vars.AVR_VER }} + + - name : make clean + uses: bazhenov/action-avr-make@v1.1 + with: + dir: AVR_Code + target: clean_o_d + + - name : make 02 + uses: bazhenov/action-avr-make@v1.1 + with: + dir: AVR_Code + target: '02' + env: + FIRMWARE_VERSION_ID: ${{ vars.AVR_VER }} + + - name: Upload hex artifacts + uses: actions/upload-artifact@v4 + with: + name: asset-hex + path: AVR_Code/labrafirm*.hex + compression-level: 0 + if-no-files-found: error + + - name: Prepare workflow run ID output + id: step_get_run_id + run: echo "RUN_ID=${{ github.run_id }}" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/continuous.yml b/.github/workflows/continuous.yml index 18c3a4094..d225e5b98 100644 --- a/.github/workflows/continuous.yml +++ b/.github/workflows/continuous.yml @@ -8,27 +8,42 @@ on: workflow_dispatch: jobs: - build-android: - uses: ./.github/workflows/android.yml - secrets: inherit - build-linux: - uses: ./.github/workflows/linux.yml + build-avr: + uses: ./.github/workflows/avr.yml secrets: inherit +# build-android: +# uses: ./.github/workflows/android.yml +# secrets: inherit +# needs: +# - build-avr +# build-linux: +# uses: ./.github/workflows/linux.yml +# secrets: inherit +# needs: +# - build-avr build-mac: + needs: + - build-avr uses: ./.github/workflows/mac.yml + with: + AVR_RUN_ID: ${{ needs.build-avr.outputs.firstword }} secrets: inherit - build-windows: - uses: ./.github/workflows/windows.yml - secrets: inherit + +# build-windows: +# uses: ./.github/workflows/windows.yml +# secrets: inherit +# needs: +# - build-avr release: permissions: contents: write needs: - - build-android - - build-linux + - build-avr +# - build-android +# - build-linux - build-mac - - build-windows +# - build-windows if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest steps: diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 88c4bd644..045a608d7 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -7,6 +7,10 @@ permissions: on: workflow_dispatch: workflow_call: + inputs: + AVR_RUN_ID: + required: true + type: string push: pull_request: @@ -17,6 +21,42 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Download firmware from most recent continuous release + if: github.event.workflow != '.github/workflows/continuous.yml' + run: | + mkdir asset-hex + HEX_URL=$(gh api graphql -f query='query {repository ( owner : "brentfpage", name: "Labrador") {release ( tagName: "continuous" ) {releaseAssets(first:10) {nodes {downloadUrl}}}}}' | jq -r '.data.repository.release.releaseAssets.nodes[] | select(.downloadUrl| test("02.hex")) | .[]') + wget --directory-prefix=asset-hex $HEX_URL + env: + GH_TOKEN: ${{ github.token }} + +# better alternative to the graphql query above would be to somehow retrieve the run-id of the most recent continuous.yml workflow run, then download the hex asset associated with the run-id using actions/download-artifact. +# query description: get at most 10 assets from the most recent continuous release (assume there are fewer than 10), find the one that includes 02.hex in the download url +# prettified (ish) query: +# query {\ +# repository ( owner : "espotek-org", name: "Labrador") {\ +# release ( tagName: "continuous" ) {\ +# releaseAssets(first:10) {\ +# nodes {\ +# downloadUrl\ +# }\ +# }\ +# }\ +# }\ +# }\ +# ' | jq -r '.data.repository.release.releaseAssets.nodes[] | select(.downloadUrl| test("02.hex")) | .[]' + + - name: Download firmware from in-process continuous release + if: github.event.workflow == '.github/workflows/continuous.yml' + uses: actions/download-artifact@v4 + with: + run-id: ${{ inputs.AVR_RUN_ID }} + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: move firmware to appropriate directory + run: | + mv asset-hex/*02.hex Desktop_Interface/resources/firmware + - name: Setup Homebrew dependencies run: | brew update @@ -27,19 +67,19 @@ jobs: - name: Build librador working-directory: Librador_API/___librador/librador run: | - qmake -config release + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ vars.AVR_VER }} make -j$(sysctl -n hw.ncpu) - name: Build librademo working-directory: Librador_API/___librador/librademo run: | - qmake -config release + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ vars.AVR_VER }} make -j$(sysctl -n hw.ncpu) - name: Build basicdemo working-directory: Librador_API/___librador/basicdemo run: | - qmake -config release + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ vars.AVR_VER }} make -j$(sysctl -n hw.ncpu) - name: Import code signing certificate @@ -71,10 +111,10 @@ jobs: working-directory: Desktop_Interface run: | if ( env.MACOS_CERTIFICATE != '' && env.MACOS_CERTIFICATE_PWD != '' ); then - qmake -config release + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ vars.AVR_VER }} else # for debugging - qmake -config debug + qmake -config debug EXPECTED_FIRMWARE_VERSION=${{ vars.AVR_VER }} fi make -j$(sysctl -n hw.ncpu) macdeployqt Labrador.app -verbose=2 -libpath=build_mac/libdfuprog/lib/ diff --git a/AVR_Code/Makefile b/AVR_Code/Makefile new file mode 100755 index 000000000..72bba7866 --- /dev/null +++ b/AVR_Code/Makefile @@ -0,0 +1,249 @@ +# see https://github.com/espotek-org/Labrador/wiki/Building-from-source#building-the-firmware +# Usage : +# make 01 +# build a version of the firmware compatible with Windows x64 OSs +# make 02 +# build a version of the firmware compatible with all other OSs +# Here, OS refers to that of the machine with which the Labrador board will interface. +# After running 'make 01', to switch to building variant 02 instead, first run 'make clean'. +# The same goes for switching from building the 02 variant to building the 01 variant. +# Some details: +# In the build process for variant 01, the macro SINGLE_ENDPOINT_INTERFACE +# is undefined, while in the build process for variant 02, +# SINGLE_ENDPOINT_INTERFACE is defined. In several regions of the source +# code, the undefined/defined status of this macro determines which of two +# possible code blocks are compiled into the firmware. The collective effect +# of having SINGLE_ENDPOINT_INTERFACE defined is to "change the headers so +# that it uses 1x 1023-byte isochronous endpoint, rather than 6x 128-byte +# endpoints to send the scope/logic analyzer data" (from +# https://github.com/espotek-org/Labrador/issues/260) +# *NOTE* : there is a commented-out line defining SINGLE_ENDPOINT_INTERFACE in +# globals.h. If it is uncommented, both 'make 01' and 'make 02' will +# produce variant 02. Further, 'make 01' will mislabel the firmware with +# the suffix 01. It is recommended that this line in globals.h be left +# commented-out, which ensures that `make 01` and `make 02` work as +# expected. +LIB_DEP := +LIBS := +USER_OBJS := +OUTPUT_FILE_PATH := +OUTPUT_FILE_PATH =$(NAME).elf +OUTPUT_FILE_PATH_AS_ARGS +=$(NAME).elf +AVR_APP_PATH :=$$$AVR_APP_PATH$$$ + +CC=avr-gcc +SRC_DIR=./USB_BULK_TEST/src + +INCLUDES=-I"$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained" -I"$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/example" -I"$(SRC_DIR)/ASF/common/services/usb/udc" -I"$(SRC_DIR)/ASF/xmega/drivers/nvm" -I"$(SRC_DIR)/ASF/common/services/sleepmgr" -I"$(SRC_DIR)/ASF/common/services/clock" -I"$(SRC_DIR)/ASF/xmega/drivers/sleep" -I"$(SRC_DIR)/ASF/xmega/drivers/usb" -I"$(SRC_DIR)/ASF/xmega/drivers/cpu" -I"$(SRC_DIR)/ASF/common/services/usb/class/vendor" -I"$(SRC_DIR)/ASF/common/services/usb/class/vendor/device" -I"$(SRC_DIR)/ASF/common/services/usb" -I"$(SRC_DIR)mon/applications/user_application/user_board/config" -I"$(SRC_DIR)/ASF/xmega/utils" -I"$(SRC_DIR)/config" -I"$(SRC_DIR)/ASF/common/boards" -I"$(SRC_DIR)/ASF/xmega/utils/preprocessor" -I"$(SRC_DIR)/ASF/common/utils" -I"$(SRC_DIR)" -I"$(SRC_DIR)/ASF/common/boards/user_board" -I"$(SRC_DIR)/ASF/common/services/ioport" + +CFLAGS=-std=gnu99 -ffunction-sections -mmcu=atxmega32a4u -fsigned-char -funsigned-bitfields -fdata-sections -fshort-enums -fno-strict-aliasing -fno-jump-tables -fpack-struct -Wall -O2 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -DFIRMWARE_VERSION_ID=$(FIRMWARE_VERSION_ID) + +SHORT_FIRMWARE_VERSION_ID := $(shell fv='$(FIRMWARE_VERSION_ID)'; echo "$${fv:2:4}") +NAME=labrafirm_$(SHORT_FIRMWARE_VERSION_ID)_$(SUFFIX) + +OBJS += \ +$(SRC_DIR)/tiny_calibration.o \ +$(SRC_DIR)/tiny_dig.o \ +$(SRC_DIR)/tiny_eeprom.o \ +$(SRC_DIR)/ASF/common/boards/user_board/init.o \ +$(SRC_DIR)/ASF/common/services/ioport/xmega/ioport_compat.o \ +$(SRC_DIR)/main.o \ +$(SRC_DIR)/tiny_adc.o \ +$(SRC_DIR)/tiny_dac.o \ +$(SRC_DIR)/tiny_dma.o \ +$(SRC_DIR)/tiny_timer.o \ +$(SRC_DIR)/tiny_uart.o \ +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained/ui.o \ +$(SRC_DIR)/ASF/common/services/clock/xmega/sysclk.o \ +$(SRC_DIR)/ASF/common/services/sleepmgr/xmega/sleepmgr.o \ +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/udi_vendor.o \ +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/udi_vendor_desc.o \ +$(SRC_DIR)/ASF/common/services/usb/udc/udc.o \ +$(SRC_DIR)/ASF/xmega/drivers/nvm/nvm.o \ +$(SRC_DIR)/ASF/xmega/drivers/nvm/nvm_asm.o \ +$(SRC_DIR)/ASF/xmega/drivers/cpu/ccp.o \ +$(SRC_DIR)/ASF/xmega/drivers/usb/usb_device.o + +C_DEPS_AS_ARGS += \ +$(SRC_DIR)/tiny_calibration.d \ +$(SRC_DIR)/tiny_dig.d \ +$(SRC_DIR)/tiny_eeprom.d \ +$(SRC_DIR)/ASF/common/boards/user_board/init.d \ +$(SRC_DIR)/ASF/common/services/ioport/xmega/ioport_compat.d \ +$(SRC_DIR)/main.d \ +$(SRC_DIR)/tiny_adc.d \ +$(SRC_DIR)/tiny_dac.d \ +$(SRC_DIR)/tiny_dma.d \ +$(SRC_DIR)/tiny_timer.d \ +$(SRC_DIR)/tiny_uart.d \ +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained/ui.d \ +$(SRC_DIR)/ASF/common/services/clock/xmega/sysclk.d \ +$(SRC_DIR)/ASF/common/services/sleepmgr/xmega/sleepmgr.d \ +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/udi_vendor.d \ +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/udi_vendor_desc.d \ +$(SRC_DIR)/ASF/common/services/usb/udc/udc.d \ +$(SRC_DIR)/ASF/xmega/drivers/nvm/nvm.d \ +$(SRC_DIR)/ASF/xmega/drivers/nvm/nvm_asm.d \ +$(SRC_DIR)/ASF/xmega/drivers/cpu/ccp.d \ +$(SRC_DIR)/ASF/xmega/drivers/usb/usb_device.d + +OBJS_AS_ARGS += \ +$(SRC_DIR)/tiny_calibration.o \ +$(SRC_DIR)/tiny_dig.o \ +$(SRC_DIR)/tiny_eeprom.o \ +$(SRC_DIR)/ASF/common/boards/user_board/init.o \ +$(SRC_DIR)/ASF/common/services/ioport/xmega/ioport_compat.o \ +$(SRC_DIR)/main.o \ +$(SRC_DIR)/tiny_adc.o \ +$(SRC_DIR)/tiny_dac.o \ +$(SRC_DIR)/tiny_dma.o \ +$(SRC_DIR)/tiny_timer.o \ +$(SRC_DIR)/tiny_uart.o \ +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained/ui.o \ +$(SRC_DIR)/ASF/common/services/clock/xmega/sysclk.o \ +$(SRC_DIR)/ASF/common/services/sleepmgr/xmega/sleepmgr.o \ +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/udi_vendor.o \ +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/udi_vendor_desc.o \ +$(SRC_DIR)/ASF/common/services/usb/udc/udc.o \ +$(SRC_DIR)/ASF/xmega/drivers/nvm/nvm.o \ +$(SRC_DIR)/ASF/xmega/drivers/nvm/nvm_asm.o \ +$(SRC_DIR)/ASF/xmega/drivers/cpu/ccp.o \ +$(SRC_DIR)/ASF/xmega/drivers/usb/usb_device.o + +01: SUFFIX=01 +01: $(OUTPUT_FILE_PATH) + @echo NAME:$(NAME) + @echo CFLAGS:$(CFLAGS) + +02: CFLAGS+=-DSINGLE_ENDPOINT_INTERFACE +02: SUFFIX=02 +02: $(OUTPUT_FILE_PATH) + @echo NAME:$(NAME) + @echo CFLAGS:$(CFLAGS) + +$(SRC_DIR)/tiny_calibration.o: $(SRC_DIR)/tiny_calibration.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/tiny_dig.o: $(SRC_DIR)/tiny_dig.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/tiny_eeprom.o: $(SRC_DIR)/tiny_eeprom.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/common/boards/user_board/init.o: $(SRC_DIR)/ASF/common/boards/user_board/init.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/common/services/ioport/xmega/ioport_compat.o: $(SRC_DIR)/ASF/common/services/ioport/xmega/ioport_compat.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/main.o: $(SRC_DIR)/main.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/tiny_adc.o: $(SRC_DIR)/tiny_adc.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/tiny_dac.o: $(SRC_DIR)/tiny_dac.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/tiny_dma.o: $(SRC_DIR)/tiny_dma.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/tiny_timer.o: $(SRC_DIR)/tiny_timer.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/tiny_uart.o: $(SRC_DIR)/tiny_uart.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained/ui.o: $(SRC_DIR)/ASF/common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained/ui.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/common/services/clock/xmega/sysclk.o: $(SRC_DIR)/ASF/common/services/clock/xmega/sysclk.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/common/services/sleepmgr/xmega/sleepmgr.o: $(SRC_DIR)/ASF/common/services/sleepmgr/xmega/sleepmgr.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/udi_vendor.o: $(SRC_DIR)/ASF/common/services/usb/class/vendor/device/udi_vendor.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/common/services/usb/class/vendor/device/udi_vendor_desc.o: $(SRC_DIR)/ASF/common/services/usb/class/vendor/device/udi_vendor_desc.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/common/services/usb/udc/udc.o: $(SRC_DIR)/ASF/common/services/usb/udc/udc.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/xmega/drivers/cpu/ccp.o: $(SRC_DIR)/ASF/xmega/drivers/cpu/ccp.s + @echo Building file: $< + @$(CC) -x assembler-with-cpp -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/xmega/drivers/nvm/nvm.o: $(SRC_DIR)/ASF/xmega/drivers/nvm/nvm.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/xmega/drivers/nvm/nvm_asm.o: $(SRC_DIR)/ASF/xmega/drivers/nvm/nvm_asm.s + @echo Building file: $< + @$(CC) -x assembler-with-cpp -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(SRC_DIR)/ASF/xmega/drivers/usb/usb_device.o: $(SRC_DIR)/ASF/xmega/drivers/usb/usb_device.c + @echo Building file: $< + @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" + @echo Finished building: $< + +$(OUTPUT_FILE_PATH): $(OBJS) $(USER_OBJS) $(OUTPUT_FILE_DEP) $(LIB_DEP) $(LINKER_SCRIPT_DEP) + @echo Building target: $@ + $(CC) -o$(OUTPUT_FILE_PATH_AS_ARGS) $(OBJS_AS_ARGS) $(USER_OBJS) $(LIBS) -Wl,-Map=$(NAME)".map" -Wl,-lm -mmcu=atxmega32a4u -Wl,--gc-sections -Wl,--relax + avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature $(NAME)".elf" $(NAME)".hex" + avr-objdump -h -S $(NAME)".elf" > $(NAME)".lss" + avr-objcopy -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O binary $(NAME)".elf" $(NAME)".eep" || exit 0 + avr-objcopy -O srec -R .eeprom -R .fuse -R .lock -R .signature $(NAME)".elf" $(NAME)".srec" + avr-size $(NAME)".elf" + @echo Finished successfully: $(NAME) + +clean_o_d : + -rm -rf $(OBJS_AS_ARGS) + -rm -rf $(C_DEPS_AS_ARGS) +VARIANTS = 01 02 +clean : clean_o_d + $(foreach SUFFIX,$(VARIANTS), \ + rm -rf $(NAME).hex ; \ + rm -rf $(NAME).lss ; \ + rm -rf $(NAME).eep ; \ + rm -rf $(NAME).srec ; \ + rm -rf $(NAME).elf $(NAME).a $(NAME).map) diff --git a/AVR_Code/USB_BULK_TEST/Makefile b/AVR_Code/USB_BULK_TEST/Makefile deleted file mode 100755 index d14e3a548..000000000 --- a/AVR_Code/USB_BULK_TEST/Makefile +++ /dev/null @@ -1,242 +0,0 @@ -# see https://github.com/espotek-org/Labrador/wiki/Building-from-source#building-the-firmware -# Usage : -# make 0x01 -# build a version of the firmware compatible with Windows x64 OSs -# make 0x02 -# build a version of the firmware compatible with all other OSs -# Here, OS refers to that of the machine with which the Labrador board will interface. -# After running 'make 0x01', to switch to building variant 0x02 instead, first run 'make clean'. -# The same goes for switching from building the 0x02 variant to building the 0x01 variant. -# Some details: -# In the build process for variant 0x01, the macro SINGLE_ENDPOINT_INTERFACE -# is undefined, while in the build process for variant 0x02, -# SINGLE_ENDPOINT_INTERFACE is defined. In several regions of the source -# code, the undefined/defined status of this macro determines which of two -# possible code blocks are compiled into the firmware. The collective effect -# of having SINGLE_ENDPOINT_INTERFACE defined is to "change the headers so -# that it uses 1x 1023-byte isochronous endpoint, rather than 6x 128-byte -# endpoints to send the scope/logic analyzer data" (from -# https://github.com/espotek-org/Labrador/issues/260) -# *NOTE* : there is a commented-out line defining SINGLE_ENDPOINT_INTERFACE in -# globals.h. If it is uncommented, both 'make 0x01' and 'make 0x02' will -# produce variant 0x02. Further, 'make 0x01' will mislabel the firmware with -# the suffix 0x01. It is recommended that this line in globals.h be left -# commented-out, which ensures that `make 0x01` and `make 0x02` work as -# expected. -EXECUTABLES := -LIB_DEP := -LIBS := -USER_OBJS := -OUTPUT_FILE_PATH := -OUTPUT_FILE_PATH =$(NAME).elf -OUTPUT_FILE_PATH_AS_ARGS +=$(NAME).elf -AVR_APP_PATH :=$$$AVR_APP_PATH$$$ - -AVRDIR= -CC=$(AVRDIR)/bin/avr-gcc -INCLUDES=-I"./common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained" -I"./common/services/usb/class/vendor/device/example" -I"./src/ASF/common/services/usb/udc" -I"./src/ASF/xmega/drivers/nvm" -I"./src/ASF/common/services/sleepmgr" -I"./src/ASF/common/services/clock" -I"./src/ASF/xmega/drivers/sleep" -I"./src/ASF/xmega/drivers/usb" -I"./src/ASF/xmega/drivers/cpu" -I"./src/ASF/common/services/usb/class/vendor" -I"./src/ASF/common/services/usb/class/vendor/device" -I"./src/ASF/common/services/usb" -I"./common/applications/user_application/user_board/config" -I"./src/ASF/xmega/utils" -I"./src/config" -I"./src/ASF/common/boards" -I"./src/ASF/xmega/utils/preprocessor" -I"./src/ASF/common/utils" -I"./src" -I"./src/ASF/common/boards/user_board" -I"./src/ASF/common/services/ioport" - -CFLAGS=-std=gnu99 -ffunction-sections -mmcu=atxmega32a4u -fsigned-char -funsigned-bitfields -fdata-sections -fshort-enums -fno-strict-aliasing -fno-jump-tables -fpack-struct -Wall -O2 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -NAME=labrafirm_$(SUFFIX) - -OBJS += \ -./src/tiny_calibration.o \ -./src/tiny_dig.o \ -./src/tiny_eeprom.o \ -./src/ASF/common/boards/user_board/init.o \ -./src/ASF/common/services/ioport/xmega/ioport_compat.o \ -./src/main.o \ -./src/tiny_adc.o \ -./src/tiny_dac.o \ -./src/tiny_dma.o \ -./src/tiny_timer.o \ -./src/tiny_uart.o \ -./src/ASF/common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained/ui.o \ -./src/ASF/common/services/clock/xmega/sysclk.o \ -./src/ASF/common/services/sleepmgr/xmega/sleepmgr.o \ -./src/ASF/common/services/usb/class/vendor/device/udi_vendor.o \ -./src/ASF/common/services/usb/class/vendor/device/udi_vendor_desc.o \ -./src/ASF/common/services/usb/udc/udc.o \ -./src/ASF/xmega/drivers/nvm/nvm.o \ -./src/ASF/xmega/drivers/nvm/nvm_asm.o \ -./src/ASF/xmega/drivers/cpu/ccp.o \ -./src/ASF/xmega/drivers/usb/usb_device.o - -C_DEPS_AS_ARGS += \ -./src/tiny_calibration.d \ -./src/tiny_dig.d \ -./src/tiny_eeprom.d \ -./src/ASF/common/boards/user_board/init.d \ -./src/ASF/common/services/ioport/xmega/ioport_compat.d \ -./src/main.d \ -./src/tiny_adc.d \ -./src/tiny_dac.d \ -./src/tiny_dma.d \ -./src/tiny_timer.d \ -./src/tiny_uart.d \ -./src/ASF/common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained/ui.d \ -./src/ASF/common/services/clock/xmega/sysclk.d \ -./src/ASF/common/services/sleepmgr/xmega/sleepmgr.d \ -./src/ASF/common/services/usb/class/vendor/device/udi_vendor.d \ -./src/ASF/common/services/usb/class/vendor/device/udi_vendor_desc.d \ -./src/ASF/common/services/usb/udc/udc.d \ -./src/ASF/xmega/drivers/nvm/nvm.d \ -./src/ASF/xmega/drivers/nvm/nvm_asm.d \ -./src/ASF/xmega/drivers/cpu/ccp.d \ -./src/ASF/xmega/drivers/usb/usb_device.d - -OBJS_AS_ARGS += \ -./src/tiny_calibration.o \ -./src/tiny_dig.o \ -./src/tiny_eeprom.o \ -./src/ASF/common/boards/user_board/init.o \ -./src/ASF/common/services/ioport/xmega/ioport_compat.o \ -./src/main.o \ -./src/tiny_adc.o \ -./src/tiny_dac.o \ -./src/tiny_dma.o \ -./src/tiny_timer.o \ -./src/tiny_uart.o \ -./src/ASF/common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained/ui.o \ -./src/ASF/common/services/clock/xmega/sysclk.o \ -./src/ASF/common/services/sleepmgr/xmega/sleepmgr.o \ -./src/ASF/common/services/usb/class/vendor/device/udi_vendor.o \ -./src/ASF/common/services/usb/class/vendor/device/udi_vendor_desc.o \ -./src/ASF/common/services/usb/udc/udc.o \ -./src/ASF/xmega/drivers/nvm/nvm.o \ -./src/ASF/xmega/drivers/nvm/nvm_asm.o \ -./src/ASF/xmega/drivers/cpu/ccp.o \ -./src/ASF/xmega/drivers/usb/usb_device.o - -./src/tiny_calibration.o: ./src/tiny_calibration.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/tiny_dig.o: ./src/tiny_dig.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/tiny_eeprom.o: ./src/tiny_eeprom.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/common/boards/user_board/init.o: ./src/ASF/common/boards/user_board/init.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/common/services/ioport/xmega/ioport_compat.o: ./src/ASF/common/services/ioport/xmega/ioport_compat.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/main.o: ./src/main.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/tiny_adc.o: ./src/tiny_adc.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/tiny_dac.o: ./src/tiny_dac.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/tiny_dma.o: ./src/tiny_dma.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/tiny_timer.o: ./src/tiny_timer.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/tiny_uart.o: ./src/tiny_uart.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained/ui.o: ./src/ASF/common/services/usb/class/vendor/device/example/atxmega256a3bu_xmega_a3bu_xplained/ui.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/common/services/clock/xmega/sysclk.o: ./src/ASF/common/services/clock/xmega/sysclk.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/common/services/sleepmgr/xmega/sleepmgr.o: ./src/ASF/common/services/sleepmgr/xmega/sleepmgr.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/common/services/usb/class/vendor/device/udi_vendor.o: ./src/ASF/common/services/usb/class/vendor/device/udi_vendor.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/common/services/usb/class/vendor/device/udi_vendor_desc.o: ./src/ASF/common/services/usb/class/vendor/device/udi_vendor_desc.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/common/services/usb/udc/udc.o: ./src/ASF/common/services/usb/udc/udc.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/xmega/drivers/cpu/ccp.o: ./src/ASF/xmega/drivers/cpu/ccp.s - @echo Building file: $< - @$(CC) -x assembler-with-cpp -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/xmega/drivers/nvm/nvm.o: ./src/ASF/xmega/drivers/nvm/nvm.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/xmega/drivers/nvm/nvm_asm.o: ./src/ASF/xmega/drivers/nvm/nvm_asm.s - @echo Building file: $< - @$(CC) -x assembler-with-cpp -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -./src/ASF/xmega/drivers/usb/usb_device.o: ./src/ASF/xmega/drivers/usb/usb_device.c - @echo Building file: $< - @$(CC) -DNDEBUG -DBOARD=USER_BOARD $(INCLUDES) $(CFLAGS) -c -o "$@" "$<" - @echo Finished building: $< - -0x01: SUFFIX=0x01 -0x01: $(OUTPUT_FILE_PATH) - -0x02: CFLAGS+=-DSINGLE_ENDPOINT_INTERFACE -0x02: SUFFIX=0x02 -0x02: $(OUTPUT_FILE_PATH) - -$(OUTPUT_FILE_PATH): $(OBJS) $(USER_OBJS) $(OUTPUT_FILE_DEP) $(LIB_DEP) $(LINKER_SCRIPT_DEP) - @echo Building target: $@ - $(CC) -o$(OUTPUT_FILE_PATH_AS_ARGS) $(OBJS_AS_ARGS) $(USER_OBJS) $(LIBS) -Wl,-Map=$(NAME)".map" -Wl,-lm -mmcu=atxmega32a4u -Wl,--gc-sections -Wl,--relax - $(AVRDIR)/bin/avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature $(NAME)".elf" $(NAME)".hex" - $(AVRDIR)/bin/avr-objdump -h -S $(NAME)".elf" > $(NAME)".lss" - $(AVRDIR)/bin/avr-objcopy -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O binary $(NAME)".elf" $(NAME)".eep" || exit 0 - $(AVRDIR)/bin/avr-objcopy -O srec -R .eeprom -R .fuse -R .lock -R .signature $(NAME)".elf" $(NAME)".srec" - $(AVRDIR)/bin/avr-size $(NAME)".elf" - @echo Finished successfully: $(NAME) - -VARIANTS = 0x01 0x02 -clean : - -rm -rf $(OBJS_AS_ARGS) $(EXECUTABLES) - -rm -rf $(C_DEPS_AS_ARGS) - $(foreach SUFFIX,$(VARIANTS), \ - rm -rf $(NAME).hex ; \ - rm -rf $(NAME).lss ; \ - rm -rf $(NAME).eep ; \ - rm -rf $(NAME).srec ; \ - rm -rf $(NAME).elf $(NAME).a $(NAME).map) diff --git a/AVR_Code/USB_BULK_TEST/src/globals.h b/AVR_Code/USB_BULK_TEST/src/globals.h index e85cc0b87..f2c00e808 100644 --- a/AVR_Code/USB_BULK_TEST/src/globals.h +++ b/AVR_Code/USB_BULK_TEST/src/globals.h @@ -13,7 +13,7 @@ //#define VERO #define OVERCLOCK 48 -#define FIRMWARE_VERSION_ID 0x0007 +// #define FIRMWARE_VERSION_ID 0x0007 #define ATMEL_DFU_OFFSET 0x01fc #define TC_SPISLAVE TCD0 @@ -71,4 +71,4 @@ extern const unsigned char variant; #include "unified_debug_structure.h" extern unified_debug uds; -#endif /* GLOBALS_H_ */ \ No newline at end of file +#endif /* GLOBALS_H_ */ diff --git a/Desktop_Interface/Labrador.pro b/Desktop_Interface/Labrador.pro index fc6d1b480..77659350f 100644 --- a/Desktop_Interface/Labrador.pro +++ b/Desktop_Interface/Labrador.pro @@ -32,6 +32,8 @@ equals(QCP_VER,"2"){ message("Using QCP2 with OpenGL support") } +DEFINES += "EXPECTED_FIRMWARE_VERSION=$${EXPECTED_FIRMWARE_VERSION}" + include(ui_elements.pri) MOC_DIR = moc diff --git a/Desktop_Interface/genericusbdriver.h b/Desktop_Interface/genericusbdriver.h index 95dcc7a57..3407a9344 100644 --- a/Desktop_Interface/genericusbdriver.h +++ b/Desktop_Interface/genericusbdriver.h @@ -16,7 +16,7 @@ //#include "buffercontrol.h" #include "unified_debug_structure.h" -#define EXPECTED_FIRMWARE_VERSION 0x0007 +//#define EXPECTED_FIRMWARE_VERSION 0x0007 #ifdef WINDOWS_64_BIT #define DEFINED_EXPECTED_VARIANT 1 From d7dccb84bb48ce07bc38623c2fe621af4709c132 Mon Sep 17 00:00:00 2001 From: brentfpage Date: Sun, 8 Feb 2026 15:16:09 -0800 Subject: [PATCH 02/19] stop-gap hard-coding of firmware version in mac.yml --- .github/workflows/mac.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 045a608d7..fef8eb610 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -67,19 +67,19 @@ jobs: - name: Build librador working-directory: Librador_API/___librador/librador run: | - qmake -config release EXPECTED_FIRMWARE_VERSION=${{ vars.AVR_VER }} + qmake -config release EXPECTED_FIRMWARE_VERSION=0x0007 make -j$(sysctl -n hw.ncpu) - name: Build librademo working-directory: Librador_API/___librador/librademo run: | - qmake -config release EXPECTED_FIRMWARE_VERSION=${{ vars.AVR_VER }} + qmake -config release EXPECTED_FIRMWARE_VERSION=0x0007 make -j$(sysctl -n hw.ncpu) - name: Build basicdemo working-directory: Librador_API/___librador/basicdemo run: | - qmake -config release EXPECTED_FIRMWARE_VERSION=${{ vars.AVR_VER }} + qmake -config release EXPECTED_FIRMWARE_VERSION=0x0007 make -j$(sysctl -n hw.ncpu) - name: Import code signing certificate @@ -111,10 +111,10 @@ jobs: working-directory: Desktop_Interface run: | if ( env.MACOS_CERTIFICATE != '' && env.MACOS_CERTIFICATE_PWD != '' ); then - qmake -config release EXPECTED_FIRMWARE_VERSION=${{ vars.AVR_VER }} + qmake -config release EXPECTED_FIRMWARE_VERSION=0x0007 else # for debugging - qmake -config debug EXPECTED_FIRMWARE_VERSION=${{ vars.AVR_VER }} + qmake -config debug EXPECTED_FIRMWARE_VERSION=0x0007 fi make -j$(sysctl -n hw.ncpu) macdeployqt Labrador.app -verbose=2 -libpath=build_mac/libdfuprog/lib/ From 5ed197b0514aa060de36269aeb56aa936788ec16 Mon Sep 17 00:00:00 2001 From: brentfpage Date: Sun, 15 Feb 2026 20:17:19 -0800 Subject: [PATCH 03/19] trying to define the avr firmware version using a workflow instead of a repo variable --- .github/workflows/avr_ver_def.yml | 7 +++++++ .github/workflows/mac.yml | 15 ++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/avr_ver_def.yml diff --git a/.github/workflows/avr_ver_def.yml b/.github/workflows/avr_ver_def.yml new file mode 100644 index 000000000..74607ae15 --- /dev/null +++ b/.github/workflows/avr_ver_def.yml @@ -0,0 +1,7 @@ +name: Define the firmware version + +on: + workflow_call: + firmware_ver: + description: the firmware version number 0x000N + value: 0x0007 diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index fef8eb610..6ccca88ce 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -15,6 +15,9 @@ on: pull_request: jobs: + retrieve_firmware_ver: + uses: ./.github/workflows/avr_ver_def.yml + build-dmg: runs-on: macos-15-intel steps: @@ -65,21 +68,27 @@ jobs: brew link libomp qt@5 --force - name: Build librador + needs: + - retrieve_firmware_ver working-directory: Librador_API/___librador/librador run: | - qmake -config release EXPECTED_FIRMWARE_VERSION=0x0007 + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ needs.retrieve_firmware_ver.outputs.firmware_ver}} make -j$(sysctl -n hw.ncpu) - name: Build librademo + needs: + - retrieve_firmware_ver working-directory: Librador_API/___librador/librademo run: | - qmake -config release EXPECTED_FIRMWARE_VERSION=0x0007 + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ needs.retrieve_firmware_ver.outputs.firmware_ver}} make -j$(sysctl -n hw.ncpu) - name: Build basicdemo + needs: + - retrieve_firmware_ver working-directory: Librador_API/___librador/basicdemo run: | - qmake -config release EXPECTED_FIRMWARE_VERSION=0x0007 + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ needs.retrieve_firmware_ver.outputs.firmware_ver}} make -j$(sysctl -n hw.ncpu) - name: Import code signing certificate From 73ac308b8090bd3b0c0de42b41e063047fa854d9 Mon Sep 17 00:00:00 2001 From: brentfpage Date: Sun, 15 Feb 2026 20:23:02 -0800 Subject: [PATCH 04/19] -needs- defined at job scope --- .github/workflows/mac.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 6ccca88ce..62f0f1e3e 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -19,6 +19,8 @@ jobs: uses: ./.github/workflows/avr_ver_def.yml build-dmg: + needs: + - retrieve_firmware_ver runs-on: macos-15-intel steps: - name: Checkout repository @@ -68,24 +70,18 @@ jobs: brew link libomp qt@5 --force - name: Build librador - needs: - - retrieve_firmware_ver working-directory: Librador_API/___librador/librador run: | qmake -config release EXPECTED_FIRMWARE_VERSION=${{ needs.retrieve_firmware_ver.outputs.firmware_ver}} make -j$(sysctl -n hw.ncpu) - name: Build librademo - needs: - - retrieve_firmware_ver working-directory: Librador_API/___librador/librademo run: | qmake -config release EXPECTED_FIRMWARE_VERSION=${{ needs.retrieve_firmware_ver.outputs.firmware_ver}} make -j$(sysctl -n hw.ncpu) - name: Build basicdemo - needs: - - retrieve_firmware_ver working-directory: Librador_API/___librador/basicdemo run: | qmake -config release EXPECTED_FIRMWARE_VERSION=${{ needs.retrieve_firmware_ver.outputs.firmware_ver}} From a676ad3107ee09d1f11623a63cad5350e3b6d506 Mon Sep 17 00:00:00 2001 From: brentfpage Date: Sun, 15 Feb 2026 20:25:05 -0800 Subject: [PATCH 05/19] typo fix --- .github/workflows/avr_ver_def.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/avr_ver_def.yml b/.github/workflows/avr_ver_def.yml index 74607ae15..fc713521c 100644 --- a/.github/workflows/avr_ver_def.yml +++ b/.github/workflows/avr_ver_def.yml @@ -2,6 +2,7 @@ name: Define the firmware version on: workflow_call: - firmware_ver: - description: the firmware version number 0x000N - value: 0x0007 + outputs: + firmware_ver: + description: the firmware version number 0x000N + value: 0x0007 From 24f8df9a2cc7d441dfd6ecc16d4f381bffa3f329 Mon Sep 17 00:00:00 2001 From: brentfpage Date: Sun, 15 Feb 2026 20:26:56 -0800 Subject: [PATCH 06/19] workflow file needs at least one job --- .github/workflows/avr_ver_def.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/avr_ver_def.yml b/.github/workflows/avr_ver_def.yml index fc713521c..d4f862ba3 100644 --- a/.github/workflows/avr_ver_def.yml +++ b/.github/workflows/avr_ver_def.yml @@ -5,4 +5,9 @@ on: outputs: firmware_ver: description: the firmware version number 0x000N - value: 0x0007 + value: ${{jobs.define_ver.outputs.ver_firmware}} + +jobs: + define_ver: + outputs: + ver_firmware: 0x0007 From 6e52a098442b12299beb64f65a527ec8b6a9577f Mon Sep 17 00:00:00 2001 From: brentfpage Date: Sun, 15 Feb 2026 20:27:45 -0800 Subject: [PATCH 07/19] job requires runs-on --- .github/workflows/avr_ver_def.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/avr_ver_def.yml b/.github/workflows/avr_ver_def.yml index d4f862ba3..90b63ddd1 100644 --- a/.github/workflows/avr_ver_def.yml +++ b/.github/workflows/avr_ver_def.yml @@ -9,5 +9,6 @@ on: jobs: define_ver: + runs-on: ubuntu-latest outputs: ver_firmware: 0x0007 From 940272269bf5aa0fb749dff3ced4fa4d8c2292d4 Mon Sep 17 00:00:00 2001 From: brentfpage Date: Sun, 15 Feb 2026 20:32:19 -0800 Subject: [PATCH 08/19] job requires a step --- .github/workflows/avr_ver_def.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/avr_ver_def.yml b/.github/workflows/avr_ver_def.yml index 90b63ddd1..b90f73bd8 100644 --- a/.github/workflows/avr_ver_def.yml +++ b/.github/workflows/avr_ver_def.yml @@ -5,10 +5,14 @@ on: outputs: firmware_ver: description: the firmware version number 0x000N - value: ${{jobs.define_ver.outputs.ver_firmware}} + value: ${{jobs.dummy_job.outputs.ver_firmware}} jobs: - define_ver: + dummy_job: runs-on: ubuntu-latest outputs: - ver_firmware: 0x0007 + ver_firmware: ${{ steps.dummy_step_id.outputs.AVR_VER }} + steps: + - name: export avr_ver + id: dummy_step_id + run: echo "AVR_VER=0x0007" >> "$GITHUB_OUTPUT" From 0aa47b2013ba12f335498e7777e00557c89af058 Mon Sep 17 00:00:00 2001 From: brentfpage Date: Sun, 15 Feb 2026 20:39:51 -0800 Subject: [PATCH 09/19] also call avr_ver_def.yml in avr.yml --- .github/workflows/avr.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/avr.yml b/.github/workflows/avr.yml index 330d8a632..55182f074 100644 --- a/.github/workflows/avr.yml +++ b/.github/workflows/avr.yml @@ -15,8 +15,13 @@ on: jobs: + retrieve_firmware_ver: + uses: ./.github/workflows/avr_ver_def.yml + build-hex: runs-on: ubuntu-latest + needs: + retrieve_firmware_ver outputs: output1: ${{ steps.step_get_run_id.outputs.RUN_ID }} steps: @@ -29,7 +34,7 @@ jobs: dir: AVR_Code target: '01' env: - FIRMWARE_VERSION_ID: ${{ vars.AVR_VER }} + FIRMWARE_VERSION_ID: ${{ needs.retrieve_firmware_ver.outputs.firmware_ver }} - name : make clean uses: bazhenov/action-avr-make@v1.1 @@ -43,7 +48,7 @@ jobs: dir: AVR_Code target: '02' env: - FIRMWARE_VERSION_ID: ${{ vars.AVR_VER }} + FIRMWARE_VERSION_ID: ${{ needs.retrieve_firmware_ver.outputs.firmware_ver }} - name: Upload hex artifacts uses: actions/upload-artifact@v4 From edcc8cb93d8d8e5dd2ad4f9afde400c9ba6fc66e Mon Sep 17 00:00:00 2001 From: brentfpage Date: Sun, 15 Feb 2026 20:59:28 -0800 Subject: [PATCH 10/19] had negelected to update 0x0007 to a soft-coded value in a few places --- .github/workflows/mac.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 62f0f1e3e..77d0cd46a 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -72,7 +72,7 @@ jobs: - name: Build librador working-directory: Librador_API/___librador/librador run: | - qmake -config release EXPECTED_FIRMWARE_VERSION=${{ needs.retrieve_firmware_ver.outputs.firmware_ver}} + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ needs.retrieve_firmware_ver.outputs.firmware_ver }} make -j$(sysctl -n hw.ncpu) - name: Build librademo @@ -116,10 +116,10 @@ jobs: working-directory: Desktop_Interface run: | if ( env.MACOS_CERTIFICATE != '' && env.MACOS_CERTIFICATE_PWD != '' ); then - qmake -config release EXPECTED_FIRMWARE_VERSION=0x0007 + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ needs.retrieve_firmware_ver.outputs.firmware_ver}} else # for debugging - qmake -config debug EXPECTED_FIRMWARE_VERSION=0x0007 + qmake -config debug EXPECTED_FIRMWARE_VERSION=${{ needs.retrieve_firmware_ver.outputs.firmware_ver}} fi make -j$(sysctl -n hw.ncpu) macdeployqt Labrador.app -verbose=2 -libpath=build_mac/libdfuprog/lib/ From db1b848fe7238f958353c92942309aed8418cd77 Mon Sep 17 00:00:00 2001 From: brentfpage Date: Sun, 22 Feb 2026 17:30:02 -0800 Subject: [PATCH 11/19] move the avr url fetching from mac.yml to a standalone workflow --- .github/workflows/fetch_avr_url.yml | 42 +++++++++++++++++++++++++++++ .github/workflows/mac.yml | 28 ++++++------------- 2 files changed, 50 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/fetch_avr_url.yml diff --git a/.github/workflows/fetch_avr_url.yml b/.github/workflows/fetch_avr_url.yml new file mode 100644 index 000000000..8fb614974 --- /dev/null +++ b/.github/workflows/fetch_avr_url.yml @@ -0,0 +1,42 @@ +name: Determine the url of an avr hex file from the most recent continuous release + +on: + workflow_call: + inputs: + AVR_VARIANT: + required: true + type: string + outputs: + avr_url: + description: the url of an avr hex file from the most recent continuous release + value: ${{jobs.query_url.outputs.url_hex}} + +jobs: + query_url: + runs-on: ubuntu-latest + outputs: + url_hex: ${{ steps.run_query.outputs.HEX_URL }} + steps: + - name: submit graphql query + id: run_query + run: | + HEX_URL=$(gh api graphql -f query='query {repository ( owner : "brentfpage", name: "Labrador") {release ( tagName: "continuous" ) {releaseAssets(first:10) {nodes {downloadUrl}}}}}' | jq -r '.data.repository.release.releaseAssets.nodes[] | select(.downloadUrl| test("${{ inputs.AVR_VARIANT }}.hex")) | .[]') + echo "HEX_URL=${HEX_URL}" >> "$GITHUB_OUTPUT" + env: + GH_TOKEN: ${{ github.token }} + +# query description: get at most 10 assets from the most recent continuous release (assume there are fewer than 10), find the one that includes AVR_VARIANT.hex in the download url +# prettified (ish) query: +# query {\ +# repository ( owner : "espotek-org", name: "Labrador") {\ +# release ( tagName: "continuous" ) {\ +# releaseAssets(first:10) {\ +# nodes {\ +# downloadUrl\ +# }\ +# }\ +# }\ +# }\ +# }\ +# ' | jq -r '.data.repository.release.releaseAssets.nodes[] | select(.downloadUrl| test("${{ inputs.AVR_VARIANT }}.hex")) | .[]' + diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 77d0cd46a..0938b9c6c 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -18,9 +18,16 @@ jobs: retrieve_firmware_ver: uses: ./.github/workflows/avr_ver_def.yml + # when the build is not part of a continuous release, the avr hex from the most recent continuous release will be packaged with the mac dmg. + fetch_firmware_url: + uses: ./.github/workflows/fetch_avr_url.yml + with: + AVR_VARIANT: '02' + build-dmg: needs: - retrieve_firmware_ver + - fetch_firmware_url # technically only needed when not a continuous release runs-on: macos-15-intel steps: - name: Checkout repository @@ -30,26 +37,7 @@ jobs: if: github.event.workflow != '.github/workflows/continuous.yml' run: | mkdir asset-hex - HEX_URL=$(gh api graphql -f query='query {repository ( owner : "brentfpage", name: "Labrador") {release ( tagName: "continuous" ) {releaseAssets(first:10) {nodes {downloadUrl}}}}}' | jq -r '.data.repository.release.releaseAssets.nodes[] | select(.downloadUrl| test("02.hex")) | .[]') - wget --directory-prefix=asset-hex $HEX_URL - env: - GH_TOKEN: ${{ github.token }} - -# better alternative to the graphql query above would be to somehow retrieve the run-id of the most recent continuous.yml workflow run, then download the hex asset associated with the run-id using actions/download-artifact. -# query description: get at most 10 assets from the most recent continuous release (assume there are fewer than 10), find the one that includes 02.hex in the download url -# prettified (ish) query: -# query {\ -# repository ( owner : "espotek-org", name: "Labrador") {\ -# release ( tagName: "continuous" ) {\ -# releaseAssets(first:10) {\ -# nodes {\ -# downloadUrl\ -# }\ -# }\ -# }\ -# }\ -# }\ -# ' | jq -r '.data.repository.release.releaseAssets.nodes[] | select(.downloadUrl| test("02.hex")) | .[]' + wget --directory-prefix=asset-hex ${{ needs.fetch_firmware_url.outputs.avr_url }} - name: Download firmware from in-process continuous release if: github.event.workflow == '.github/workflows/continuous.yml' From f5409f6566a5da56c4a663f812bba311e45010cc Mon Sep 17 00:00:00 2001 From: brentfpage Date: Tue, 24 Feb 2026 00:21:02 -0800 Subject: [PATCH 12/19] move steps for downloading the firmware to a single composite action --- .../download-firmware-action/action.yml | 73 +++++++++++++++++++ .github/workflows/avr_ver_def.yml | 18 ----- .github/workflows/fetch_avr_url.yml | 42 ----------- .github/workflows/mac.yml | 42 +++-------- 4 files changed, 83 insertions(+), 92 deletions(-) create mode 100644 .github/actions/download-firmware-action/action.yml delete mode 100644 .github/workflows/avr_ver_def.yml delete mode 100644 .github/workflows/fetch_avr_url.yml diff --git a/.github/actions/download-firmware-action/action.yml b/.github/actions/download-firmware-action/action.yml new file mode 100644 index 000000000..7e556be02 --- /dev/null +++ b/.github/actions/download-firmware-action/action.yml @@ -0,0 +1,73 @@ +name: Define the firmware version + +inputs: + AVR_VARIANT: + required: true + type: string + AVR_RUN_ID: + required: false + type: string + +outputs: + firmware_ver: + description: the firmware version number 0x000N + value: ${{ steps.define_firware_ver.outputs.firmware_ver }} + +runs: + using: "composite" + steps: + - name: define firware_ver + id: define_firware_ver + run: echo "firmware_ver=0x0007" >> $GITHUB_OUTPUT + shell: bash + +# when the build is NOT part of a continuous release, the firware hex from the most recent continuous release will be packaged with the desktop interface + - name: submit graphql query + if: github.event.workflow != '.github/workflows/continuous.yml' + id: run_query + run: | + HEX_URL=$(gh api graphql -f query='query {repository ( owner : "brentfpage", name: "Labrador") {release ( tagName: "continuous" ) {releaseAssets(first:10) {nodes {downloadUrl}}}}}' | jq -r '.data.repository.release.releaseAssets.nodes[] | select(.downloadUrl| test("${{ inputs.FIRMWARE_VARIANT }}.hex")) | .[]') + echo "firmware_url=${HEX_URL}" >> $GITHUB_OUTPUT + env: + GH_TOKEN: ${{ github.token }} + shell: bash + +# query description: get at most 10 assets from the most recent continuous release (assume there are fewer than 10), find the one that includes AVR_VARIANT.hex in the download url +# prettified (ish) query: +# query {\ +# repository ( owner : "espotek-org", name: "Labrador") {\ +# release ( tagName: "continuous" ) {\ +# releaseAssets(first:10) {\ +# nodes {\ +# downloadUrl\ +# }\ +# }\ +# }\ +# }\ +# }\ +# ' | jq -r '.data.repository.release.releaseAssets.nodes[] | select(.downloadUrl| test("${{ inputs.AVR_VARIANT }}.hex")) | .[]' + + - name: Download firmware from most recent continuous release + if: github.event.workflow != '.github/workflows/continuous.yml' + run: | + mkdir asset-hex + wget --directory-prefix=asset-hex ${{ steps.run_query.outputs.firmware_url }} + shell: bash + +# when the build is part of a continuous release, the release's avr hex will be packaged with the desktop interface + - name: Download firmware from in-process continuous release + if: github.event.workflow == '.github/workflows/continuous.yml' + uses: actions/download-artifact@v4 + with: + run-id: ${{ inputs.AVR_RUN_ID }} + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: move firmware to appropriate directory + run: | + mv asset-hex/*${{ inputs.AVR_VARIANT }}.hex Desktop_Interface/resources/firmware + shell: bash + + + + + diff --git a/.github/workflows/avr_ver_def.yml b/.github/workflows/avr_ver_def.yml deleted file mode 100644 index b90f73bd8..000000000 --- a/.github/workflows/avr_ver_def.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Define the firmware version - -on: - workflow_call: - outputs: - firmware_ver: - description: the firmware version number 0x000N - value: ${{jobs.dummy_job.outputs.ver_firmware}} - -jobs: - dummy_job: - runs-on: ubuntu-latest - outputs: - ver_firmware: ${{ steps.dummy_step_id.outputs.AVR_VER }} - steps: - - name: export avr_ver - id: dummy_step_id - run: echo "AVR_VER=0x0007" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/fetch_avr_url.yml b/.github/workflows/fetch_avr_url.yml deleted file mode 100644 index 8fb614974..000000000 --- a/.github/workflows/fetch_avr_url.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Determine the url of an avr hex file from the most recent continuous release - -on: - workflow_call: - inputs: - AVR_VARIANT: - required: true - type: string - outputs: - avr_url: - description: the url of an avr hex file from the most recent continuous release - value: ${{jobs.query_url.outputs.url_hex}} - -jobs: - query_url: - runs-on: ubuntu-latest - outputs: - url_hex: ${{ steps.run_query.outputs.HEX_URL }} - steps: - - name: submit graphql query - id: run_query - run: | - HEX_URL=$(gh api graphql -f query='query {repository ( owner : "brentfpage", name: "Labrador") {release ( tagName: "continuous" ) {releaseAssets(first:10) {nodes {downloadUrl}}}}}' | jq -r '.data.repository.release.releaseAssets.nodes[] | select(.downloadUrl| test("${{ inputs.AVR_VARIANT }}.hex")) | .[]') - echo "HEX_URL=${HEX_URL}" >> "$GITHUB_OUTPUT" - env: - GH_TOKEN: ${{ github.token }} - -# query description: get at most 10 assets from the most recent continuous release (assume there are fewer than 10), find the one that includes AVR_VARIANT.hex in the download url -# prettified (ish) query: -# query {\ -# repository ( owner : "espotek-org", name: "Labrador") {\ -# release ( tagName: "continuous" ) {\ -# releaseAssets(first:10) {\ -# nodes {\ -# downloadUrl\ -# }\ -# }\ -# }\ -# }\ -# }\ -# ' | jq -r '.data.repository.release.releaseAssets.nodes[] | select(.downloadUrl| test("${{ inputs.AVR_VARIANT }}.hex")) | .[]' - diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 0938b9c6c..f20ba663d 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -15,40 +15,18 @@ on: pull_request: jobs: - retrieve_firmware_ver: - uses: ./.github/workflows/avr_ver_def.yml - - # when the build is not part of a continuous release, the avr hex from the most recent continuous release will be packaged with the mac dmg. - fetch_firmware_url: - uses: ./.github/workflows/fetch_avr_url.yml - with: - AVR_VARIANT: '02' - build-dmg: - needs: - - retrieve_firmware_ver - - fetch_firmware_url # technically only needed when not a continuous release runs-on: macos-15-intel steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Download firmware from most recent continuous release - if: github.event.workflow != '.github/workflows/continuous.yml' - run: | - mkdir asset-hex - wget --directory-prefix=asset-hex ${{ needs.fetch_firmware_url.outputs.avr_url }} - - - name: Download firmware from in-process continuous release - if: github.event.workflow == '.github/workflows/continuous.yml' - uses: actions/download-artifact@v4 + - name: Download firmware + id: download_firmware + uses: ./.github/actions/download-firmware-action with: - run-id: ${{ inputs.AVR_RUN_ID }} - github-token: ${{ secrets.GITHUB_TOKEN }} - - - name: move firmware to appropriate directory - run: | - mv asset-hex/*02.hex Desktop_Interface/resources/firmware + AVR_VARIANT: '02' + AVR_RUN_ID: ${{ inputs.AVR_RUN_ID }} # for grabbing the firmware from an in-process continuous release - name: Setup Homebrew dependencies run: | @@ -60,19 +38,19 @@ jobs: - name: Build librador working-directory: Librador_API/___librador/librador run: | - qmake -config release EXPECTED_FIRMWARE_VERSION=${{ needs.retrieve_firmware_ver.outputs.firmware_ver }} + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver }} make -j$(sysctl -n hw.ncpu) - name: Build librademo working-directory: Librador_API/___librador/librademo run: | - qmake -config release EXPECTED_FIRMWARE_VERSION=${{ needs.retrieve_firmware_ver.outputs.firmware_ver}} + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver}} make -j$(sysctl -n hw.ncpu) - name: Build basicdemo working-directory: Librador_API/___librador/basicdemo run: | - qmake -config release EXPECTED_FIRMWARE_VERSION=${{ needs.retrieve_firmware_ver.outputs.firmware_ver}} + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver}} make -j$(sysctl -n hw.ncpu) - name: Import code signing certificate @@ -104,10 +82,10 @@ jobs: working-directory: Desktop_Interface run: | if ( env.MACOS_CERTIFICATE != '' && env.MACOS_CERTIFICATE_PWD != '' ); then - qmake -config release EXPECTED_FIRMWARE_VERSION=${{ needs.retrieve_firmware_ver.outputs.firmware_ver}} + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver}} else # for debugging - qmake -config debug EXPECTED_FIRMWARE_VERSION=${{ needs.retrieve_firmware_ver.outputs.firmware_ver}} + qmake -config debug EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver}} fi make -j$(sysctl -n hw.ncpu) macdeployqt Labrador.app -verbose=2 -libpath=build_mac/libdfuprog/lib/ From 82d7b5d99247d8bf20765fb2d3497e4df3416916 Mon Sep 17 00:00:00 2001 From: brentfpage Date: Tue, 24 Feb 2026 00:32:27 -0800 Subject: [PATCH 13/19] notation change: avr->firmware --- .../actions/download-firmware-action/action.yml | 14 +++++++------- .github/workflows/continuous.yml | 16 ++++++++-------- .github/workflows/{avr.yml => firmware.yml} | 0 .github/workflows/mac.yml | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) rename .github/workflows/{avr.yml => firmware.yml} (100%) diff --git a/.github/actions/download-firmware-action/action.yml b/.github/actions/download-firmware-action/action.yml index 7e556be02..16967315c 100644 --- a/.github/actions/download-firmware-action/action.yml +++ b/.github/actions/download-firmware-action/action.yml @@ -1,10 +1,10 @@ name: Define the firmware version inputs: - AVR_VARIANT: + FIRMWARE_VARIANT: required: true type: string - AVR_RUN_ID: + FIRMWARE_RUN_ID: required: false type: string @@ -32,7 +32,7 @@ runs: GH_TOKEN: ${{ github.token }} shell: bash -# query description: get at most 10 assets from the most recent continuous release (assume there are fewer than 10), find the one that includes AVR_VARIANT.hex in the download url +# query description: get at most 10 assets from the most recent continuous release (assume there are fewer than 10), find the one that includes FIRMWARE_VARIANT.hex in the download url # prettified (ish) query: # query {\ # repository ( owner : "espotek-org", name: "Labrador") {\ @@ -45,7 +45,7 @@ runs: # }\ # }\ # }\ -# ' | jq -r '.data.repository.release.releaseAssets.nodes[] | select(.downloadUrl| test("${{ inputs.AVR_VARIANT }}.hex")) | .[]' +# ' | jq -r '.data.repository.release.releaseAssets.nodes[] | select(.downloadUrl| test("${{ inputs.FIRMWARE_VARIANT }}.hex")) | .[]' - name: Download firmware from most recent continuous release if: github.event.workflow != '.github/workflows/continuous.yml' @@ -54,17 +54,17 @@ runs: wget --directory-prefix=asset-hex ${{ steps.run_query.outputs.firmware_url }} shell: bash -# when the build is part of a continuous release, the release's avr hex will be packaged with the desktop interface +# when the build is part of a continuous release, the release's firmware hex will be packaged with the desktop interface - name: Download firmware from in-process continuous release if: github.event.workflow == '.github/workflows/continuous.yml' uses: actions/download-artifact@v4 with: - run-id: ${{ inputs.AVR_RUN_ID }} + run-id: ${{ inputs.FIRMWARE_RUN_ID }} github-token: ${{ secrets.GITHUB_TOKEN }} - name: move firmware to appropriate directory run: | - mv asset-hex/*${{ inputs.AVR_VARIANT }}.hex Desktop_Interface/resources/firmware + mv asset-hex/*${{ inputs.FIRMWARE_VARIANT }}.hex Desktop_Interface/resources/firmware shell: bash diff --git a/.github/workflows/continuous.yml b/.github/workflows/continuous.yml index d225e5b98..8fa0a54ec 100644 --- a/.github/workflows/continuous.yml +++ b/.github/workflows/continuous.yml @@ -8,38 +8,38 @@ on: workflow_dispatch: jobs: - build-avr: - uses: ./.github/workflows/avr.yml + build-firmware: + uses: ./.github/workflows/firmware.yml secrets: inherit # build-android: # uses: ./.github/workflows/android.yml # secrets: inherit # needs: -# - build-avr +# - build-firmware # build-linux: # uses: ./.github/workflows/linux.yml # secrets: inherit # needs: -# - build-avr +# - build-firmware build-mac: needs: - - build-avr + - build-firmware uses: ./.github/workflows/mac.yml with: - AVR_RUN_ID: ${{ needs.build-avr.outputs.firstword }} + FIRMWARE_RUN_ID: ${{ needs.build-firmware.outputs.firstword }} secrets: inherit # build-windows: # uses: ./.github/workflows/windows.yml # secrets: inherit # needs: -# - build-avr +# - build-firmware release: permissions: contents: write needs: - - build-avr + - build-firmware # - build-android # - build-linux - build-mac diff --git a/.github/workflows/avr.yml b/.github/workflows/firmware.yml similarity index 100% rename from .github/workflows/avr.yml rename to .github/workflows/firmware.yml diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index c17e4331f..d1f4f1f23 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -8,7 +8,7 @@ on: workflow_dispatch: workflow_call: inputs: - AVR_RUN_ID: + FIRMWARE_RUN_ID: required: true type: string push: @@ -37,8 +37,8 @@ jobs: id: download_firmware uses: ./.github/actions/download-firmware-action with: - AVR_VARIANT: '02' - AVR_RUN_ID: ${{ inputs.AVR_RUN_ID }} # for grabbing the firmware from an in-process continuous release + FIRMWARE_VARIANT: '02' + FIRMWARE_RUN_ID: ${{ inputs.FIRMWARE_RUN_ID }} # for grabbing the firmware from an in-process continuous release - name: Setup Homebrew dependencies run: | From c38f72f815eca824896d349db69f3b786f02b0a9 Mon Sep 17 00:00:00 2001 From: brentfpage Date: Tue, 24 Feb 2026 00:53:55 -0800 Subject: [PATCH 14/19] remove continuous release compatibility for now --- .github/workflows/mac.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index d1f4f1f23..1559515ad 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -38,7 +38,7 @@ jobs: uses: ./.github/actions/download-firmware-action with: FIRMWARE_VARIANT: '02' - FIRMWARE_RUN_ID: ${{ inputs.FIRMWARE_RUN_ID }} # for grabbing the firmware from an in-process continuous release +# FIRMWARE_RUN_ID: ${{ inputs.FIRMWARE_RUN_ID }} # for grabbing the firmware from an in-process continuous release - name: Setup Homebrew dependencies run: | From 45761f44258fce31470b1eb1dfe30b56cfb6bf83 Mon Sep 17 00:00:00 2001 From: brentfpage Date: Tue, 24 Feb 2026 00:56:49 -0800 Subject: [PATCH 15/19] trying to add automatic firmware packaging in android.yml --- .github/workflows/android.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index b2c58e7c2..a9c2d711e 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -7,6 +7,10 @@ permissions: on: workflow_dispatch: workflow_call: + inputs: + FIRMWARE_RUN_ID: + required: true + type: string push: branches: @@ -31,6 +35,13 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Download firmware + id: download_firmware + uses: ./.github/actions/download-firmware-action + with: + FIRMWARE_VARIANT: '02' +# FIRMWARE_RUN_ID: ${{ inputs.FIRMWARE_RUN_ID }} # for grabbing the firmware from an in-process continuous release + - name: Install Qt uses: jurplel/install-qt-action@v4 with: @@ -74,13 +85,13 @@ jobs: export ANDROID_NDK_ROOT="${ANDROID_SDK_ROOT}/ndk/21.3.6528147" APK_BASENAME="Labrador-$(git rev-parse --short HEAD)" if [ -e cert.cer ] && [ -e cert.p8 ]; then - qmake -config release + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver }} make -j$(nproc) make INSTALL_ROOT=android-build install JAVA_HOME=${JAVA_HOME_8_X64} androiddeployqt --input android-Labrador-deployment-settings.json --output android-build --aab --android-platform android-31 --verbose --gradle --release ${ANDROID_SDK_ROOT}/build-tools/31.0.0/apksigner sign --in android-build/build/outputs/apk/release/android-build-release-unsigned.apk --out ${APK_BASENAME}-release-signed.apk --key cert.p8 --cert cert.cer --verbose else - qmake -config debug + qmake -config debug EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver }} make -j$(nproc) make INSTALL_ROOT=android-build install JAVA_HOME=${JAVA_HOME_8_X64} androiddeployqt --input android-Labrador-deployment-settings.json --output android-build --aab --android-platform android-31 --verbose --gradle From 3bcbd9a8167c3cc157a7270d0ee67630e7eabf14 Mon Sep 17 00:00:00 2001 From: brentfpage Date: Tue, 24 Feb 2026 01:03:25 -0800 Subject: [PATCH 16/19] trying to add automatic firmware packaging in linux.yml --- .github/workflows/linux.yml | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index ce0c12ac0..cdb207822 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -7,6 +7,10 @@ permissions: on: workflow_dispatch: workflow_call: + inputs: + FIRMWARE_RUN_ID: + required: true + type: string push: branches: @@ -37,6 +41,13 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Download firmware + id: download_firmware + uses: ./.github/actions/download-firmware-action + with: + FIRMWARE_VARIANT: '02' +# FIRMWARE_RUN_ID: ${{ inputs.FIRMWARE_RUN_ID }} # for grabbing the firmware from an in-process continuous release + - name: Install dependencies run: | sudo apt-get update @@ -46,19 +57,19 @@ jobs: - name: Build librador working-directory: Librador_API/___librador/librador run: | - qmake -config release + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver }} make -j$(nproc) - name: Build librademo working-directory: Librador_API/___librador/librademo run: | - qmake -config release + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver }} make -j$(nproc) - name: Build basicdemo working-directory: Librador_API/___librador/basicdemo run: | - qmake -config release + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver }} make -j$(nproc) - name: Build AppImage @@ -88,6 +99,13 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Download firmware + id: download_firmware + uses: ./.github/actions/download-firmware-action + with: + FIRMWARE_VARIANT: '02' +# FIRMWARE_RUN_ID: ${{ inputs.FIRMWARE_RUN_ID }} # for grabbing the firmware from an in-process continuous release + - name: Install dependencies run: | sudo apt-get update @@ -97,19 +115,19 @@ jobs: - name: Build librador working-directory: Librador_API/___librador/librador run: | - qmake -config release + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver }} make -j$(nproc) - name: Build librademo working-directory: Librador_API/___librador/librademo run: | - qmake -config release + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver }} make -j$(nproc) - name: Build basicdemo working-directory: Librador_API/___librador/basicdemo run: | - qmake -config release + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver }} make -j$(nproc) - name: Build Debian package From 560865e4e97351c7017cb1deb2b7b358cbcf883b Mon Sep 17 00:00:00 2001 From: brentfpage Date: Tue, 24 Feb 2026 10:34:45 -0800 Subject: [PATCH 17/19] add references to EXPECTED_FIRMWARE_VERSION in linux build scripts --- .github/workflows/linux.yml | 2 ++ Desktop_Interface/debian/rules | 2 +- Desktop_Interface/make_appimage | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index cdb207822..328fc98b6 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -75,6 +75,7 @@ jobs: - name: Build AppImage working-directory: Desktop_Interface run: | + export EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver }} ./make_appimage - name: Upload artifacts @@ -133,6 +134,7 @@ jobs: - name: Build Debian package working-directory: Desktop_Interface run: | + export EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver }} DEB_BUILD_OPTIONS=nostrip dpkg-buildpackage -b mv ../espotek-labrador*.deb ../Labrador-$(git rev-parse --short HEAD)-${{ matrix.arch }}.deb diff --git a/Desktop_Interface/debian/rules b/Desktop_Interface/debian/rules index 0e5fbef48..1a130c5f3 100755 --- a/Desktop_Interface/debian/rules +++ b/Desktop_Interface/debian/rules @@ -18,7 +18,7 @@ export QT_SELECT = qt5 dh $@ override_dh_auto_configure: - dh_auto_configure -- -config release + dh_auto_configure -- -config release EXPECTED_FIRMWARE_VERSION=$(EXPECTED_FIRMWARE_VERSION) # Changelog is intentionally empty for rolling release, don't install it. override_dh_installchangelogs: diff --git a/Desktop_Interface/make_appimage b/Desktop_Interface/make_appimage index 2b254b3cd..4e9efbb06 100755 --- a/Desktop_Interface/make_appimage +++ b/Desktop_Interface/make_appimage @@ -4,7 +4,7 @@ set -e rm -rf AppDir export QT_SELECT=qt5 -qmake -config release PREFIX=/usr +qmake -config release PREFIX=/usr EXPECTED_FIRMWARE_VERSION=$EXPECTED_FIRMWARE_VERSION make -j$(nproc) make INSTALL_ROOT=AppDir install ; find AppDir/ cp -r build_linux/apprun-hooks AppDir/ From 124fd398de94d9afe4875068c642b25416c6c714 Mon Sep 17 00:00:00 2001 From: brentfpage Date: Tue, 24 Feb 2026 11:46:53 -0800 Subject: [PATCH 18/19] re-separate define-firmware-ver-action so that it can be invoked by firmware.yml --- .../define-firmware-ver-action/action.yml | 14 +++ .../download-firmware-action/action.yml | 14 +-- .github/workflows/android.yml | 8 +- .github/workflows/continuous.yml | 36 ++++---- .github/workflows/firmware.yml | 87 +++++++++---------- .github/workflows/linux.yml | 24 +++-- .github/workflows/mac.yml | 14 +-- 7 files changed, 111 insertions(+), 86 deletions(-) create mode 100644 .github/actions/define-firmware-ver-action/action.yml diff --git a/.github/actions/define-firmware-ver-action/action.yml b/.github/actions/define-firmware-ver-action/action.yml new file mode 100644 index 000000000..078ef6b6d --- /dev/null +++ b/.github/actions/define-firmware-ver-action/action.yml @@ -0,0 +1,14 @@ +name: Define the firmware version + +outputs: + firmware_ver: + description: the firmware version number 0x000N + value: ${{ steps.define_firmware_ver.outputs.firmware_ver }} + +runs: + using: "composite" + steps: + - name: define firmware_ver + id: define_firmware_ver + run: echo "firmware_ver=0x0007" >> $GITHUB_OUTPUT + shell: bash diff --git a/.github/actions/download-firmware-action/action.yml b/.github/actions/download-firmware-action/action.yml index 16967315c..72a839c82 100644 --- a/.github/actions/download-firmware-action/action.yml +++ b/.github/actions/download-firmware-action/action.yml @@ -1,4 +1,4 @@ -name: Define the firmware version +name: Download the firmware inputs: FIRMWARE_VARIANT: @@ -8,21 +8,11 @@ inputs: required: false type: string -outputs: - firmware_ver: - description: the firmware version number 0x000N - value: ${{ steps.define_firware_ver.outputs.firmware_ver }} - runs: using: "composite" steps: - - name: define firware_ver - id: define_firware_ver - run: echo "firmware_ver=0x0007" >> $GITHUB_OUTPUT - shell: bash - # when the build is NOT part of a continuous release, the firware hex from the most recent continuous release will be packaged with the desktop interface - - name: submit graphql query + - name: Determine download url for the firmware from the most recent continuous release if: github.event.workflow != '.github/workflows/continuous.yml' id: run_query run: | diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index a9c2d711e..ab13d9fed 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -35,6 +35,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Define firmware version + id: define_firmware_version + uses: ./.github/actions/define-firmware-ver-action + - name: Download firmware id: download_firmware uses: ./.github/actions/download-firmware-action @@ -85,13 +89,13 @@ jobs: export ANDROID_NDK_ROOT="${ANDROID_SDK_ROOT}/ndk/21.3.6528147" APK_BASENAME="Labrador-$(git rev-parse --short HEAD)" if [ -e cert.cer ] && [ -e cert.p8 ]; then - qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver }} + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }} make -j$(nproc) make INSTALL_ROOT=android-build install JAVA_HOME=${JAVA_HOME_8_X64} androiddeployqt --input android-Labrador-deployment-settings.json --output android-build --aab --android-platform android-31 --verbose --gradle --release ${ANDROID_SDK_ROOT}/build-tools/31.0.0/apksigner sign --in android-build/build/outputs/apk/release/android-build-release-unsigned.apk --out ${APK_BASENAME}-release-signed.apk --key cert.p8 --cert cert.cer --verbose else - qmake -config debug EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver }} + qmake -config debug EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }} make -j$(nproc) make INSTALL_ROOT=android-build install JAVA_HOME=${JAVA_HOME_8_X64} androiddeployqt --input android-Labrador-deployment-settings.json --output android-build --aab --android-platform android-31 --verbose --gradle diff --git a/.github/workflows/continuous.yml b/.github/workflows/continuous.yml index 8fa0a54ec..692bac055 100644 --- a/.github/workflows/continuous.yml +++ b/.github/workflows/continuous.yml @@ -11,37 +11,43 @@ jobs: build-firmware: uses: ./.github/workflows/firmware.yml secrets: inherit -# build-android: -# uses: ./.github/workflows/android.yml -# secrets: inherit -# needs: -# - build-firmware -# build-linux: -# uses: ./.github/workflows/linux.yml -# secrets: inherit -# needs: -# - build-firmware + build-android: + needs: + - build-firmware + uses: ./.github/workflows/android.yml + with: + FIRMWARE_RUN_ID: ${{ needs.build-firmware.outputs.run_id }} + secrets: inherit + build-linux: + needs: + - build-firmware + uses: ./.github/workflows/linux.yml + with: + FIRMWARE_RUN_ID: ${{ needs.build-firmware.outputs.run_id }} + secrets: inherit build-mac: needs: - build-firmware uses: ./.github/workflows/mac.yml with: - FIRMWARE_RUN_ID: ${{ needs.build-firmware.outputs.firstword }} + FIRMWARE_RUN_ID: ${{ needs.build-firmware.outputs.run_id }} secrets: inherit # build-windows: -# uses: ./.github/workflows/windows.yml -# secrets: inherit # needs: # - build-firmware +# uses: ./.github/workflows/windows.yml +# with: +# FIRMWARE_RUN_ID: ${{ needs.build-firmware.outputs.run_id }} +# secrets: inherit release: permissions: contents: write needs: - build-firmware -# - build-android -# - build-linux + - build-android + - build-linux - build-mac # - build-windows if: github.ref == 'refs/heads/master' diff --git a/.github/workflows/firmware.yml b/.github/workflows/firmware.yml index 55182f074..3750d582d 100644 --- a/.github/workflows/firmware.yml +++ b/.github/workflows/firmware.yml @@ -7,57 +7,56 @@ permissions: on: workflow_call: outputs: - firstword: + run_id: description: the run-id of the workflow run - value: ${{ jobs.build-hex.outputs.output1 }} + value: ${{ jobs.build-hex.outputs.run_id }} workflow_dispatch: push: jobs: - retrieve_firmware_ver: - uses: ./.github/workflows/avr_ver_def.yml - build-hex: runs-on: ubuntu-latest - needs: - retrieve_firmware_ver outputs: - output1: ${{ steps.step_get_run_id.outputs.RUN_ID }} + run_id: ${{ steps.step_get_run_id.outputs.RUN_ID }} steps: - - name : Checkout repository - uses: actions/checkout@v4 - - - name : make 01 - uses: bazhenov/action-avr-make@v1.1 - with: - dir: AVR_Code - target: '01' - env: - FIRMWARE_VERSION_ID: ${{ needs.retrieve_firmware_ver.outputs.firmware_ver }} - - - name : make clean - uses: bazhenov/action-avr-make@v1.1 - with: - dir: AVR_Code - target: clean_o_d - - - name : make 02 - uses: bazhenov/action-avr-make@v1.1 - with: - dir: AVR_Code - target: '02' - env: - FIRMWARE_VERSION_ID: ${{ needs.retrieve_firmware_ver.outputs.firmware_ver }} - - - name: Upload hex artifacts - uses: actions/upload-artifact@v4 - with: - name: asset-hex - path: AVR_Code/labrafirm*.hex - compression-level: 0 - if-no-files-found: error - - - name: Prepare workflow run ID output - id: step_get_run_id - run: echo "RUN_ID=${{ github.run_id }}" >> "$GITHUB_OUTPUT" + - name : Checkout repository + uses: actions/checkout@v4 + + - name: Define firmware version + id: define_firmware_version + uses: ./.github/actions/define-firmware-ver-action + + - name : make 01 + uses: bazhenov/action-avr-make@v1.1 + with: + dir: AVR_Code + target: '01' + env: + FIRMWARE_VERSION_ID: ${{ steps.define_firmware_version.outputs.firmware_ver }} + + - name : make clean + uses: bazhenov/action-avr-make@v1.1 + with: + dir: AVR_Code + target: clean_o_d + + - name : make 02 + uses: bazhenov/action-avr-make@v1.1 + with: + dir: AVR_Code + target: '02' + env: + FIRMWARE_VERSION_ID: ${{ steps.define_firmware_version.outputs.firmware_ver }} + + - name: Upload hex artifacts + uses: actions/upload-artifact@v4 + with: + name: asset-hex + path: AVR_Code/labrafirm*.hex + compression-level: 0 + if-no-files-found: error + + - name: Prepare workflow run ID output + id: step_get_run_id + run: echo "RUN_ID=${{ github.run_id }}" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 328fc98b6..c480d8b87 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -41,6 +41,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Define firmware version + id: define_firmware_version + uses: ./.github/actions/define-firmware-ver-action + - name: Download firmware id: download_firmware uses: ./.github/actions/download-firmware-action @@ -57,25 +61,25 @@ jobs: - name: Build librador working-directory: Librador_API/___librador/librador run: | - qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver }} + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }} make -j$(nproc) - name: Build librademo working-directory: Librador_API/___librador/librademo run: | - qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver }} + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }} make -j$(nproc) - name: Build basicdemo working-directory: Librador_API/___librador/basicdemo run: | - qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver }} + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }} make -j$(nproc) - name: Build AppImage working-directory: Desktop_Interface run: | - export EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver }} + export EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }} ./make_appimage - name: Upload artifacts @@ -100,6 +104,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Define firmware version + id: define_firmware_version + uses: ./.github/actions/define-firmware-ver-action + - name: Download firmware id: download_firmware uses: ./.github/actions/download-firmware-action @@ -116,25 +124,25 @@ jobs: - name: Build librador working-directory: Librador_API/___librador/librador run: | - qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver }} + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }} make -j$(nproc) - name: Build librademo working-directory: Librador_API/___librador/librademo run: | - qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver }} + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }} make -j$(nproc) - name: Build basicdemo working-directory: Librador_API/___librador/basicdemo run: | - qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver }} + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }} make -j$(nproc) - name: Build Debian package working-directory: Desktop_Interface run: | - export EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver }} + export EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }} DEB_BUILD_OPTIONS=nostrip dpkg-buildpackage -b mv ../espotek-labrador*.deb ../Labrador-$(git rev-parse --short HEAD)-${{ matrix.arch }}.deb diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 1559515ad..b695e8abb 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -33,6 +33,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Define firmware version + id: define_firmware_version + uses: ./.github/actions/define-firmware-ver-action + - name: Download firmware id: download_firmware uses: ./.github/actions/download-firmware-action @@ -50,19 +54,19 @@ jobs: - name: Build librador working-directory: Librador_API/___librador/librador run: | - qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver }} + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }} make -j$(sysctl -n hw.ncpu) - name: Build librademo working-directory: Librador_API/___librador/librademo run: | - qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver}} + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver}} make -j$(sysctl -n hw.ncpu) - name: Build basicdemo working-directory: Librador_API/___librador/basicdemo run: | - qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver}} + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver}} make -j$(sysctl -n hw.ncpu) - name: Import code signing certificate @@ -90,10 +94,10 @@ jobs: working-directory: Desktop_Interface run: | if ( env.MACOS_CERTIFICATE != '' && env.MACOS_CERTIFICATE_PWD != '' ); then - qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver}} + qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver}} else # for debugging - qmake -config debug EXPECTED_FIRMWARE_VERSION=${{ steps.download_firmware.outputs.firmware_ver}} + qmake -config debug EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver}} fi make -j$(sysctl -n hw.ncpu) macdeployqt Labrador.app -verbose=2 -libpath=build_mac/libdfuprog/lib/ From b6f30bb4d8ee9e127c4e5618a4f875f9bd2acaaa Mon Sep 17 00:00:00 2001 From: brentfpage Date: Tue, 24 Feb 2026 12:40:57 -0800 Subject: [PATCH 19/19] accommodate downloading firmware using run-id from in-process continuous release --- .github/workflows/android.yml | 2 +- .github/workflows/linux.yml | 2 +- .github/workflows/mac.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index ab13d9fed..a8d3df409 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -44,7 +44,7 @@ jobs: uses: ./.github/actions/download-firmware-action with: FIRMWARE_VARIANT: '02' -# FIRMWARE_RUN_ID: ${{ inputs.FIRMWARE_RUN_ID }} # for grabbing the firmware from an in-process continuous release + FIRMWARE_RUN_ID: ${{ github.event.workflow == './github/workflows/continuous.yml' && inputs.FIRMWARE_RUN_ID || ''}} # for grabbing the firmware from an in-process continuous release - name: Install Qt uses: jurplel/install-qt-action@v4 diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index c480d8b87..cba1541a0 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -50,7 +50,7 @@ jobs: uses: ./.github/actions/download-firmware-action with: FIRMWARE_VARIANT: '02' -# FIRMWARE_RUN_ID: ${{ inputs.FIRMWARE_RUN_ID }} # for grabbing the firmware from an in-process continuous release + FIRMWARE_RUN_ID: ${{ github.event.workflow == './github/workflows/continuous.yml' && inputs.FIRMWARE_RUN_ID || ''}} # for grabbing the firmware from an in-process continuous release - name: Install dependencies run: | diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index b695e8abb..fbc103669 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -42,7 +42,7 @@ jobs: uses: ./.github/actions/download-firmware-action with: FIRMWARE_VARIANT: '02' -# FIRMWARE_RUN_ID: ${{ inputs.FIRMWARE_RUN_ID }} # for grabbing the firmware from an in-process continuous release + FIRMWARE_RUN_ID: ${{ github.event.workflow == './github/workflows/continuous.yml' && inputs.FIRMWARE_RUN_ID || ''}} # for grabbing the firmware from an in-process continuous release - name: Setup Homebrew dependencies run: |