Skip to content

Commit

Permalink
feat(heater-shaker): create release with assets on tag push (#309)
Browse files Browse the repository at this point in the history
* added some initial firmware

* completed callback sequence and added gcode sequence for turning on individual LEDs

* updated systemwide for use in c++ and c files

* updated c array to std array, system_wide variables, and debug fixes

* removed implemented SysTick_Handler

* fixed up initializations and added function to test turning all LEDs on at startup

* debug updates to test

* added clearing of the LED driver shutdown register, all LEDs tested positively

* commented current and pwm static values

* LED I2C now using FreeRTOS take and give notification

* refactored, cleaned up, and added blinking functionality

* added LED message hooks

* white LED only on left and red LED only on right

* cleanup and fixes

* cleanup

* eliminated RCC resetting at SystemInit

* tidied up some code and wrote most tests

* updated tests, simulator, and formatted

* formatted some tests

* eliminated space to make systemide.h identical to initial merge candidate

* initial action commit

* removed unecessary steps and updated references

* added automated changelog generator

* updated release note auto-genration

* updated release note auto-generation

* semantics

* removed release note auto-generation

* in process of creating zip

* updated yaml

* updated install dir

* fixed non-updating tag versions

* updated set_build_vars

* populated TRAVIS_TAG in .yaml

* one more update to .yaml

* update to trigger on tag creation

* run action on release publish

* reverted trigger

* reverted trigger to original
  • Loading branch information
pmoegenburg authored Jul 28, 2022
1 parent c652947 commit 377f2d8
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 9 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/heater-shaker-create-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: 'Heater-shaker create release from tag'
on:
push:
tags:
- 'heater-shaker@*'
workflow_dispatch:


defaults:
run:
shell: bash


jobs:
cross-compile-check-and-release:
name: 'Cross-Compile/Check and Create Release'
runs-on: 'ubuntu-20.04'
timeout-minutes: 10
steps:
- uses: 'actions/checkout@v2'
with:
fetch-depth: 0
- uses: 'actions/cache@v2'
with:
key: stm32-cross-${{ secrets.MODULES_STM32_CACHE_VERSION }}-${{ hashFiles('cmake/*') }}
restore-keys: stm32-cross-${{ secrets.MODULES_STM32_CACHE_VERSION }}-
path: './stm32-tools'
- name: 'Configure'
run: cmake --preset=stm32-cross .
- name: 'Build'
run: cmake --build ./build-stm32-cross --target heater-shaker-hex
- name: 'Build Combo Image Hex'
run: cmake --build ./build-stm32-cross --target heater-shaker-image-hex
- name: 'Build Combo Image Binary'
run: cmake --build ./build-stm32-cross --target heater-shaker-image-bin
- name: 'Build Combo Image Zip'
run: cmake --build ./build-stm32-cross --target heater-shaker-zip
- name: 'Prep for install'
run: cmake --install ./build-stm32-cross
- if: github.event_name != 'pull_request'
name: 'Deploy'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_MODULES_DEPLOY_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_MODULES_DEPLOY_SECRET }}
AWS_DEFAULT_REGION: us-east-2
TRAVIS_TAG: ${{ github.ref_name }}
run: |
. ./scripts/set_build_vars.sh
aws s3 sync --acl=public-read ${RELEASE_LOCAL_DIR} s3://opentrons-modules-builds/${RELEASE_UPLOAD_DIR}
3 changes: 2 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"MODULE_TYPE": "stm32",
"CMAKE_FIND_APPBUNDLE": "NEVER",
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/cmake/STM32CortexM4GCCCrossToolchain.cmake",
"CMAKE_BUILD_CONFIG": "MinSizeRel"
"CMAKE_BUILD_CONFIG": "MinSizeRel",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/dist"
}
},
{
Expand Down
5 changes: 5 additions & 0 deletions scripts/set_build_vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ case $TRAVIS_TAG in
export RELEASE_UPLOAD_DIR="thermocycler/${RELEASE_VERSION}"
;;

heater-shaker@v*)
export RELEASE_LOCAL_DIR="${DIST_DIR}/heater-shaker"
export RELEASE_UPLOAD_DIR="heater-shaker/${RELEASE_VERSION}"
;;

