Skip to content

Commit

Permalink
.github/workflows: Fix missing version in releases.
Browse files Browse the repository at this point in the history
Also fix missing version in local builds.

Fixes pybricks/support#1827
  • Loading branch information
laurensvalk committed Sep 17, 2024
1 parent 220ed6a commit 9399ae0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions bricks/_common/arm_none_eabi.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9399ae0

Please sign in to comment.