From a8fd0bbdef59fb51a2d475f3ed3b2034039a7feb Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Wed, 12 Oct 2022 22:09:38 +0200 Subject: [PATCH 1/5] use newer actions checkout and cache --- .github/workflows/build.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a0fc41c4..806e9c53 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: recursive @@ -20,7 +20,7 @@ jobs: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - name: Cache PlatformIO - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/.platformio key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} @@ -59,7 +59,7 @@ jobs: needs: build steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Get generated files from cache uses: actions/cache@v3 @@ -109,7 +109,7 @@ jobs: needs: build steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Get generated files from cache uses: actions/cache@v3 @@ -177,7 +177,7 @@ jobs: needs: build steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Get generated files from cache uses: actions/cache@v3 @@ -192,7 +192,7 @@ jobs: - name: Set Variables id: vars run: | - echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + echo "name=sha_short::$(git rev-parse --short HEAD)" - name: Prepare artifacts for release run: | @@ -231,7 +231,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/') steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Get generated files from cache uses: actions/cache@v3 @@ -262,7 +262,7 @@ jobs: - name: Set Variables id: vars run: | - echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + echo "name=sha_short::$(git rev-parse --short HEAD)" - name: Prepare artifacts for release From 34ea8302efa0e082154bf39376aea0a99a3278ae Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Wed, 12 Oct 2022 22:29:02 +0200 Subject: [PATCH 2/5] update action setup-python --- .github/workflows/build.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 806e9c53..a0233c50 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -26,7 +26,7 @@ jobs: key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 - name: Install PlatformIO run: | python -m pip install --upgrade pip @@ -192,7 +192,7 @@ jobs: - name: Set Variables id: vars run: | - echo "name=sha_short::$(git rev-parse --short HEAD)" + echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - name: Prepare artifacts for release run: | @@ -262,7 +262,7 @@ jobs: - name: Set Variables id: vars run: | - echo "name=sha_short::$(git rev-parse --short HEAD)" + echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - name: Prepare artifacts for release From 50b998353487d12377bb23f49e92cd71d61ae482 Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Wed, 12 Oct 2022 22:38:05 +0200 Subject: [PATCH 3/5] fix warning set-output --- .github/workflows/build.yaml | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a0233c50..b8c4154f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -17,7 +17,7 @@ jobs: - name: Set Variables id: vars run: | - echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - name: Cache PlatformIO uses: actions/cache@v3 @@ -74,24 +74,23 @@ jobs: - name: Set Variables id: vars run: | - echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - name: Rename firmware file to contain versioning (old ota) run: | mkdir -p ./dist_old_ota - cp "./code/.pio/build/esp32cam/firmware.bin" "./dist_old_ota/firmware__${{ github.ref_name }}_(${{ steps.vars.outputs.sha_short }}).bin" + cp "./code/.pio/build/esp32cam/firmware.bin" "./dist_old_ota/firmware__${{ github.ref_name }}_(${{ env.sha_short }}).bin" - name: Upload Firmware artifact (old OTA concept) uses: actions/upload-artifact@v3 with: -# name: "firmware__${{ github.ref_name }}__(${{ steps.vars.outputs.sha_short }})__(extract_before_upload__only_needed_for_migration_from_11.3.1)" - name: "firmware__(extract_before_upload)__${{ github.ref_name }}__(${{ steps.vars.outputs.sha_short }})" + name: "firmware__(extract_before_upload)__${{ github.ref_name }}__(${{ env.sha_short }})" path: ./dist_old_ota/* - name: Upload Web interface artifact (old OTA concept) uses: actions/upload-artifact@v3 with: - name: "html__${{ github.ref_name }}__(${{ steps.vars.outputs.sha_short }})" + name: "html__${{ github.ref_name }}__(${{ env.sha_short }})" path: ./sd-card/html/* @@ -124,27 +123,15 @@ jobs: - name: Set Variables id: vars run: | - echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - name: Prepare update.zip artifact run: | mkdir -p ./dist cp "./code/.pio/build/esp32cam/firmware.bin" "dist/firmware.bin" - -# - name: Upload update.zip Artifact (Firmware only) -# uses: actions/upload-artifact@v3 -# with: -# name: "update_firmware_only__${{ github.ref_name }}_(${{ steps.vars.outputs.sha_short }})" -# path: ./dist/* - name: Add Web UI to dist run: cp -r ./sd-card/html ./dist/ - -# - name: Upload update.zip artifact (Firmware + Web UI) -# uses: actions/upload-artifact@v3 -# with: -# name: "update_firmware+webinterface__${{ github.ref_name }}_(${{ steps.vars.outputs.sha_short }})" -# path: ./dist/* - name: Add CNN to dist run: | @@ -155,7 +142,7 @@ jobs: - name: Upload dist as update.zip artifact (Firmware + Web UI + CNN) uses: actions/upload-artifact@v3 with: - name: "update__${{ github.ref_name }}_(${{ steps.vars.outputs.sha_short }})" + name: "update__${{ github.ref_name }}_(${{ env.sha_short }})" path: ./dist/* - name: Store generated files in cache @@ -192,7 +179,7 @@ jobs: - name: Set Variables id: vars run: | - echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - name: Prepare artifacts for release run: | @@ -209,7 +196,7 @@ jobs: - name: Upload initial_esp32_setup.zip artifact (Firmware + Bootloader + Partitions + Web UI) uses: actions/upload-artifact@v3 with: - name: "initial_esp32_setup__${{ github.ref_name }}_(${{ steps.vars.outputs.sha_short }})" + name: "initial_esp32_setup__${{ github.ref_name }}_(${{ env.sha_short }})" path: ./firmware - name: Store generated files in cache @@ -262,7 +249,7 @@ jobs: - name: Set Variables id: vars run: | - echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - name: Prepare artifacts for release From 62742d92d2976f6b74b9f8d9a73945496d5b1581 Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Wed, 12 Oct 2022 22:41:41 +0200 Subject: [PATCH 4/5] set python verion because of warnings --- .github/workflows/build.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b8c4154f..71b95e3f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -27,6 +27,8 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 + with: + python-version: '3.10' - name: Install PlatformIO run: | python -m pip install --upgrade pip From 9c2de84ee459ca243bead2305d297edce5545933 Mon Sep 17 00:00:00 2001 From: Frank Haverland Date: Tue, 25 Oct 2022 06:18:43 +0200 Subject: [PATCH 5/5] fix slashes in github.ref_name --- .github/workflows/build.yaml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 66b5c3af..c87c9c81 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -77,23 +77,24 @@ jobs: id: vars run: | echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + echo "branch=$(echo ${{ github.ref_name }} | tr / .)" >> $GITHUB_OUTPUT - name: Rename firmware file to contain versioning (old ota) run: | mkdir -p ./dist_old_ota - cp "./code/.pio/build/esp32cam/firmware.bin" "./dist_old_ota/firmware__${{ github.ref_name }}_(${{ steps.vars.outputs.sha_short }}).bin" + cp "./code/.pio/build/esp32cam/firmware.bin" "./dist_old_ota/firmware__${{ steps.vars.outputs.branch }}_(${{ steps.vars.outputs.sha_short }}).bin" - name: Upload Firmware artifact (old OTA concept) uses: actions/upload-artifact@v3 with: # name: "firmware__${{ github.ref_name }}__(${{ steps.vars.outputs.sha_short }})__(extract_before_upload__only_needed_for_migration_from_11.3.1)" - name: "firmware__(extract_before_upload)__${{ github.ref_name }}__(${{ steps.vars.outputs.sha_short }})" + name: "firmware__(extract_before_upload)__${{ steps.vars.outputs.branch }}__(${{ steps.vars.outputs.sha_short }})" path: ./dist_old_ota/* - name: Upload Web interface artifact (old OTA concept) uses: actions/upload-artifact@v3 with: - name: "html__${{ github.ref_name }}__(${{ steps.vars.outputs.sha_short }})" + name: "html__${{ steps.vars.outputs.branch }}__(${{ steps.vars.outputs.sha_short }})" path: ./sd-card/html/* @@ -127,6 +128,7 @@ jobs: id: vars run: | echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + echo "branch=$(echo ${{ github.ref_name }} | tr / .)" >> $GITHUB_OUTPUT - name: Prepare update.zip artifact run: | @@ -157,7 +159,7 @@ jobs: - name: Upload dist as update.zip artifact (Firmware + Web UI + CNN) uses: actions/upload-artifact@v3 with: - name: "update__${{ github.ref_name }}_(${{ steps.vars.outputs.sha_short }})" + name: "update__${{ steps.vars.outputs.branch }}_(${{ steps.vars.outputs.sha_short }})" path: ./dist/* - name: Store generated files in cache @@ -165,7 +167,7 @@ jobs: with: path: | ./dist - key: ${{ github.run_number }}-pack-for-OTA-v2 + key: ${{ steps.vars.outputs.branch }}-pack-for-OTA-v2 @@ -195,6 +197,7 @@ jobs: id: vars run: | echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + echo "branch=$(echo ${{ github.ref_name }} | tr / .)" >> $GITHUB_OUTPUT - name: Prepare artifacts for release run: | @@ -211,7 +214,7 @@ jobs: - name: Upload initial_esp32_setup.zip artifact (Firmware + Bootloader + Partitions + Web UI) uses: actions/upload-artifact@v3 with: - name: "initial_esp32_setup__${{ github.ref_name }}_(${{ steps.vars.outputs.sha_short }})" + name: "initial_esp32_setup__${{ steps.vars.outputs.branch }}_(${{ steps.vars.outputs.sha_short }})" path: ./firmware - name: Store generated files in cache