diff --git a/.github/workflows/update-deps.yml b/.github/workflows/update-deps.yml index 21b2602b..8128cebd 100644 --- a/.github/workflows/update-deps.yml +++ b/.github/workflows/update-deps.yml @@ -34,6 +34,7 @@ jobs: - cosign - regctl - undock + - lima steps: - name: GitHub auth token from GitHub App @@ -281,6 +282,59 @@ jobs: }; } }, + lima: { + name: 'Lima images', + branch: 'deps/lima-images', + sourceUrl: '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/lima-vm/lima/blob/master/templates/_images/ubuntu-24.04.yaml', + async resolve({github}) { + const {data} = await github.rest.repos.getContent({ + owner: 'lima-vm', + repo: 'lima', + path: 'templates/_images/ubuntu-24.04.yaml', + ref: 'master' + }); + const template = Buffer.from(data.content, 'base64').toString('utf8'); + const baseUrl = 'https://cloud-images.ubuntu.com/releases/noble/'; + const release = template.match(new RegExp(`${escapeRegExp(baseUrl)}release-(\\d{8})/ubuntu-24\\.04-server-cloudimg-amd64\\.img`))?.[1]; + if (!release) { + throw new Error('Unable to resolve the pinned Ubuntu 24.04 release from Lima'); + } + + const targets = []; + for (const [directory, filenames] of [ + ['', ['ubuntu-24.04-server-cloudimg-amd64.img', 'ubuntu-24.04-server-cloudimg-arm64.img']], + ['unpacked/', ['ubuntu-24.04-server-cloudimg-amd64-vmlinuz-generic', 'ubuntu-24.04-server-cloudimg-amd64-initrd-generic']] + ]) { + const response = await fetch(`${baseUrl}release-${release}/${directory}SHA256SUMS`); + if (!response.ok) { + throw new Error(`Unable to fetch Ubuntu checksums: ${response.status} ${response.statusText}`); + } + const checksums = await response.text(); + for (const filename of filenames) { + const digest = checksums.match(new RegExp(`^([a-f0-9]{64}) [ *]${escapeRegExp(filename)}\\r?$`, 'm'))?.[1]; + if (!digest) { + throw new Error(`Missing Ubuntu checksum for ${filename}`); + } + const locationPattern = `${escapeRegExp(baseUrl)}release-\\d{8}/${escapeRegExp(directory + filename)}`; + targets.push( + { + path: 'src/docker/assets.ts', + key: `${filename} location`, + value: `${baseUrl}release-${release}/${directory}${filename}`, + pattern: new RegExp(`(location: ")(${locationPattern})(")`) + }, + { + path: 'src/docker/assets.ts', + key: `${filename} digest`, + value: `sha256:${digest}`, + pattern: new RegExp(`(location: "${locationPattern}"\\r?\\n(?: arch: "[^"]+"\\r?\\n)? +digest: ")([^"]+)(")`) + } + ); + } + } + return {titleValue: release, targets}; + } + }, regctl: { name: 'Regctl version', branch: 'deps/regctl-version', diff --git a/src/docker/assets.ts b/src/docker/assets.ts index 60f436db..1a1c2f5e 100644 --- a/src/docker/assets.ts +++ b/src/docker/assets.ts @@ -167,19 +167,19 @@ images: arch: "{{arch}}" digest: "{{digest}}" {{/each}} -- location: "https://cloud-images.ubuntu.com/releases/noble/release-20260321/ubuntu-24.04-server-cloudimg-amd64.img" +- location: "https://cloud-images.ubuntu.com/releases/noble/release-20260705/ubuntu-24.04-server-cloudimg-amd64.img" arch: "x86_64" - digest: "sha256:5c3ddb00f60bc455dac0862fabe9d8bacec46c33ac1751143c5c3683404b110d" + digest: "sha256:ffe6203da54deeb6db5d2a98a83f9ec8e55f149d3f7ba622e1abe5fa966ee3d6" kernel: - location: "https://cloud-images.ubuntu.com/releases/noble/release-20260321/unpacked/ubuntu-24.04-server-cloudimg-amd64-vmlinuz-generic" - digest: "sha256:5b2a4fe174dacb18281f8f7d72ae32ac4b92801f0b7b5cb43ea55dee29fb789d" + location: "https://cloud-images.ubuntu.com/releases/noble/release-20260705/unpacked/ubuntu-24.04-server-cloudimg-amd64-vmlinuz-generic" + digest: "sha256:72526aac4c8c3f63d30fe0741f0c3b1923e700585750cb135815d5c2f831b691" cmdline: "root=LABEL=cloudimg-rootfs ro console=tty1 console=ttyAMA0 no_timer_check" initrd: - location: "https://cloud-images.ubuntu.com/releases/noble/release-20260321/unpacked/ubuntu-24.04-server-cloudimg-amd64-initrd-generic" - digest: "sha256:cd0b64a5498e583a820a5b842369df83d036b4200b33bc51cadc58176184aaca" -- location: "https://cloud-images.ubuntu.com/releases/noble/release-20260321/ubuntu-24.04-server-cloudimg-arm64.img" + location: "https://cloud-images.ubuntu.com/releases/noble/release-20260705/unpacked/ubuntu-24.04-server-cloudimg-amd64-initrd-generic" + digest: "sha256:edda2af6677cc93c3a8e6056dd3b4e3bf541d4076faa408991598069d9c0854f" +- location: "https://cloud-images.ubuntu.com/releases/noble/release-20260705/ubuntu-24.04-server-cloudimg-arm64.img" arch: "aarch64" - digest: "sha256:1ea801e659d2f5035ac294e0faab0aac9b6ba66753df933ba5c7beab0c689bd0" + digest: "sha256:7df0201546f75b8bcc1044594c806c35749421ad3c9bc1be2a3ab806cfae39cc" # Fallback to the latest release image. # Hint: run \`limactl prune\` to invalidate the cache - location: https://cloud-images.ubuntu.com/releases/noble/release/ubuntu-24.04-server-cloudimg-amd64.img