-
-
Notifications
You must be signed in to change notification settings - Fork 21
93 lines (88 loc) · 2.87 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
name: Build firmware
on:
# push:
# branches:
# - main
pull_request:
workflow_dispatch:
workflow_call:
inputs:
release-url:
required: true
type: string
# release:
# types: [published]
concurrency:
# yamllint disable-line rule:line-length
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
RELEASE_URL: ${{ github.server_url }}/${{ github.repository }}/releases/latest
jobs:
build:
name: ${{ matrix.file }}
runs-on: ubuntu-latest
strategy:
max-parallel: 3
matrix:
file:
- onju-voice
- onju-voice-microwakeword
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]
- name: 🔨 Build firmware
uses: esphome/[email protected]
id: esphome-build
with:
yaml-file: esphome/${{ matrix.file }}.yaml
version: latest
release-summary: "Check the release notes for more information."
release-url: ${{ inputs.release-url || env.RELEASE_URL }}
cache: true
- name: 🚚 Move generated files to output
run: |
mkdir -p output/${{ matrix.file }}
mv ${{ steps.esphome-build.outputs.name }}/* output/${{ matrix.file }}
echo ${{ steps.esphome-build.outputs.version }} > output/${{ matrix.file }}/version
echo ${{ steps.esphome-build.outputs.project-version }} > output/${{ matrix.file }}/project-version
- name: Display the generated files
run: ls -R output
- name: ⬆️ Upload firmware / device artifact
uses: actions/[email protected]
with:
name: build-${{ steps.esphome-build.outputs.name }}
path: output
retention-days: 1
consolidate:
name: Consolidate manifests
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
include:
- project: onju-voice
name: Onju Voice
- project: onju-voice-microwakeword
name: Onju Voice Microwakeword
steps:
- name: ⤵️ Download artifacts
uses: actions/[email protected]
with:
name: build-${{ matrix.project }}-*
merge-multiple: true
path: files
- name: 🔨 Generate combined manifest.json
run: |
version=$(cat files/*/project_version | sort -V | tail -n 1)
jq -s --arg version "$version" '{"name": "${{ matrix.name }}", "version": $version, "home_assistant_domain": "esphome", "builds":.}' files/*/manifest.json > files/manifest.json
- name: 🧪 Display structure of job
run: ls -R
- name: ⬆️ Upload project artifact
uses: actions/[email protected]
with:
name: ${{ matrix.project }}
path: files
retention-days: 1