Files
nuki_hub/.github/workflows/build.yml
iranl 1f4e85a09e Remove Solo1 support + validate HTTPS certs on HTTPS requests (#443)
* Use esp_crt_bundle for HTTPS requests

* Remove Solo1 support
2024-08-08 17:29:48 +07:00

97 lines
2.8 KiB
YAML

name: NukiHub
on:
push:
branches: ["*"]
tags: ["*"]
pull_request:
branches: ["*"]
tags: ["*"]
workflow_dispatch:
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.board }} (${{ matrix.build }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
board: [esp32dev, esp32-s3, esp32-c3, esp32-c6]
build: [release, debug]
env:
BOARD: ${{ matrix.board }}
VARIANT: ${{ matrix.name || matrix.board }}
BUILD: ${{ matrix.build }}
steps:
- name: Fix variant name
run: |
# remove dash character
export VARIANT=${VARIANT//-/}
if [ "$VARIANT" = "esp32dev" ]; then
VARIANT="esp32"
fi
echo "VARIANT=${VARIANT}" | tee -a ${GITHUB_ENV}
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio/.cache
~/.platformio/packages
key: ${{ runner.os }}-pio-${{ matrix.board }}
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install dependencies
run: make deps
- name: Add version info
env:
Version: ${{ github.run_id }}.${{ github.run_number }}.${{ github.run_attempt }}
run: |
sed -i "s/unknownbuildnr/$Version/g" src/Config.h
- name: Build ${{ matrix.build }} PlatformIO Project ${{ matrix.board }}
run: |
if [ "$BUILD" = "debug" ]; then
BOARD="${BOARD}_dbg"
fi
echo "::group::Building with PlatformIO"
if [ "$BUILD" = "release" ]; then
make updater_${BOARD}
fi
make $BOARD
echo "::endgroup::"
- name: Add flash script
env:
DOC: resources/how-to-flash.txt
FILES: ${{ format('{0}/{1}', env.BUILD, env.VARIANT) }}
run: |
BOARD=`echo $BOARD | tr '[:lower:]' '[:upper:]'`
# fix for docs
if [ "$BOARD" = "ESP32DEV" ]; then
BOARD="ESP32"
fi
# look for documentation on flash and copy the command
command=`sed -n '/^Howto flash (esptool)$/,$p' ${DOC} | sed -n '/^## '"${BOARD}"'$/,\${ n; n; p; }' | head -n1`
if [ -z "$command" ]; then
echo "::error::Command not found in document ${DOC} for board ${BOARD}"
exit 1
fi
echo -n "Command: "
echo "$command" | tee ${FILES}/flash.sh
chmod a+x ${FILES}/flash.sh
- name: Upload Artifact ${{ matrix.board }}-${{ matrix.build }}
uses: actions/upload-artifact@v4
with:
name: ${{ format('{0}-{1}-assets', env.VARIANT, matrix.build) }}
path: ${{ matrix.build }}/${{ env.VARIANT }}