|
9 | 9 | branches: ["master"] |
10 | 10 | paths: |
11 | 11 | - Dockerfile |
12 | | - - build.yaml |
13 | 12 | - 'rootfs/**' |
14 | 13 | - 'patches/**' |
15 | 14 |
|
16 | 15 | env: |
| 16 | + ARCHITECTURES: '["amd64", "aarch64"]' |
17 | 17 | BUILD_NAME: audio |
18 | 18 | BUILD_TYPE: plugin |
| 19 | + IMAGE_NAME: hassio-audio |
| 20 | + |
| 21 | +permissions: |
| 22 | + contents: read |
19 | 23 |
|
20 | 24 | jobs: |
21 | 25 | init: |
22 | 26 | name: Initialize build |
23 | 27 | runs-on: ubuntu-latest |
24 | 28 | outputs: |
25 | | - architectures: ${{ steps.info.outputs.architectures }} |
26 | 29 | version: ${{ steps.version.outputs.version }} |
27 | 30 | channel: ${{ steps.version.outputs.channel }} |
28 | 31 | publish: ${{ steps.version.outputs.publish }} |
| 32 | + matrix: ${{ steps.matrix.outputs.matrix }} |
29 | 33 | steps: |
30 | 34 | - name: Checkout the repository |
31 | | - uses: actions/checkout@v6.0.2 |
| 35 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
32 | 36 | with: |
33 | 37 | fetch-depth: 0 |
34 | 38 |
|
35 | | - - name: Get information |
36 | | - id: info |
37 | | - uses: home-assistant/actions/helpers/info@master |
38 | | - |
39 | 39 | - name: Get version |
40 | 40 | id: version |
41 | 41 | uses: home-assistant/actions/helpers/version@master |
42 | 42 | with: |
43 | 43 | type: ${{ env.BUILD_TYPE }} |
44 | 44 |
|
| 45 | + - name: Get build matrix |
| 46 | + id: matrix |
| 47 | + uses: home-assistant/builder/actions/prepare-multi-arch-matrix@62a1597b84b3461abad9816d9cd92862a2b542c3 # 2026.03.2 |
| 48 | + with: |
| 49 | + architectures: ${{ env.ARCHITECTURES }} |
| 50 | + image-name: ${{ env.IMAGE_NAME }} |
| 51 | + |
45 | 52 | build: |
46 | | - name: Build ${{ matrix.arch }} plugin |
| 53 | + name: Build ${{ matrix.arch }} image |
47 | 54 | needs: init |
48 | | - runs-on: ${{ matrix.runs-on }} |
| 55 | + runs-on: ${{ matrix.os }} |
49 | 56 | permissions: |
50 | 57 | contents: read |
51 | | - packages: write |
52 | 58 | id-token: write |
| 59 | + packages: write |
53 | 60 | strategy: |
54 | | - matrix: |
55 | | - arch: ${{ fromJson(needs.init.outputs.architectures) }} |
56 | | - include: |
57 | | - - runs-on: ubuntu-24.04 |
58 | | - - arch: aarch64 |
59 | | - runs-on: ubuntu-24.04-arm |
| 61 | + fail-fast: false |
| 62 | + matrix: ${{ fromJSON(needs.init.outputs.matrix) }} |
60 | 63 | steps: |
61 | | - - name: Checkout the repository |
62 | | - uses: actions/checkout@v6.0.2 |
63 | | - |
64 | | - - name: Login to GitHub Container Registry |
65 | | - if: needs.init.outputs.publish == 'true' |
66 | | - uses: docker/login-action@v4.0.0 |
67 | | - with: |
68 | | - registry: ghcr.io |
69 | | - username: ${{ github.repository_owner }} |
70 | | - password: ${{ secrets.GITHUB_TOKEN }} |
| 64 | + - name: Checkout the repository |
| 65 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 66 | + with: |
| 67 | + persist-credentials: false |
71 | 68 |
|
72 | | - - name: Set build arguments |
73 | | - if: needs.init.outputs.publish == 'false' |
74 | | - run: echo "BUILD_ARGS=--test" >> $GITHUB_ENV |
| 69 | + - name: Build image |
| 70 | + id: build |
| 71 | + uses: home-assistant/builder/actions/build-image@62a1597b84b3461abad9816d9cd92862a2b542c3 # 2026.03.2 |
| 72 | + with: |
| 73 | + arch: ${{ matrix.arch }} |
| 74 | + container-registry-password: ${{ secrets.GITHUB_TOKEN }} |
| 75 | + cosign-base-identity: 'https://github.com/home-assistant/docker-base/.*' |
| 76 | + cosign-base-verify: ghcr.io/home-assistant/base:3.23 |
| 77 | + image: ${{ matrix.image }} |
| 78 | + image-tags: | |
| 79 | + ${{ needs.init.outputs.version }} |
| 80 | + latest |
| 81 | + push: ${{ needs.init.outputs.publish == 'true' }} |
| 82 | + version: ${{ needs.init.outputs.version }} |
75 | 83 |
|
76 | | - - name: Build plugin |
77 | | - uses: home-assistant/builder@2026.02.1 |
78 | | - with: |
79 | | - image: ${{ matrix.arch }} |
80 | | - args: | |
81 | | - $BUILD_ARGS \ |
82 | | - --${{ matrix.arch }} \ |
83 | | - --cosign \ |
84 | | - --target /data \ |
85 | | - --generic ${{ needs.init.outputs.version }} |
86 | | - env: |
87 | | - CAS_API_KEY: ${{ secrets.CAS_TOKEN }} |
| 84 | + manifest: |
| 85 | + name: Publish multi-arch manifest |
| 86 | + needs: [init, build] |
| 87 | + if: needs.init.outputs.publish == 'true' |
| 88 | + runs-on: ubuntu-latest |
| 89 | + permissions: |
| 90 | + id-token: write |
| 91 | + packages: write |
| 92 | + steps: |
| 93 | + - name: Publish multi-arch manifest |
| 94 | + uses: home-assistant/builder/actions/publish-multi-arch-manifest@62a1597b84b3461abad9816d9cd92862a2b542c3 # 2026.03.2 |
| 95 | + with: |
| 96 | + architectures: ${{ env.ARCHITECTURES }} |
| 97 | + container-registry-password: ${{ secrets.GITHUB_TOKEN }} |
| 98 | + image-name: ${{ env.IMAGE_NAME }} |
| 99 | + image-tags: | |
| 100 | + ${{ needs.init.outputs.version }} |
| 101 | + latest |
88 | 102 |
|
89 | 103 | version: |
90 | 104 | name: Update version |
91 | | - needs: ["init", "build"] |
| 105 | + if: github.repository_owner == 'home-assistant' |
| 106 | + needs: [init, build, manifest] |
92 | 107 | runs-on: ubuntu-latest |
93 | 108 | steps: |
94 | 109 | - name: Checkout the repository |
95 | 110 | if: needs.init.outputs.publish == 'true' |
96 | | - uses: actions/checkout@v6.0.2 |
| 111 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
97 | 112 |
|
98 | 113 | - name: Initialize git |
99 | 114 | if: needs.init.outputs.publish == 'true' |
|
0 commit comments