use cache

This commit is contained in:
Frank Haverland
2022-09-25 14:30:53 +02:00
parent 0d67282c00
commit 7397927b77

View File

@@ -158,6 +158,18 @@ jobs:
name: "update__${{ github.ref_name }}_(${{ steps.vars.outputs.sha_short }})"
path: ./dist/*
- name: Store generated files in cache
uses: actions/cache@v3
with:
path: |
./code/.pio/build/esp32cam/firmware.bin
./code/.pio/build/esp32cam/partitions.bin
./code/.pio/build/esp32cam/bootloader.bin
./sd-card/html/version.txt
./dist
key: ${{ github.run_number }}
#########################################################################################
@@ -182,19 +194,38 @@ jobs:
key: ${{ github.run_number }}
#########################################################################################
## Prepare release
## Prepare and create release
#########################################################################################
release:
runs-on: ubuntu-latest
needs: pack-for-OTA-v2
steps:
- uses: actions/checkout@v2
- name: Get generated files from cache
uses: actions/cache@v3
with:
path: |
./code/.pio/build/esp32cam/firmware.bin
./code/.pio/build/esp32cam/partitions.bin
./code/.pio/build/esp32cam/bootloader.bin
./sd-card/html/version.txt
./dist
key: ${{ github.run_number }}
- name: Set Variables
id: vars
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Prepare artifacts for release
if: startsWith(github.ref, 'refs/tags/')
run: |
mkdir -p release
# copy builds to release folder
mkdir -p firmware
mkdir -p firmware
# copy builds to firmware folder
cp -f "./code/.pio/build/esp32cam/firmware.bin" "release/firmware.bin"
cp -f "./code/.pio/build/esp32cam/bootloader.bin" "release/bootloader.bin"
cp -f "./code/.pio/build/esp32cam/partitions.bin" "release/partitions.bin"
@@ -206,11 +237,11 @@ jobs:
zip -r ../release/update.zip .
- name: Upload initial_esp32_setup.zip artifact (Firmware + Bootloader + Partitions + Web UI + CNN)
- 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 }})"
path: ./firmware
path: ./release
# extract the version used in next step