From fcb0bc5a3e7d9bee0a33f25c8125221f521dad75 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 26 Aug 2024 21:52:11 -0700 Subject: [PATCH] address #5: CI/CD yml for release publishing --- .github/workflows/release.yml | 22 ++++++++++++++++++++++ ci/build.sh | 9 +++++++++ 2 files changed, 31 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0a0ee9f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +on: + push: + tags: + - "v*.*.*" + +jobs: + release_fw: + runs-on: ubuntu-latest + container: + image: espressif/idf:v5.3 + steps: + - name: "Checkout files" + uses: actions/checkout@v4 + with: + submodules: "recursive" + - name: "Regular firmware build" + run: "./ci/build.sh" + - name: Release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + files: webserver/build/tokay_lite.bin diff --git a/ci/build.sh b/ci/build.sh index 9e9f796..eb008be 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -2,9 +2,18 @@ # TODO: print more information about the container +VERSTR=$(git describe --tags --dirty) + (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv) echo "IDF_PATH: $IDF_PATH" echo "PATH: $PATH" +echo "VERSTR $VERSTR" . "${IDF_PATH}/export.sh" idf.py -C webserver build +cd webserver/build + +echo "Generating single binary..." +# TODO: use VERSTR to encode version info into the file name +# and use it in the release.yml CI file +esptool.py --chip ESP32-S3 merge_bin -o tokay_lite.bin @flash_args