|
1 | 1 | name: Build |
2 | 2 |
|
3 | 3 | on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
4 | 8 | workflow_dispatch: |
| 9 | + release: |
| 10 | + types: [published] |
5 | 11 |
|
6 | | -jobs: |
7 | | - build: |
8 | | - name: Build ${{ matrix.firmware.name }} |
9 | | - runs-on: ubuntu-latest |
10 | | - strategy: |
11 | | - matrix: |
12 | | - firmware: |
13 | | - - file: m5stack-atom-echo.yaml |
14 | | - name: M5 Stack Atom Echo |
15 | | - manifest_filename: m5stack-atom-echo-manifest.json |
16 | | - - file: m5stack-atom-speaker-kit.yaml |
17 | | - name: M5 Stack Atom Speaker Kit |
18 | | - manifest_filename: m5stack-atom-speaker-kit-manifest.json |
19 | | - - file: raspiaudio-muse-proto.yaml |
20 | | - name: Raspiaudio Muse Proto |
21 | | - manifest_filename: raspiaudio-muse-proto-manifest.json |
22 | | - - file: raspiaudio-muse-luxe.yaml |
23 | | - name: Raspiaudio Muse Luxe |
24 | | - manifest_filename: raspiaudio-muse-luxe-manifest.json |
25 | | - fail-fast: false |
26 | | - steps: |
27 | | - - name: Checkout source code |
28 | | - |
29 | | - - name: Build firmware |
30 | | - |
31 | | - id: esphome-build |
32 | | - with: |
33 | | - yaml_file: ${{ matrix.firmware.file }} |
34 | | - version: latest |
35 | | - - name: Copy firmware and manifest |
36 | | - run: | |
37 | | - mkdir output |
38 | | - mv ${{ steps.esphome-build.outputs.name }} output/ |
39 | | - jq -s '{"name": "${{ matrix.firmware.name }}", "version": "${{ steps.esphome-build.outputs.esphome-version }}", "home_assistant_domain": "esphome", "new_install_skip_erase": false, "builds":.}' output/${{ steps.esphome-build.outputs.name }}/manifest.json > output/${{ matrix.firmware.manifest_filename }} |
40 | | -
|
41 | | - - name: Upload artifact |
42 | | - |
43 | | - with: |
44 | | - name: ${{ matrix.firmware.name }} |
45 | | - path: output |
| 12 | +concurrency: |
| 13 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 14 | + cancel-in-progress: true |
46 | 15 |
|
| 16 | +jobs: |
| 17 | + build-firmware: |
| 18 | + name: Build Firmware |
| 19 | + uses: esphome/workflows/.github/workflows/build.yml@main |
| 20 | + with: |
| 21 | + files: | |
| 22 | + m5stack/m5stack-atom-echo.factory.yaml |
| 23 | + m5stack/m5stack-atom-speaker-kit.factory.yaml |
| 24 | + onju-voice/onju-voice.factory.yaml |
| 25 | + raspiaudio/raspiaudio-muse-luxe.factory.yaml |
| 26 | + raspiaudio/raspiaudio-muse-proto.factory.yaml |
| 27 | + esphome-version: 2024.7.3 |
| 28 | + release-summary: ${{ github.event_name == 'release' && github.event.release.body || '' }} |
| 29 | + release-url: ${{ github.event_name == 'release' && github.event.release.html_url || '' }} |
| 30 | + release-version: ${{ github.event_name == 'release' && github.event.release.tag_name || '' }} |
47 | 31 |
|
48 | | - consolidate: |
49 | | - if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && github.ref == 'refs/heads/main' |
50 | | - name: Consolidate firmwares |
51 | | - runs-on: ubuntu-latest |
52 | | - needs: build |
53 | | - steps: |
54 | | - - name: Checkout source code |
55 | | - uses: actions/checkout@v3 |
56 | | - - name: Download built firmwares |
57 | | - uses: actions/download-artifact@v3 |
58 | | - with: |
59 | | - path: firmwares |
60 | | - - name: Copy files |
61 | | - run: |- |
62 | | - mkdir output |
63 | | - cp -R static/* output/ |
64 | | - cp -R firmwares/*/* output/ |
65 | | - - name: Upload GitHub Pages artifact |
66 | | - |
67 | | - with: |
68 | | - path: output |
69 | | - |
70 | | - deploy: |
71 | | - if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && github.ref == 'refs/heads/main' |
72 | | - name: Deploy to GitHub Pages |
73 | | - runs-on: ubuntu-latest |
74 | | - needs: consolidate |
75 | | - permissions: |
76 | | - pages: write |
77 | | - id-token: write |
78 | | - environment: |
79 | | - name: github-pages |
80 | | - url: ${{ steps.deployment.outputs.page_url }} |
81 | | - steps: |
82 | | - - name: Setup Pages |
83 | | - uses: actions/configure-pages@v2 |
84 | | - - name: Deploy to GitHub Pages |
85 | | - id: deployment |
86 | | - |
| 32 | + upload: |
| 33 | + if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') |
| 34 | + name: Upload to R2 |
| 35 | + needs: |
| 36 | + - build-firmware |
| 37 | + uses: esphome/workflows/.github/workflows/upload.yml@main |
| 38 | + with: |
| 39 | + name: wake-word-voice-assistant |
| 40 | + version: ${{ needs.build-firmware.outputs.version }} |
| 41 | + secrets: inherit |
0 commit comments