mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-20 14:38:17 +03:00
use cache
This commit is contained in:
161
.github/workflows/build.yaml
vendored
161
.github/workflows/build.yaml
vendored
@@ -158,6 +158,18 @@ jobs:
|
|||||||
name: "update__${{ github.ref_name }}_(${{ steps.vars.outputs.sha_short }})"
|
name: "update__${{ github.ref_name }}_(${{ steps.vars.outputs.sha_short }})"
|
||||||
path: ./dist/*
|
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,77 +194,96 @@ jobs:
|
|||||||
key: ${{ github.run_number }}
|
key: ${{ github.run_number }}
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
## Prepare release
|
## Prepare and create release
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: pack-for-OTA-v2
|
||||||
|
|
||||||
- name: Set Variables
|
steps:
|
||||||
id: vars
|
- uses: actions/checkout@v2
|
||||||
run: |
|
|
||||||
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
|
||||||
|
|
||||||
- name: Prepare artifacts for release
|
- name: Get generated files from cache
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
uses: actions/cache@v3
|
||||||
run: |
|
with:
|
||||||
mkdir -p release
|
path: |
|
||||||
# copy builds to release folder
|
./code/.pio/build/esp32cam/firmware.bin
|
||||||
cp -f "./code/.pio/build/esp32cam/firmware.bin" "release/firmware.bin"
|
./code/.pio/build/esp32cam/partitions.bin
|
||||||
cp -f "./code/.pio/build/esp32cam/bootloader.bin" "release/bootloader.bin"
|
./code/.pio/build/esp32cam/bootloader.bin
|
||||||
cp -f "./code/.pio/build/esp32cam/partitions.bin" "release/partitions.bin"
|
./sd-card/html/version.txt
|
||||||
rm -rf ./release/*
|
./dist
|
||||||
cd sd-card
|
key: ${{ github.run_number }}
|
||||||
zip -r ../release/html.zip html
|
|
||||||
# create a update.zip like "update__rolling"
|
|
||||||
cd ../dist
|
|
||||||
zip -r ../release/update.zip .
|
|
||||||
|
|
||||||
|
|
||||||
- name: Upload initial_esp32_setup.zip artifact (Firmware + Bootloader + Partitions + Web UI + CNN)
|
- name: Set Variables
|
||||||
uses: actions/upload-artifact@v3
|
id: vars
|
||||||
with:
|
run: |
|
||||||
name: "initial_esp32_setup__${{ github.ref_name }}_(${{ steps.vars.outputs.sha_short }})"
|
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
||||||
path: ./firmware
|
|
||||||
|
|
||||||
|
|
||||||
# extract the version used in next step
|
|
||||||
- id: get_version
|
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
|
||||||
uses: battila7/get-version-action@v2
|
|
||||||
|
|
||||||
# the changelog [unreleased] will now be changed to the release version
|
- name: Prepare artifacts for release
|
||||||
- name: Update changelog
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
uses: thomaseizinger/keep-a-changelog-new-release@v1
|
run: |
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
mkdir -p firmware
|
||||||
with:
|
mkdir -p firmware
|
||||||
changelogPath: Changelog.md
|
# copy builds to firmware folder
|
||||||
version: ${{ steps.get_version.outputs.version-without-v }}
|
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"
|
||||||
|
rm -rf ./release/*
|
||||||
|
cd sd-card
|
||||||
|
zip -r ../release/html.zip html
|
||||||
|
# create a update.zip like "update__rolling"
|
||||||
|
cd ../dist
|
||||||
|
zip -r ../release/update.zip .
|
||||||
|
|
||||||
|
|
||||||
|
- 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: ./release
|
||||||
|
|
||||||
|
|
||||||
|
# extract the version used in next step
|
||||||
|
- id: get_version
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
uses: battila7/get-version-action@v2
|
||||||
|
|
||||||
|
# the changelog [unreleased] will now be changed to the release version
|
||||||
|
- name: Update changelog
|
||||||
|
uses: thomaseizinger/keep-a-changelog-new-release@v1
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
with:
|
||||||
|
changelogPath: Changelog.md
|
||||||
|
version: ${{ steps.get_version.outputs.version-without-v }}
|
||||||
|
|
||||||
|
# the release notes will be extracted from changelog
|
||||||
|
- name: Extract release notes
|
||||||
|
id: extract-release-notes
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
uses: ffurrer2/extract-release-notes@v1
|
||||||
|
with:
|
||||||
|
changelog_file: Changelog.md
|
||||||
|
|
||||||
# the release notes will be extracted from changelog
|
|
||||||
- name: Extract release notes
|
|
||||||
id: extract-release-notes
|
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
|
||||||
uses: ffurrer2/extract-release-notes@v1
|
|
||||||
with:
|
|
||||||
changelog_file: Changelog.md
|
|
||||||
|
|
||||||
|
|
||||||
# Releases should only be created on master by tagging the last commit.
|
# Releases should only be created on master by tagging the last commit.
|
||||||
# all artifacts in firmware folder pushed to the release
|
# all artifacts in firmware folder pushed to the release
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
with:
|
with:
|
||||||
name: ${{ steps.get_version.outputs.version-without-v }}
|
name: ${{ steps.get_version.outputs.version-without-v }}
|
||||||
body: ${{ steps.extract-release-notes.outputs.release_notes }}
|
body: ${{ steps.extract-release-notes.outputs.release_notes }}
|
||||||
files: |
|
files: |
|
||||||
release/*
|
release/*
|
||||||
|
|
||||||
|
|
||||||
# Commit&Push Changelog to master branch. Must be manually merged back to rolling
|
# Commit&Push Changelog to master branch. Must be manually merged back to rolling
|
||||||
- name: Commit changes and push changes
|
- name: Commit changes and push changes
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
run: |
|
run: |
|
||||||
git config user.name github-actions
|
git config user.name github-actions
|
||||||
git config user.email github-actions@github.com
|
git config user.email github-actions@github.com
|
||||||
git add Changelog.md
|
git add Changelog.md
|
||||||
git commit Changelog.md -m "Update Changelog.md for ${{github.event.inputs.versionIncrement}} release"
|
git commit Changelog.md -m "Update Changelog.md for ${{github.event.inputs.versionIncrement}} release"
|
||||||
git push origin HEAD:master
|
git push origin HEAD:master
|
||||||
|
|||||||
Reference in New Issue
Block a user