Merge pull request #274 from Maxime0506/lock-momentary-override #246
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is a basic workflow to help you get started with Actions | |
| name: CI | |
| # Controls when the action will run. Triggers the workflow on push or pull request | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| tags: | |
| - 'v0.*' | |
| paths-ignore: | |
| - '.vscode/**' | |
| - '.gitignore' | |
| - 'LICENSE' | |
| - '*.md' | |
| - 'docs/**' | |
| concurrency: | |
| group: "build" | |
| cancel-in-progress: true | |
| jobs: | |
| cleanup-dev-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| if: ${{ github.ref == 'refs/heads/main' }} | |
| steps: | |
| - name: Delete dev release | |
| run: gh release --repo ${{ github.repository }} delete dev --cleanup-tag -y | |
| continue-on-error: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create tag | |
| uses: actions/github-script@v9 | |
| with: | |
| script: | | |
| github.rest.git.createRef({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| ref: 'refs/tags/dev', | |
| sha: context.sha | |
| }) | |
| littlefs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| sparse-checkout: 'data' | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install LittleFS Tool | |
| run: pip install littlefs-python | |
| - name: Install dependencies | |
| run: bun install | |
| working-directory: data | |
| - name: Build | |
| run: bun run build | |
| working-directory: data | |
| - name: Remove extra, only keep compressed | |
| run: find dist -regex ".*\.\(html\|css\|br\|js\|json.gz\)" -delete | |
| working-directory: data | |
| - name: Create LittleFS Image | |
| run: littlefs-python create $(pwd)/dist littlefs.bin -v --fs-size=0x20000 --name-max=64 --block-size=4096 | |
| working-directory: data | |
| - name: Archive build directory | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ui-build-directory | |
| path: data/dist | |
| retention-days: 1 | |
| - name: Archive LittleFS image | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: littlefs-binary | |
| path: data/littlefs.bin | |
| esp32: | |
| runs-on: ubuntu-latest | |
| needs: littlefs | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| submodules: 'recursive' | |
| - name: Get UI Build Directory | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: ui-build-directory | |
| path: data/dist | |
| - uses: actions/cache@v5 | |
| with: | |
| path: | | |
| $HOME/.ccache | |
| managed_components | |
| key: ${{ runner.os }}-esp32-build | |
| - name: ESP32 Build | |
| uses: espressif/esp-idf-ci-action@v1 | |
| with: | |
| esp_idf_version: v5.5.4 | |
| target: esp32 | |
| path: '.' | |
| extra_docker_args: -v $HOME/.ccache:/root/.ccache -e CCACHE_DIR=/root/.ccache | |
| command: CI=true idf.py --ccache build && idf.py merge-bin | |
| - name: Rename firmware | |
| run: sudo chown -R $USER:$USER build/ && mv build/HomeKey-ESP32.bin build/esp32.firmware.bin && mv build/merged-binary.bin build/esp32.firmware.factory.bin | |
| - name: Archive firmware | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: esp32-firmware | |
| path: build/esp32.firmware.bin | |
| - name: Archive merged binary | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: esp32-firmware-factory | |
| path: build/esp32.firmware.factory.bin | |
| esp32c3: | |
| runs-on: ubuntu-latest | |
| needs: littlefs | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| submodules: 'recursive' | |
| - name: Get UI Build Directory | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: ui-build-directory | |
| path: data/dist | |
| - uses: actions/cache@v5 | |
| with: | |
| path: | | |
| $HOME/.ccache | |
| managed_components | |
| key: ${{ runner.os }}-esp32c3-build | |
| - name: ESP32C3 Build | |
| uses: espressif/esp-idf-ci-action@v1 | |
| with: | |
| esp_idf_version: v5.5.4 | |
| target: esp32c3 | |
| path: '.' | |
| extra_docker_args: -v $HOME/.ccache:/root/.ccache -e CCACHE_DIR=/root/.ccache | |
| command: CI=true idf.py --ccache build && idf.py merge-bin | |
| - name: Rename firmware | |
| run: sudo chown -R $USER:$USER build/ && mv build/HomeKey-ESP32.bin build/esp32c3.firmware.bin && mv build/merged-binary.bin build/esp32c3.firmware.factory.bin | |
| - name: Archive firmware | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: esp32c3-firmware | |
| path: build/esp32c3.firmware.bin | |
| - name: Archive merged binary | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: esp32c3-firmware-factory | |
| path: build/esp32c3.firmware.factory.bin | |
| esp32c6: | |
| runs-on: ubuntu-latest | |
| needs: littlefs | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| submodules: 'recursive' | |
| - name: Get UI Build Directory | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: ui-build-directory | |
| path: data/dist | |
| - uses: actions/cache@v5 | |
| with: | |
| path: | | |
| $HOME/.ccache | |
| managed_components | |
| key: ${{ runner.os }}-esp32c6-build | |
| - name: ESP32C6 Build | |
| uses: espressif/esp-idf-ci-action@v1 | |
| with: | |
| esp_idf_version: v5.5.4 | |
| target: esp32c6 | |
| path: '.' | |
| command: CI=true idf.py --ccache build && idf.py merge-bin | |
| - name: Rename firmware | |
| run: sudo chown -R $USER:$USER build/ && mv build/HomeKey-ESP32.bin build/esp32c6.firmware.bin && mv build/merged-binary.bin build/esp32c6.firmware.factory.bin | |
| - name: Archive firmware | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: esp32c6-firmware | |
| path: build/esp32c6.firmware.bin | |
| - name: Archive merged binary | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: esp32c6-firmware-factory | |
| path: build/esp32c6.firmware.factory.bin | |
| esp32s3: | |
| runs-on: ubuntu-latest | |
| needs: littlefs | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| submodules: 'recursive' | |
| - name: Get UI Build Directory | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: ui-build-directory | |
| path: data/dist | |
| - uses: actions/cache@v5 | |
| with: | |
| path: | | |
| $HOME/.ccache | |
| managed_components | |
| key: ${{ runner.os }}-esp32s3-build | |
| - name: ESP32S3 Build | |
| uses: espressif/esp-idf-ci-action@v1 | |
| with: | |
| esp_idf_version: v5.5.4 | |
| target: esp32s3 | |
| path: '.' | |
| extra_docker_args: -v $HOME/.ccache:/root/.ccache -e CCACHE_DIR=/root/.ccache | |
| command: CI=true idf.py --ccache build && idf.py merge-bin | |
| - name: Rename firmware | |
| run: sudo chown -R $USER:$USER build/ && mv build/HomeKey-ESP32.bin build/esp32s3.firmware.bin && mv build/merged-binary.bin build/esp32s3.firmware.factory.bin | |
| - name: Archive firmware | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: esp32s3-firmware | |
| path: build/esp32s3.firmware.bin | |
| - name: Archive merged binary | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: esp32s3-firmware-factory | |
| path: build/esp32s3.firmware.factory.bin | |
| pre-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| if: ${{ github.ref == 'refs/heads/main' }} | |
| needs: [littlefs, esp32, esp32c3, esp32c6, esp32s3] | |
| steps: | |
| - name: Get Artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Create release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| tag: ${{ github.ref_name }} | |
| run: | | |
| gh release create dev \ | |
| --repo="$GITHUB_REPOSITORY" \ | |
| --title="development" \ | |
| --prerelease \ | |
| --generate-notes \ | |
| artifacts/esp32.firmware.bin \ | |
| artifacts/esp32.firmware.factory.bin \ | |
| artifacts/esp32c3.firmware.bin \ | |
| artifacts/esp32c3.firmware.factory.bin \ | |
| artifacts/esp32c6.firmware.bin \ | |
| artifacts/esp32c6.firmware.factory.bin \ | |
| artifacts/esp32s3.firmware.bin \ | |
| artifacts/esp32s3.firmware.factory.bin \ | |
| artifacts/littlefs.bin |