diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6519af4b8..d35fefb81 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,6 +25,8 @@ jobs: fetch-depth: 0 - name: Build firmware run: | + export MICROPY_GIT_TAG=ci-release-${{ github.run_number }}-$(git describe --tags --dirty --always --exclude "@pybricks/*") + export MICROPY_GIT_HASH=$(echo ${{ github.sha }} | cut -c1-8) make $MAKEOPTS -C micropython/mpy-cross make $MAKEOPTS -C bricks/movehub make $MAKEOPTS -C bricks/cityhub diff --git a/bricks/_common/arm_none_eabi.mk b/bricks/_common/arm_none_eabi.mk index d5ac000b9..c7d624183 100644 --- a/bricks/_common/arm_none_eabi.mk +++ b/bricks/_common/arm_none_eabi.mk @@ -508,11 +508,13 @@ $(BUILD)/genhdr/%.h: $(PBTOP)/lib/pbio/drv/bluetooth/%.gatt endif ifeq ($(MICROPY_GIT_TAG),) -FW_VERSION := $(shell $(GIT) describe --tags --dirty --always --exclude "@pybricks/*") -else # CI builds use build number + git hash as tag/firmware version -FW_VERSION := $(MICROPY_GIT_TAG) +export MICROPY_GIT_TAG := local-build-$(shell $(GIT) describe --tags --dirty --always --exclude "@pybricks/*") +export MICROPY_GIT_HASH :=$(shell $(GIT) rev-parse --short HEAD) endif +FW_VERSION := $(MICROPY_GIT_TAG) + +$(info PLATFORM: $(PBIO_PLATFORM) VERSION: $(FW_VERSION)) ifeq ($(PB_MCU_FAMILY),STM32) FW_SECTIONS := -j .isr_vector -j .text -j .data -j .name