From 56f8a971b55641d26e6683e61c154b9f11fb827c Mon Sep 17 00:00:00 2001 From: Eric Rauer Date: Thu, 19 Nov 2020 07:59:59 -0800 Subject: [PATCH] Publish demo board firmware as GitHub Artifact and filter upload to PLTcloud (#35) --- .github/actions/action-pltcloud/entrypoint.sh | 2 +- .github/actions/action-zephyr/Dockerfile | 11 ----------- .github/actions/action-zephyr/action.yml | 5 +++++ .github/actions/action-zephyr/entrypoint.sh | 4 ++-- .github/workflows/main.yml | 7 +++++++ Makefile | 13 +++++++------ ...mplate => suite-demo-board-zephyr.yaml.template} | 2 +- 7 files changed, 23 insertions(+), 21 deletions(-) create mode 100644 .github/actions/action-zephyr/action.yml rename test-suites/{suite-LY10-zephyr.yaml.template => suite-demo-board-zephyr.yaml.template} (86%) diff --git a/.github/actions/action-pltcloud/entrypoint.sh b/.github/actions/action-pltcloud/entrypoint.sh index 1859fcd..171cebf 100755 --- a/.github/actions/action-pltcloud/entrypoint.sh +++ b/.github/actions/action-pltcloud/entrypoint.sh @@ -1,3 +1,3 @@ #!/bin/bash -l -pltcloud -t "$API_TOKEN" -f "dist/*" -v "${GITHUB_REF:10}" -p "$PROJECT_UUID" +pltcloud -t "$API_TOKEN" -f "dist/*demo*" -v "${GITHUB_REF:10}" -p "$PROJECT_UUID" diff --git a/.github/actions/action-zephyr/Dockerfile b/.github/actions/action-zephyr/Dockerfile index 1ed1a93..ac81105 100644 --- a/.github/actions/action-zephyr/Dockerfile +++ b/.github/actions/action-zephyr/Dockerfile @@ -6,17 +6,6 @@ FROM bcdevices/zephyr-west:zephyr-2.4.0-0 -LABEL "com.github.actions.name"="Zephyr build" -LABEL "com.github.actions.description"="Build Zephyr project" -LABEL "com.github.actions.icon"="package" -LABEL "com.github.actions.color"="blue" - -LABEL "repository"="https://github.com/bcdevices/ly10-zephyr-fw" -LABEL "homepage"="https://github.com/bcdevices/ly10-zephyr-fw" -LABEL "maintainer"="Blue Clover Devices" - -WORKDIR /usr/src - ADD entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/.github/actions/action-zephyr/action.yml b/.github/actions/action-zephyr/action.yml new file mode 100644 index 0000000..22350c1 --- /dev/null +++ b/.github/actions/action-zephyr/action.yml @@ -0,0 +1,5 @@ +name: 'Zephyr build' +description: 'Build Zephyr projects' +runs: + using: 'docker' + image: 'Dockerfile' diff --git a/.github/actions/action-zephyr/entrypoint.sh b/.github/actions/action-zephyr/entrypoint.sh index dba4286..d3aff51 100755 --- a/.github/actions/action-zephyr/entrypoint.sh +++ b/.github/actions/action-zephyr/entrypoint.sh @@ -1,3 +1,3 @@ -#!/bin/sh -l +#!/bin/sh -sh -c "make dist" +make dist diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 02662a9..f1388f0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,3 +13,10 @@ jobs: env: API_TOKEN: ${{ secrets.API_TOKEN }} PROJECT_UUID: ${{ secrets.PROJECT_UUID }} + - uses: meeDamian/github-release@2.0 + if: contains(github.ref, 'tags') + with: + token: ${{ secrets.GITHUB_TOKEN }} + files: dist/*demo* + gzip: false + diff --git a/Makefile b/Makefile index 4f514bc..321f1ff 100644 --- a/Makefile +++ b/Makefile @@ -16,10 +16,11 @@ DIST := $(BASE_PATH)/dist default: build .PHONY: GIT-VERSION-FILE -GIT-VERSION-FILE: +GIT-VERSION-FILE: @sh ./GIT-VERSION-GEN -include GIT-VERSION-FILE +GIT_DESC := $(shell git describe --tags --always --dirty --match "v[0-9]*") VERSION_TAG := $(patsubst v%,%,$(GIT_DESC)) DOCKER_BUILD_ARGS := @@ -118,7 +119,7 @@ build.%/shell/zephyr/zephyr.hex: else echo "No Zephyr"; fi && \ west build --build-dir build.$*/shell \ --board $* --pristine auto \ - $$ZEPHYR_BASE/samples/subsys/shell/shell_module + $$ZEPHYR_BASE/samples/subsys/shell/shell_module build.%/can/zephyr/zephyr.hex: mkdir -p build.$*/can @@ -200,9 +201,9 @@ dist: dist-clean dist-prep build install -m 666 build.disco_l475_iot1/button/zephyr/zephyr.hex dist/zephyr-disco_l475_iot1-sample-button-$(VERSION_TAG).hex install -m 666 build.disco_l475_iot1/gsm_modem/zephyr/zephyr.hex dist/zephyr-disco_l475_iot1-sample-gsm_modem-$(VERSION_TAG).hex install -m 666 build.disco_l475_iot1/shell/zephyr/zephyr.hex dist/zephyr-disco_l475_iot1-sample-shell-$(VERSION_TAG).hex - install -m 666 build.ly10demo/app/zephyr/zephyr.hex dist/ly10-zephyr-fw-$(VERSION_TAG).hex - install -m 666 build.ly10demo/app/zephyr/zephyr.elf dist/ly10-zephyr-fw-$(VERSION_TAG).elf - install -m 666 build.ly10demo/app/zephyr/zephyr.map dist/ly10-zephyr-fw-$(VERSION_TAG).map + install -m 666 build.ly10demo/app/zephyr/zephyr.hex dist/demo-board-zephyr-fw-$(VERSION_TAG).hex + install -m 666 build.ly10demo/app/zephyr/zephyr.elf dist/demo-board-zephyr-fw-$(VERSION_TAG).elf + install -m 666 build.ly10demo/app/zephyr/zephyr.map dist/demo-board-zephyr-fw-$(VERSION_TAG).map #install -m 666 build.nrf52dk_nrf52832/servo_motor/zephyr/zephyr.hex dist/zephyr-nrf52dk_nrf528320-sample-servo_motor-$(VERSION_TAG).hex install -m 666 build.nrf52dk_nrf52832/blinky/zephyr/zephyr.hex dist/zephyr-nrf52dk_nrf52832-sample-blinky-$(VERSION_TAG).hex install -m 666 build.nrf52dk_nrf52832/button/zephyr/zephyr.hex dist/zephyr-nrf52dk_nrf52832-sample-button-$(VERSION_TAG).hex @@ -227,7 +228,7 @@ dist: dist-clean dist-prep build install -m 666 build.stm32f4_disco/can/zephyr/zephyr.hex dist/zephyr-stm32f4_disco-sample-can-$(VERSION_TAG).hex #install -m 666 build.stm32f4_disco/gsm_modem/zephyr/zephyr.hex dist/zephyr-stm32f4_disco-sample-gsm_modem-$(VERSION_TAG).hex install -m 666 build.stm32f4_disco/shell/zephyr/zephyr.hex dist/zephyr-stm32f4_disco-sample-shell-$(VERSION_TAG).hex - sed 's/{{VERSION}}/$(VERSION_TAG)/g' test-suites/suite-LY10-zephyr.yaml.template > dist/suite-LY10-zephyr-$(VERSION_TAG).yaml + sed 's/{{VERSION}}/$(VERSION_TAG)/g' test-suites/suite-demo-board-zephyr.yaml.template > dist/suite-demo-board-zephyr-$(VERSION_TAG).yaml .PHONY: deploy deploy: diff --git a/test-suites/suite-LY10-zephyr.yaml.template b/test-suites/suite-demo-board-zephyr.yaml.template similarity index 86% rename from test-suites/suite-LY10-zephyr.yaml.template rename to test-suites/suite-demo-board-zephyr.yaml.template index 3aa1a5d..716f3e8 100644 --- a/test-suites/suite-LY10-zephyr.yaml.template +++ b/test-suites/suite-demo-board-zephyr.yaml.template @@ -15,7 +15,7 @@ suite: - ident: ICT-T3 title: Program LY10-DEMO-BOARD FW steps: - - command: program nRF52 none,ly10-zephyr-fw-{{VERSION}}.hex,none + - command: program nRF52 none,demo-board-zephyr-fw-{{VERSION}}.hex,none - ident: ICT-T4 title: BLE discovery steps: