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