Build #107
This file contains 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
name: Build | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
pull_request: | |
schedule: | |
- cron: "0 5 * * 1" | |
concurrency: | |
# yamllint disable-line rule:line-length | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build firmware | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: esphome/build-action@v1.8.0 | |
id: esphome-build | |
with: | |
yaml_file: example/mr24hpc1.yaml | |
version: latest | |
- name: Move generated files to output | |
run: | | |
mkdir -p output | |
mv ${{ steps.esphome-build.outputs.name }} output/ | |
mv output/${{ steps.esphome-build.outputs.name }}/manifest.json output/ | |
echo ${{ steps.esphome-build.outputs.version }} > output/version | |
- uses: actions/upload-artifact@v3.1.3 | |
with: | |
name: seeedstudio-mmwave-kit-esp32c3 | |
path: output | |
manifest: | |
name: Create full manifest | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: seeedstudio-mmwave-kit-esp32c3 | |
path: files | |
- name: Generate manifest.json files | |
run: | | |
cd files | |
mkdir ../output | |
version=$(cat version) | |
jq --arg version "$version" '{"name": "Seeed Studio mmWave Kit", "version": $version, "home_assistant_domain": "esphome", "new_install_skip_erase": false, "builds":[.]}' manifest.json > ../output/manifest.json | |
- uses: actions/upload-artifact@v3.1.3 | |
with: | |
name: seeedstudio-mmwave-kit-esp32c3 | |
path: output | |
consolidate: | |
name: Consolidate firmwares | |
runs-on: ubuntu-latest | |
needs: manifest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v3 | |
with: | |
path: output | |
- run: cp -R static/* output/ | |
- uses: actions/upload-pages-artifact@v2.0.0 | |
with: | |
path: output | |
deploy: | |
if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && github.ref == 'refs/heads/main' | |
name: Deploy to GitHub Pages | |
runs-on: ubuntu-latest | |
needs: consolidate | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2.0.4 |