From 01c3e41392eadea9e01c26fdfe982a00c7d0b16d Mon Sep 17 00:00:00 2001 From: Daniel Dakhno Date: Mon, 25 Dec 2023 20:31:00 +0100 Subject: [PATCH] Created workflow for automatic firmware compilation for new releases --- .github/workflows/release-build.yml | 64 +++++++++++++++++++++++++++++ Makefile | 2 +- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release-build.yml diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml new file mode 100644 index 0000000..a1934a1 --- /dev/null +++ b/.github/workflows/release-build.yml @@ -0,0 +1,64 @@ +name: Automated firmware build for release + +on: + release: + types: [released] + +jobs: + build: + runs-on: [self-hosted, firmware-builder] + env: + BLE_ROOT: ../../../../ + + steps: + - name: extract code version + id: code-version + run: echo "VERSION=$(echo ${{ github.ref }} | cut -c 12-)" >> $GITHUB_OUTPUT + - uses: actions/checkout@v4 + with: + submodules: true + - name: check code version + run: grep ${{ steps.code-version.outputs.VERSION }} Makefile + - name: parse feature template + uses: cuchi/jinja2-action@v1.2.2 + with: + template: src/config/feature_config.template.h.jinja + output_file: src/config/feature_config.template.h + - name: set PATH + run: echo "../../../../" >> $GITHUB_PATH + - name: build firmware for nRF51 (no crystal) + run: make clean sign + env: + FAMILY: NRF51 + OUT_ZIP: nrf51_no_crystal.zip + BOARD: WT51822_S4AT + - name: build firmware for nRF51 (crystal) + run: make clean sign + env: + FAMILY: NRF51 + OUT_ZIP: nrf51_crystal.zip + BOARD: BEACON_SMALL + - name: build firmware for nRF52 (no crystal) + run: make clean sign + env: + FAMILY: NRF52 + OUT_ZIP: nrf52_no_crystal.zip + BOARD: HOLYIOT_17095 + - name: Upload nRF51 (no crystal) firmware to latest release + uses: svenstaro/upload-release-action@2.7.0 + with: + file: nrf51_no_crystal.zip + asset_name: nrf51_no_crystal_${{ steps.code-version.outputs.VERSION }}.zip + overwrite: true + - name: Upload nRF51 (crystal) firmware to latest release + uses: svenstaro/upload-release-action@2.7.0 + with: + file: nrf51_crystal.zip + asset_name: nrf51_crystal_${{ steps.code-version.outputs.VERSION }}.zip + overwrite: true + - name: Upload nRF52 (no crystal) firmware to latest release + uses: svenstaro/upload-release-action@2.7.0 + with: + file: nrf52_no_crystal.zip + asset_name: nrf52_no_crystal_${{ steps.code-version.outputs.VERSION }}.zip + overwrite: true diff --git a/Makefile b/Makefile index 4592a20..180d76b 100755 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ CUSTOM_INCLUDES_DIR = $(PROJ_DIR)/src/common ADB_TARGET ?= Pixel-5 ADB_DIRECTORY ?= /sdcard/dfu -FIRMWARE_VERSION := \"0.8.0\" +FIRMWARE_VERSION := \"0.8.1\" # Source files common to all targets SRC_FILES += \