*)
export RELEASE_LOCAL_DIR=$DIST_DIR
export RELEASE_UPLOAD_DIR="modules-${THIS_BUILD_TAG}-${TRAVIS_BRANCH}"
Expand Down
37 changes: 30 additions & 7 deletions stm32-modules/heater-shaker/firmware/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,20 +209,43 @@ add_custom_target(heater-shaker-flash

# Targets to create full image hex and binary files containing both bootloader and application
add_custom_command(
OUTPUT heater-shaker-image.hex
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/heater-shaker@${heater-shaker_VERSION}.hex"
DEPENDS $<TARGET_FILE_DIR:heater-shaker>/heater-shaker.hex
DEPENDS STM32F303-startup-hex
DEPENDS $<TARGET_FILE_DIR:STM32F303-startup>/STM32F303-startup.hex
COMMAND ${CMAKE_SOURCE_DIR}/scripts/hex_combine.py heater-shaker-image.hex $<TARGET_FILE_DIR:STM32F303-startup>/STM32F303-startup.hex heater-shaker.hex
COMMAND ${CMAKE_SOURCE_DIR}/scripts/hex_combine.py "${CMAKE_CURRENT_BINARY_DIR}/heater-shaker@${heater-shaker_VERSION}.hex" $<TARGET_FILE_DIR:STM32F303-startup>/STM32F303-startup.hex heater-shaker.hex
VERBATIM
COMMENT "Generating full image")
add_custom_target(heater-shaker-image-hex ALL
DEPENDS heater-shaker-image.hex
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/heater-shaker@${heater-shaker_VERSION}.hex"
DEPENDS heater-shaker)

add_custom_command(OUTPUT heater-shaker-image.bin
COMMAND ${CROSS_OBJCOPY} ARGS "-Iihex" "-Obinary" heater-shaker-image.hex heater-shaker-image.bin
DEPENDS heater-shaker-image.hex
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/heater-shaker@${heater-shaker_VERSION}.bin"
COMMAND ${CROSS_OBJCOPY} ARGS "-Iihex" "-Obinary" "${CMAKE_CURRENT_BINARY_DIR}/heater-shaker@${heater-shaker_VERSION}.hex" "${CMAKE_CURRENT_BINARY_DIR}/heater-shaker@${heater-shaker_VERSION}.bin"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/heater-shaker@${heater-shaker_VERSION}.hex"
VERBATIM)
add_custom_target(heater-shaker-image-bin ALL
DEPENDS heater-shaker-image.bin)
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/heater-shaker@${heater-shaker_VERSION}.bin")

add_custom_command(
OUTPUT "${CMAKE_BINARY_DIR}/heater-shaker@${heater-shaker_VERSION}.zip"
DEPENDS heater-shaker-image-hex
DEPENDS heater-shaker-image-bin
COMMAND ${CMAKE_COMMAND} -E tar c
"${CMAKE_BINARY_DIR}/heater-shaker@${heater-shaker_VERSION}.zip"
--format=zip
--
"${CMAKE_CURRENT_BINARY_DIR}/heater-shaker@${heater-shaker_VERSION}.bin"
"${CMAKE_CURRENT_BINARY_DIR}/heater-shaker@${heater-shaker_VERSION}.hex"
VERBATIM
)

add_custom_target(heater-shaker-zip
DEPENDS "${CMAKE_BINARY_DIR}/heater-shaker@${heater-shaker_VERSION}.zip")

install(FILES
"${CMAKE_BINARY_DIR}/heater-shaker@${heater-shaker_VERSION}.zip"
"${CMAKE_CURRENT_BINARY_DIR}/heater-shaker@${heater-shaker_VERSION}.bin"
"${CMAKE_CURRENT_BINARY_DIR}/heater-shaker@${heater-shaker_VERSION}.hex"
DESTINATION "heater-shaker"
)
2 changes: 1 addition & 1 deletion stm32-modules/heater-shaker/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if (NOT VERSION)
set(VERSION "(dev)")
endif()

set(heater-shaker_VERSION "${VERSION}")
set(heater-shaker_VERSION "${VERSION}" CACHE STRING "h-s fw version" FORCE)

configure_file(./version.cpp.in ./version.cpp)

Expand Down

0 comments on commit 377f2d8

Please sign in to comment.