|
14 | 14 | PIP_TIMEOUT: 60 |
15 | 15 | UV_HTTP_TIMEOUT: 60 |
16 | 16 | UV_SYSTEM_PYTHON: "true" |
| 17 | + BASE_IMAGE_VERSION: "2025.11.0" |
17 | 18 |
|
18 | 19 | jobs: |
19 | 20 | init: |
20 | 21 | name: Initialize build |
21 | 22 | if: github.repository_owner == 'home-assistant' |
22 | 23 | runs-on: ubuntu-latest |
23 | 24 | outputs: |
24 | | - architectures: ${{ steps.info.outputs.architectures }} |
25 | 25 | version: ${{ steps.version.outputs.version }} |
26 | 26 | channel: ${{ steps.version.outputs.channel }} |
27 | 27 | publish: ${{ steps.version.outputs.publish }} |
@@ -77,15 +77,20 @@ jobs: |
77 | 77 | name: Build ${{ matrix.arch }} base core image |
78 | 78 | if: github.repository_owner == 'home-assistant' |
79 | 79 | needs: init |
80 | | - runs-on: ubuntu-latest |
| 80 | + runs-on: ${{ matrix.os }} |
81 | 81 | permissions: |
82 | 82 | contents: read |
83 | 83 | packages: write |
84 | 84 | id-token: write |
85 | 85 | strategy: |
86 | 86 | fail-fast: false |
87 | 87 | matrix: |
88 | | - arch: ${{ fromJson(needs.init.outputs.architectures) }} |
| 88 | + arch: ["amd64", "aarch64"] |
| 89 | + include: |
| 90 | + - arch: amd64 |
| 91 | + os: ubuntu-latest |
| 92 | + - arch: aarch64 |
| 93 | + os: ubuntu-24.04-arm |
89 | 94 | steps: |
90 | 95 | - name: Checkout the repository |
91 | 96 | uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 |
@@ -182,16 +187,59 @@ jobs: |
182 | 187 | username: ${{ github.repository_owner }} |
183 | 188 | password: ${{ secrets.GITHUB_TOKEN }} |
184 | 189 |
|
185 | | - # home-assistant/builder doesn't support sha pinning |
| 190 | + - name: Install Cosign |
| 191 | + uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0 |
| 192 | + with: |
| 193 | + cosign-release: "v2.5.3" |
| 194 | + |
| 195 | + - name: Set up Docker Buildx |
| 196 | + uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 |
| 197 | + |
| 198 | + - name: Build variables |
| 199 | + id: vars |
| 200 | + shell: bash |
| 201 | + run: | |
| 202 | + echo "base_image=ghcr.io/home-assistant/${{ matrix.arch }}-homeassistant-base:${{ env.BASE_IMAGE_VERSION }}" >> "$GITHUB_OUTPUT" |
| 203 | + echo "cache_image=ghcr.io/home-assistant/${{ matrix.arch }}-homeassistant:latest" >> "$GITHUB_OUTPUT" |
| 204 | + echo "created=$(date --rfc-3339=seconds --utc)" >> "$GITHUB_OUTPUT" |
| 205 | +
|
| 206 | + - name: Verify base image signature |
| 207 | + run: | |
| 208 | + cosign verify \ |
| 209 | + --certificate-oidc-issuer https://token.actions.githubusercontent.com \ |
| 210 | + --certificate-identity-regexp "https://github.com/home-assistant/docker/.*" \ |
| 211 | + "${{ steps.vars.outputs.base_image }}" |
| 212 | +
|
| 213 | + - name: Verify cache image signature |
| 214 | + id: cache |
| 215 | + continue-on-error: true |
| 216 | + run: | |
| 217 | + cosign verify \ |
| 218 | + --certificate-oidc-issuer https://token.actions.githubusercontent.com \ |
| 219 | + --certificate-identity-regexp "https://github.com/home-assistant/core/.*" \ |
| 220 | + "${{ steps.vars.outputs.cache_image }}" |
| 221 | +
|
186 | 222 | - name: Build base image |
187 | | - uses: home-assistant/[email protected] |
| 223 | + id: build |
| 224 | + uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 |
188 | 225 | with: |
189 | | - args: | |
190 | | - $BUILD_ARGS \ |
191 | | - --${{ matrix.arch }} \ |
192 | | - --cosign \ |
193 | | - --target /data \ |
194 | | - --generic ${{ needs.init.outputs.version }} |
| 226 | + context: . |
| 227 | + file: ./Dockerfile |
| 228 | + platforms: ${{ steps.vars.outputs.platform }} |
| 229 | + push: true |
| 230 | + cache-from: ${{ steps.cache.outcome == 'success' && steps.vars.outputs.cache_image || '' }} |
| 231 | + build-args: | |
| 232 | + BUILD_FROM=${{ steps.vars.outputs.base_image }} |
| 233 | + tags: ghcr.io/home-assistant/${{ matrix.arch }}-homeassistant:${{ needs.init.outputs.version }} |
| 234 | + labels: | |
| 235 | + io.hass.arch=${{ matrix.arch }} |
| 236 | + io.hass.version=${{ needs.init.outputs.version }} |
| 237 | + org.opencontainers.image.created=${{ steps.vars.outputs.created }} |
| 238 | + org.opencontainers.image.version=${{ needs.init.outputs.version }} |
| 239 | +
|
| 240 | + - name: Sign image |
| 241 | + run: | |
| 242 | + cosign sign --yes "ghcr.io/home-assistant/${{ matrix.arch }}-homeassistant:${{ needs.init.outputs.version }}@${{ steps.build.outputs.digest }}" |
195 | 243 |
|
196 | 244 | build_machine: |
197 | 245 | name: Build ${{ matrix.machine }} machine core image |
|
0 commit comments