Update release.yml #3
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: Build | |
on: | |
push: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
ZEPHYR_SDK_INSTALL_PATH: /opt/toolchains | |
ZSDK_VERSION: 0.16.5 | |
container: | |
image: ghcr.io/zephyrproject-rtos/ci-base:v0.26.7 | |
env: | |
ZEPHYR_TOOLCHAIN_VARIANT: zephyr | |
ZEPHYR_SDK_INSTALL_DIR: ${ZEPHYR_SDK_INSTALL_PATH}/zephyr-sdk-${ZSDK_VERSION} | |
PKG_CONFIG_PATH: /usr/lib/i386-linux-gnu/pkgconfig | |
OVMF_FD_PATH: /usr/share/ovmf/OVMF.fd | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v4 | |
- name: Make ZEPHYR_SDK_INSTALL_PATH | |
run: mkdir -p ${ZEPHYR_SDK_INSTALL_PATH} | |
- name: Download Zephyr SDK minimal | |
run: wget -nv https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZSDK_VERSION}/zephyr-sdk-${ZSDK_VERSION}_linux-x86_64_minimal.tar.xz | |
- name: Extract Zephyr SDK minimal | |
run: | | |
tar -xf zephyr-sdk-${ZSDK_VERSION}_linux-x86_64_minimal.tar.xz -C ${ZEPHYR_SDK_INSTALL_PATH}/ | |
rm zephyr-sdk-${ZSDK_VERSION}_linux-x86_64_minimal.tar.xz | |
- name: Download arm-zephyr-eabi toolchain | |
run: wget -nv ${WGET_ARGS} https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZSDK_VERSION}/toolchain_linux-x86_64_arm-zephyr-eabi.tar.xz | |
- name: Extract arm-zephyr-eabi toolchain | |
run: | | |
tar -xf toolchain_linux-x86_64_arm-zephyr-eabi.tar.xz -C ${ZEPHYR_SDK_INSTALL_PATH}/zephyr-sdk-${ZSDK_VERSION}/ | |
rm toolchain_linux-x86_64_arm-zephyr-eabi.tar.xz | |
- name: Run Zephyr SDK setup script | |
run: | | |
cd ${ZEPHYR_SDK_INSTALL_PATH} | |
zephyr-sdk-${ZSDK_VERSION}/setup.sh -h -c | |
- name: Clean up stale packages | |
run: | | |
apt-get clean -y | |
apt-get autoremove --purge -y | |
rm -rf /var/lib/apt/lists/* | |
- name: West update | |
run: west update | |
- name: Add secret key files | |
env: | |
BOOT_ECDSA_P256: ${{ secrets.BOOT_ECDSA_P256 }} | |
run: | | |
mkdir ./app/keys/private/ | |
echo "$BOOT_ECDSA_P256" >> ./app/keys/private/boot-ecdsa-p256.pem | |
- name: Build Zephyr app | |
env: | |
BOARD: circuitdojo_feather_nrf9160_ns | |
run: west build ./app -p | |
- name: Create build tarball | |
run: | | |
cd build/zephyr/ | |
tar cfJ merged.hex.tar.xz merged.hex | |
tar cfJ app_update.bin.tar.xz app_update.bin | |
tar cfJ build.tar.xz merged.hex.tar.xz app_update.bin.tar.xz | |
- name: Upload build tarball | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build.tar.xz | |
path: build/zephyr/build.tar.xz | |
compression-level: 0 | |
overwrite: true |