Version 0.24 Cascoda SDK Release #167
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: BuildAndDeploy | |
env: | |
KNX_IOT_STACK_SECRET: ${{secrets.KNX_IOT_STACK_SECRET}} | |
on: [push] | |
jobs: | |
# Build artifacts for windows | |
windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
path: cascoda-sdk | |
- name: configure windows sdk | |
run: | | |
cmake.exe -S "${{ github.workspace }}\cascoda-sdk" -B "${{ github.workspace }}\build-win" -D CMAKE_SH=CMAKE_SH-NOTFOUND -G "MinGW Makefiles" -D CASCODA_BUILD_OT=OFF -D CASCODA_BUILD_KNX=ON | |
- name: build windows-sdk | |
run: | | |
mingw32-make.exe -C ${{ github.workspace }}\build-win -j4 | |
mkdir ${{ github.workspace }}\release | |
cd ${{ github.workspace }}\build-win\bin | |
Copy-Item -Path ocfctl.exe,chilictl.exe,sniffer.exe,serial-adapter.exe,evbme-get.exe -Destination ${{ github.workspace }}\release | |
Copy-Item -Path ${{ github.workspace }}\cascoda-sdk\LICENSE -Destination ${{ github.workspace }}\release | |
$readme = "For application details, see https://github.com/${{ github.repository }}/tree/${{ github.sha }}#example-applications" | |
$readme | Out-File ${{ github.workspace }}\release\readme.txt | |
- name: build windows-sdk-8212 | |
run: | | |
cmake.exe "${{ github.workspace }}\build-win" -D CASCODA_CA_VER=8212 | |
mingw32-make.exe -C ${{ github.workspace }}\build-win -j4 | |
- name: download priv | |
uses: dawidd6/action-download-artifact@v2.24.0 | |
if: github.repository == 'Cascoda/cascoda-sdk' | |
with: | |
github_token: ${{secrets.CASCODA_PRIVATE}} | |
branch: master | |
name: Windows-SDK | |
path: ${{ github.workspace }}\windows-sdk-priv | |
repo: Cascoda/cascoda-sdk-priv | |
workflow: build.yml | |
- name: Extract knx-gen-data from priv | |
if: github.repository == 'Cascoda/cascoda-sdk' | |
run: | | |
cp ${{ github.workspace }}\windows-sdk-priv\knx-gen-data.exe ${{ github.workspace }}\release | |
- name: create installer for windows executables | |
run: makensis.exe ${{ github.workspace }}\cascoda-sdk\etc\win_executables_install_script.nsi | |
- name: Upload windows-sdk | |
uses: actions/upload-artifact@v1.0.0 | |
with: | |
name: Windows-SDK | |
path: ${{ github.workspace }}\release | |
- name: Upload installer | |
uses: actions/upload-artifact@v1.0.0 | |
with: | |
name: CascodaWindowsTools | |
path: ${{ github.workspace }}\cascoda-sdk\etc\CascodaWinTools.exe | |
- name: cache arm compiler | |
id: cache-compiler | |
uses: actions/cache@v1 | |
env: | |
cache-name: cache-gcc-arm-win | |
with: | |
path: ${{ github.workspace }}/gcc-arm-none-eabi-9-2020-q2-update-win32 | |
key: gcc-arm-none-eabi-9-2020-q2-update-win32 | |
- name: download compiler | |
if: steps.cache-compiler.outputs.cache-hit != 'true' | |
run: | | |
$uri = "https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-win32.zip" | |
$zipfile = "gcc-arm-none-eabi-9-2020-q2-update-win32.zip" | |
(New-Object System.Net.WebClient).DownloadFile($uri, $zipfile) | |
Expand-Archive -Path gcc-arm-none-eabi-9-2020-q2-update-win32.zip -DestinationPath gcc-arm-none-eabi-9-2020-q2-update-win32 | |
- name: enable compiler | |
run: | | |
echo "${{ github.workspace }}\gcc-arm-none-eabi-9-2020-q2-update-win32\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- name: download static libs from private repo | |
uses: dawidd6/action-download-artifact@v2.24.0 | |
if: github.repository == 'Cascoda/cascoda-sdk' | |
with: | |
github_token: ${{secrets.CASCODA_PRIVATE}} | |
branch: master | |
name: Chili2-Lib | |
path: ${{ github.workspace }}/build-ocf-chili2-win/lib | |
repo: Cascoda/cascoda-sdk-priv | |
workflow: build.yml | |
# - name: configure OCF chili build on windows | |
# run: | | |
# arm-none-eabi-gcc --version | |
# cmake.exe -S "${{ github.workspace }}\cascoda-sdk" -B "${{ github.workspace }}\build-ocf-chili2-win" -DCMAKE_SH=CMAKE_SH-NOTFOUND -D "CMAKE_TOOLCHAIN_FILE=toolchain\arm_gcc_m2351.cmake" -G "MinGW Makefiles" -DCASCODA_BUILD_OCF=ON -DCASCODA_BUILD_OCF_PKI=ON -DCASCODA_LOG_LEVEL=CRIT | |
# - name: build OCF chili binaries on windows | |
# run: | | |
# mingw32-make.exe -C ${{ github.workspace }}\build-ocf-chili2-win -j4 | |
- name: copy static libs | |
if: github.repository == 'Cascoda/cascoda-sdk' | |
run: | | |
arm-none-eabi-gcc --version | |
New-Item -Type dir ${{ github.workspace }}\build-knx-chili2-win\lib | |
Copy-Item -Path ${{ github.workspace }}\build-ocf-chili2-win\lib\libkis-port.a -Destination ${{ github.workspace }}\build-knx-chili2-win\lib | |
- name: configure KNX chili build on windows | |
run: | | |
cmake.exe -S "${{ github.workspace }}\cascoda-sdk" -B "${{ github.workspace }}\build-knx-chili2-win" -DCMAKE_SH=CMAKE_SH-NOTFOUND -D "CMAKE_TOOLCHAIN_FILE=toolchain\arm_gcc_m2351.cmake" -G "MinGW Makefiles" -DCASCODA_CHILI2_CONFIG_STRING=DEV_BOARD -DCASCODA_BUILD_KNX=ON -DCASCODA_LOG_LEVEL=CRIT | |
continue-on-error: true | |
- name: build KNX chili binaries on windows | |
run: | | |
mingw32-make.exe -C ${{ github.workspace }}\build-knx-chili2-win -j4 | |
# Build artifacts for posix | |
posix: | |
# NOTE: Not building with ubuntu-latest on purpose, because that results | |
# in binaries that can only be run on linux machines with newest version, | |
# that have glibc 2.34. | |
# Using ubuntu-20.04 drops that requirement to glibc 2.31. | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
path: cascoda-sdk | |
- name: configure posix sdk | |
run: | | |
cmake -S "${{ github.workspace }}/cascoda-sdk" -B "${{ github.workspace }}/build-posix" -D CMAKE_SH=CMAKE_SH-NOTFOUND -D CA_BUILD_TESTING=OFF -D BUILD_TESTING=OFF | |
- name: build posix-sdk | |
run: | | |
make -C ${{ github.workspace }}/build-posix -j4 | |
mkdir ${{ github.workspace }}/release | |
cd ${{ github.workspace }}/build-posix/bin | |
cp ocfctl chilictl sniffer serial-adapter evbme-get ${{ github.workspace }}/release | |
cp ${{ github.workspace }}/cascoda-sdk/LICENSE ${{ github.workspace }}/release | |
echo "For application details, see https://github.com/${{ github.repository }}/tree/${{ github.sha }}#example-applications" > ${{ github.workspace }}/release/readme.txt | |
- name: Upload posix-sdk | |
uses: actions/upload-artifact@v1.0.0 | |
with: | |
name: Posix-SDK | |
path: ${{ github.workspace }}/release | |
# Build artifacts for MacOS - for build testing only, no artifacts | |
macos: | |
runs-on: macos-latest | |
# if: github.ref == 'refs/heads/master' | |
if: false | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
path: cascoda-sdk | |
- name: configure macos sdk | |
run: | | |
cmake -S ${{ github.workspace }}/cascoda-sdk -B ${{ github.workspace }}/build-macos | |
- name: build macos sdk | |
run: | | |
make -C ${{ github.workspace }}/build-macos -j4 | |
# Build artifacts for the chili2 | |
chili2: | |
runs-on: ubuntu-latest | |
env: | |
OCF_TARGETS: 'ocf-light ocf-reed-light ocf-cli-thermometer ocf-sleepy-thermometer ocf-sensorif ocf-sensorif-unsecure ocf-reed-module' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
path: cascoda-sdk | |
- name: cache compiler | |
id: cache-compiler | |
uses: actions/cache@v1 | |
env: | |
cache-name: cache-gcc-arm | |
with: | |
path: ${{ github.workspace }}/gcc-arm-none-eabi-9-2019-q4-major | |
key: gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux | |
- name: download compiler | |
if: steps.cache-compiler.outputs.cache-hit != 'true' | |
run: | | |
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 | |
tar xjf gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 | |
- name: enable compiler | |
run: | | |
echo "${{ github.workspace }}/gcc-arm-none-eabi-9-2019-q4-major/bin" >> $GITHUB_PATH | |
# We configure non-ocf chili build first because building OCF adds bloat to MBedTls, which increases all openthread binary sizes. | |
- name: configure Chili2S-UART4-115200baud | |
run: | | |
arm-none-eabi-gcc --version | |
cmake -S ${{ github.workspace }}/cascoda-sdk -B ${{ github.workspace }}/build-chili2 -DCMAKE_TOOLCHAIN_FILE=toolchain/arm_gcc_m2351.cmake -DCASCODA_BM_INTERFACE=UART -DCASCODA_CHILI2_UART_BAUDRATE=115200 -DCASCODA_CHILI2_UART_CHANNEL=4 -DCASCODA_CHILI2_CONFIG_STRING=ONE_SIDED | |
mkdir ${{ github.workspace }}/upload-uart | |
- name: build Chili2S-UART4-115200baud | |
run: | | |
make -C ${{ github.workspace }}/build-chili2 clean | |
make -C ${{ github.workspace }}/build-chili2 -j4 | |
pushd ${{ github.workspace }}/build-chili2/bin | |
find . -name '*.bin' | cpio -pdm ${{ github.workspace }}/upload-uart | |
find . -name '*.bin' -delete | |
popd | |
cp ${{ github.workspace }}/cascoda-sdk/LICENSE ${{ github.workspace }}/upload-uart | |
echo "For application details, see https://github.com/${{ github.repository }}/tree/${{ github.sha }}#example-applications" > ${{ github.workspace }}/upload-uart/readme.txt | |
- name: download static lib from private repo | |
uses: dawidd6/action-download-artifact@v2.24.0 | |
with: | |
github_token: ${{secrets.CASCODA_PRIVATE}} | |
branch: master | |
name: Chili2-Lib | |
path: ${{ github.workspace }}/build-chili2/lib | |
repo: Cascoda/cascoda-sdk-priv | |
workflow: build.yml | |
# - name: build Chili2S-UART4-115200baud-OCF | |
# run: | | |
# cmake ${{ github.workspace }}/build-chili2 -DCASCODA_BUILD_OCF=ON -DCASCODA_BUILD_OCF_PKI=ON -DCASCODA_BUILD_SECURE_LWM2M=OFF -DCASCODA_CHILI_FLASH_PAGES=16 | |
# make -C ${{ github.workspace }}/build-chili2 -j4 $OCF_TARGETS | |
# cp ${{ github.workspace }}/build-chili2/bin/ocf-*.bin ${{ github.workspace }}/upload-uart | |
- name: clean up build directory | |
run: | | |
rm -rf ${{ github.workspace }}/build-chili2 | |
- name: download static libs after cleanup | |
uses: dawidd6/action-download-artifact@v2.24.0 | |
with: | |
github_token: ${{secrets.CASCODA_PRIVATE}} | |
branch: master | |
name: Chili2-Lib | |
path: ${{ github.workspace }}/build-chili2/lib | |
repo: Cascoda/cascoda-sdk-priv | |
workflow: build.yml | |
# We configure non-ocf chili build first because building OCF adds bloat to MBedTls, which increases all openthread binary sizes. | |
- name: configure Chili2D-USB | |
run: | | |
arm-none-eabi-gcc --version | |
#TODO: Temporary workaround, shouldnt need to do this | |
cmake -S ${{ github.workspace }}/cascoda-sdk -B ${{ github.workspace }}/build-chili2 -DCMAKE_TOOLCHAIN_FILE=toolchain/arm_gcc_m2351.cmake -DCASCODA_BM_INTERFACE=USB -DCASCODA_BUILD_OCF=OFF -DCASCODA_BUILD_SECURE_LWM2M=ON || true | |
#TODO: Temporary workaround, shouldn't need to configure twice. | |
cmake ${{ github.workspace }}/build-chili2 | |
mkdir ${{ github.workspace }}/upload-usb | |
mkdir ${{ github.workspace }}/upload-lib | |
- name: build Chili2D-USB | |
run: | | |
make -C ${{ github.workspace }}/build-chili2 -j4 | |
pushd ${{ github.workspace }}/build-chili2/bin | |
find . -name '*.bin' | cpio -pdm ${{ github.workspace }}/upload-usb | |
find . -name '*.bin' -delete | |
popd | |
cp ${{ github.workspace }}/cascoda-sdk/LICENSE ${{ github.workspace }}/upload-usb | |
echo "For application details, see https://github.com/${{ github.repository }}/tree/${{ github.sha }}#example-applications" > ${{ github.workspace }}/upload-usb/readme.txt | |
# For continuous integration only. Will not yet create an artifact for release. | |
- name: build Chili2D-USB-KNX | |
run: | | |
cmake ${{ github.workspace }}/build-chili2 -DCASCODA_CA_VER=8211 -DCASCODA_CHILI2_CONFIG_STRING=DEV_BOARD -DCASCODA_BUILD_KNX=ON -DOC_OSCORE_ENABLED=ON -DOC_DNS_SD_ENABLED=ON -DOC_DEBUG_ENABLED=OFF | |
make -C ${{ github.workspace }}/build-chili2 -j4 | |
# copy knx port library | |
if [ ${{github.repository }} != Cascoda/cascoda-sdk ] | |
then | |
cp ${{ github.workspace }}/build-chili2/lib/libkis-port.a ${{ github.workspace }}/upload-lib | |
fi | |
# - name: build Chili2D-USB-OCF | |
# run: | | |
# cmake ${{ github.workspace }}/build-chili2 -DCASCODA_BUILD_KNX=OFF -DCASCODA_CHILI2_CONFIG_STRING=TWO_SIDED -DCASCODA_BUILD_OCF=ON -DCASCODA_BUILD_OCF_PKI=ON -DCASCODA_BUILD_SECURE_LWM2M=OFF -DCASCODA_CHILI_FLASH_PAGES=16 | |
# make -C ${{ github.workspace }}/build-chili2 -j4 $OCF_TARGETS | |
# cp ${{ github.workspace }}/build-chili2/bin/ocf-*.bin ${{ github.workspace }}/upload-usb | |
# if [ ${{github.repository }} != Cascoda/cascoda-sdk ] | |
# then | |
# cp ${{ github.workspace }}/build-chili2/lib/libiotivity-port.a ${{ github.workspace }}/upload-lib | |
# fi | |
- name: Upload Chili2S-UART4-115200baud | |
uses: actions/upload-artifact@v1.0.0 | |
with: | |
name: Chili2S-UART4-115200baud | |
path: ${{ github.workspace }}/upload-uart | |
- name: Upload Chili2D-USB | |
uses: actions/upload-artifact@v1.0.0 | |
with: | |
name: Chili2D-USB | |
path: ${{ github.workspace }}/upload-usb | |
- name: Upload Chili2-Lib | |
uses: actions/upload-artifact@v1.0.0 | |
with: | |
name: Chili2-Lib | |
path: ${{ github.workspace }}/upload-lib | |
makerelease: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
needs: [windows, posix, chili2] | |
# Checkout the code, and fetch all tags (for version) | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
path: cascoda-sdk | |
- run: | | |
cd cascoda-sdk | |
git fetch --tags | |
# Figure out what we're going to call the release, and the release body | |
- name: Release info | |
id: releaseinfo | |
run: | | |
cd cascoda-sdk | |
echo "version=$(git describe --dirty --always --long | sed -E 's/-g[0-9a-f]+//g')" >> $GITHUB_OUTPUT | |
echo "title=$(git show -s --format=%B | head -n1)" >> $GITHUB_OUTPUT | |
msg=$(git show -s --format=%B) | |
#escape special chars | |
msg="${msg//'%'/'%25'}" | |
msg="${msg//$'\n'/'%0A'}" | |
msg="${msg//$'\r'/'%0D'}" | |
echo "msg=$msg" >> $GITHUB_OUTPUT | |
# Create a release to publish to | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.releaseinfo.outputs.version }} | |
release_name: ${{ steps.releaseinfo.outputs.title }} | |
body: ${{ steps.releaseinfo.outputs.msg }} | |
# Download all of the previously uploaded artifacts | |
- uses: actions/download-artifact@v1 | |
with: | |
name: CascodaWindowsTools | |
- uses: actions/download-artifact@v1 | |
with: | |
name: Windows-SDK | |
- uses: actions/download-artifact@v1 | |
with: | |
name: Chili2D-USB | |
- uses: actions/download-artifact@v1 | |
with: | |
name: Chili2S-UART4-115200baud | |
- uses: actions/download-artifact@v1 | |
with: | |
name: Posix-SDK | |
- uses: dawidd6/action-download-artifact@v2.24.0 | |
with: | |
github_token: ${{secrets.CASCODA_PRIVATE}} | |
branch: master | |
name: Chili2-Lib | |
path: ./Chili2-Lib | |
repo: Cascoda/cascoda-sdk-priv | |
workflow: build.yml | |
# Zip them back up | |
- name: Zip the release assets | |
run: | | |
zip -r CascodaWindowsTools.zip CascodaWindowsTools | |
zip -r Windows-SDK.zip Windows-SDK | |
zip -r Chili2D-USB.zip Chili2D-USB | |
zip -r Chili2S-UART4-115200baud.zip Chili2S-UART4-115200baud | |
zip -r Posix-SDK.zip Posix-SDK | |
zip Chili2-Lib.zip Chili2-Lib/* | |
# Release the artifacts to the just created release | |
- name: Release Installer | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{steps.create_release.outputs.upload_url}} | |
asset_path: ./CascodaWindowsTools.zip | |
asset_name: CascodaWindowsTools.zip | |
asset_content_type: application/zip | |
- name: Release Windows | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{steps.create_release.outputs.upload_url}} | |
asset_path: ./Windows-SDK.zip | |
asset_name: Windows-SDK.zip | |
asset_content_type: application/zip | |
- name: Release Chili USB | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{steps.create_release.outputs.upload_url}} | |
asset_path: ./Chili2D-USB.zip | |
asset_name: Chili2D-USB.zip | |
asset_content_type: application/zip | |
- name: Release Chili Libraries | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{steps.create_release.outputs.upload_url}} | |
asset_path: ./Chili2-Lib.zip | |
asset_name: Chili2-Lib.zip | |
asset_content_type: application/zip | |
- name: Release Chili UART | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{steps.create_release.outputs.upload_url}} | |
asset_path: ./Chili2S-UART4-115200baud.zip | |
asset_name: Chili2S-UART4-115200baud.zip | |
asset_content_type: application/zip | |
- name: Release Posix | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{steps.create_release.outputs.upload_url}} | |
asset_path: ./Posix-SDK.zip | |
asset_name: Posix-SDK.zip | |
asset_content_type: application/zip |