Compare commits

...

14 Commits

Author SHA1 Message Date
CrazyMax
d344961874 Merge pull request #345 from crazy-max/move-types
Some checks failed
publish / publish (push) Has been cancelled
move types to the right place
2024-05-27 12:15:48 +02:00
CrazyMax
5958c823ef Merge pull request #344 from docker/bot/buildx-lab-releases-json
Update `.github/buildx-lab-releases.json`
2024-05-27 12:07:38 +02:00
CrazyMax
a033bb70cd move types to the right place
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-27 12:06:52 +02:00
crazy-max
8f8c0bb7ec github: update .github/buildx-lab-releases.json
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-05-27 10:02:50 +00:00
CrazyMax
0903e498a4 Merge pull request #324 from crazy-max/build-summary
github: write build summary
2024-05-27 12:02:24 +02:00
CrazyMax
1e903f84b6 github: write build summary
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-27 11:41:36 +02:00
CrazyMax
3a2e4a89a6 Merge pull request #342 from tonistiigi/update-buildx-v0.14.1
update buildx to v0.14.1
2024-05-22 21:07:46 +02:00
CrazyMax
b3dc87c0e0 Merge pull request #341 from docker/bot/docker-releases-json
Update `.github/docker-releases.json`
2024-05-22 21:07:21 +02:00
Tonis Tiigi
bd1955c564 update buildx to v0.14.1
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2024-05-22 11:26:21 -07:00
tonistiigi
956acbf3c6 github: update .github/docker-releases.json
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-05-22 18:21:03 +00:00
Tõnis Tiigi
ea36deec7f Merge pull request #343 from docker/bot/buildx-releases-json
Update `.github/buildx-releases.json`
2024-05-22 11:20:38 -07:00
tonistiigi
9d829e4f4a github: update .github/buildx-releases.json
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-05-22 18:19:56 +00:00
CrazyMax
66c00b9bbd Merge pull request #339 from crazy-max/update-virtual-env
ci(virtual-env): add ubuntu-24.04 to the matrix
2024-05-15 14:38:26 +02:00
CrazyMax
448f9ac218 ci(virtual-env): add ubuntu-24.04 to the matrix
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-15 14:28:30 +02:00
33 changed files with 435 additions and 60 deletions

View File

@@ -40,6 +40,47 @@
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/checksums.txt" "https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/checksums.txt"
] ]
}, },
"v0.14.1-desktop.1": {
"id": 157588052,
"tag_name": "v0.14.1-desktop.1",
"html_url": "https://github.com/docker/buildx-desktop/releases/tag/v0.14.1-desktop.1",
"assets": [
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.darwin-amd64",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.darwin-amd64.provenance.json",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.darwin-amd64.sbom.json",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.darwin-arm64",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.darwin-arm64.provenance.json",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.darwin-arm64.sbom.json",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.linux-amd64",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.linux-amd64.provenance.json",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.linux-amd64.sbom.json",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.linux-arm-v6",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.linux-arm-v6.provenance.json",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.linux-arm-v6.sbom.json",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.linux-arm-v7",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.linux-arm-v7.provenance.json",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.linux-arm-v7.sbom.json",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.linux-arm64",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.linux-arm64.provenance.json",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.linux-arm64.sbom.json",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.linux-ppc64le",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.linux-ppc64le.provenance.json",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.linux-ppc64le.sbom.json",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.linux-riscv64",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.linux-riscv64.provenance.json",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.linux-riscv64.sbom.json",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.linux-s390x",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.linux-s390x.provenance.json",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.linux-s390x.sbom.json",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.windows-amd64.exe",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.windows-amd64.provenance.json",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.windows-amd64.sbom.json",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.windows-arm64.exe",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.windows-arm64.provenance.json",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/buildx-v0.14.1-desktop.1.windows-arm64.sbom.json",
"https://github.com/docker/buildx-desktop/releases/download/v0.14.1-desktop.1/checksums.txt"
]
},
"v0.14.0-desktop.1": { "v0.14.0-desktop.1": {
"id": 155523887, "id": 155523887,
"tag_name": "v0.14.0-desktop.1", "tag_name": "v0.14.0-desktop.1",

View File

@@ -1,43 +1,84 @@
{ {
"latest": { "latest": {
"id": 151768856, "id": 156924662,
"tag_name": "v0.14.0", "tag_name": "v0.14.1",
"html_url": "https://github.com/docker/buildx/releases/tag/v0.14.0", "html_url": "https://github.com/docker/buildx/releases/tag/v0.14.1",
"assets": [ "assets": [
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.darwin-amd64", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.darwin-amd64",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.darwin-amd64.provenance.json", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.darwin-amd64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.darwin-amd64.sbom.json", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.darwin-amd64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.darwin-arm64", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.darwin-arm64",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.darwin-arm64.provenance.json", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.darwin-arm64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.darwin-arm64.sbom.json", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.darwin-arm64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.linux-amd64", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-amd64",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.linux-amd64.provenance.json", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-amd64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.linux-amd64.sbom.json", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-amd64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.linux-arm-v6", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-arm-v6",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.linux-arm-v6.provenance.json", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-arm-v6.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.linux-arm-v6.sbom.json", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-arm-v6.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.linux-arm-v7", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-arm-v7",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.linux-arm-v7.provenance.json", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-arm-v7.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.linux-arm-v7.sbom.json", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-arm-v7.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.linux-arm64", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-arm64",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.linux-arm64.provenance.json", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-arm64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.linux-arm64.sbom.json", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-arm64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.linux-ppc64le", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-ppc64le",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.linux-ppc64le.provenance.json", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-ppc64le.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.linux-ppc64le.sbom.json", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-ppc64le.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.linux-riscv64", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-riscv64",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.linux-riscv64.provenance.json", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-riscv64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.linux-riscv64.sbom.json", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-riscv64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.linux-s390x", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-s390x",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.linux-s390x.provenance.json", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-s390x.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.linux-s390x.sbom.json", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-s390x.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.windows-amd64.exe", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.windows-amd64.exe",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.windows-amd64.provenance.json", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.windows-amd64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.windows-amd64.sbom.json", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.windows-amd64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.windows-arm64.exe", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.windows-arm64.exe",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.windows-arm64.provenance.json", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.windows-arm64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.14.0/buildx-v0.14.0.windows-arm64.sbom.json", "https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.windows-arm64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.14.0/checksums.txt" "https://github.com/docker/buildx/releases/download/v0.14.1/checksums.txt"
]
},
"v0.14.1": {
"id": 156924662,
"tag_name": "v0.14.1",
"html_url": "https://github.com/docker/buildx/releases/tag/v0.14.1",
"assets": [
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.darwin-amd64",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.darwin-amd64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.darwin-amd64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.darwin-arm64",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.darwin-arm64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.darwin-arm64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-amd64",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-amd64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-amd64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-arm-v6",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-arm-v6.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-arm-v6.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-arm-v7",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-arm-v7.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-arm-v7.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-arm64",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-arm64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-arm64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-ppc64le",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-ppc64le.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-ppc64le.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-riscv64",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-riscv64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-riscv64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-s390x",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-s390x.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.linux-s390x.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.windows-amd64.exe",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.windows-amd64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.windows-amd64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.windows-arm64.exe",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.windows-arm64.provenance.json",
"https://github.com/docker/buildx/releases/download/v0.14.1/buildx-v0.14.1.windows-arm64.sbom.json",
"https://github.com/docker/buildx/releases/download/v0.14.1/checksums.txt"
] ]
}, },
"v0.14.0": { "v0.14.0": {

View File

@@ -1,8 +1,14 @@
{ {
"latest": { "latest": {
"id": 154733361, "id": 155867714,
"tag_name": "v26.1.2", "tag_name": "v26.1.3",
"html_url": "https://github.com/moby/moby/releases/tag/v26.1.2", "html_url": "https://github.com/moby/moby/releases/tag/v26.1.3",
"assets": []
},
"v26.1.3": {
"id": 155867714,
"tag_name": "v26.1.3",
"html_url": "https://github.com/moby/moby/releases/tag/v26.1.3",
"assets": [] "assets": []
}, },
"v26.1.2": { "v26.1.2": {

View File

@@ -15,7 +15,7 @@ on:
env: env:
NODE_VERSION: "20" NODE_VERSION: "20"
BUILDX_VERSION: "v0.14.0" BUILDX_VERSION: "v0.14.1"
jobs: jobs:
test: test:

View File

@@ -21,6 +21,7 @@ jobs:
matrix: matrix:
os: os:
- ubuntu-latest - ubuntu-latest
- ubuntu-24.04
- ubuntu-22.04 - ubuntu-22.04
- ubuntu-20.04 - ubuntu-20.04
steps: steps:
@@ -42,7 +43,7 @@ jobs:
- -
name: Docker daemon conf name: Docker daemon conf
run: | run: |
cat /etc/docker/daemon.json cat /etc/docker/daemon.json || true
- -
name: Docker info name: Docker info
run: docker info run: docker info

View File

@@ -19,7 +19,7 @@ import {beforeEach, describe, expect, it, jest, test} from '@jest/globals';
import {BuildKit} from '../../src/buildkit/buildkit'; import {BuildKit} from '../../src/buildkit/buildkit';
import {Builder} from '../../src/buildx/builder'; import {Builder} from '../../src/buildx/builder';
import {BuilderInfo} from '../../src/types/builder'; import {BuilderInfo} from '../../src/types/buildx/builder';
beforeEach(() => { beforeEach(() => {
jest.clearAllMocks(); jest.clearAllMocks();

View File

@@ -19,7 +19,7 @@ import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
import {Bake} from '../../src/buildx/bake'; import {Bake} from '../../src/buildx/bake';
import {BakeDefinition} from '../../src/types/bake'; import {BakeDefinition} from '../../src/types/buildx/bake';
const fixturesDir = path.join(__dirname, '..', 'fixtures'); const fixturesDir = path.join(__dirname, '..', 'fixtures');

View File

@@ -23,7 +23,7 @@ import {Bake} from '../../src/buildx/bake';
import {Context} from '../../src/context'; import {Context} from '../../src/context';
import {ExecOptions} from '@actions/exec'; import {ExecOptions} from '@actions/exec';
import {BakeDefinition, BakeMetadata} from '../../src/types/bake'; import {BakeDefinition, BakeMetadata} from '../../src/types/buildx/bake';
const fixturesDir = path.join(__dirname, '..', 'fixtures'); const fixturesDir = path.join(__dirname, '..', 'fixtures');
// prettier-ignore // prettier-ignore

View File

@@ -22,7 +22,7 @@ import * as rimraf from 'rimraf';
import {Context} from '../../src/context'; import {Context} from '../../src/context';
import {Build} from '../../src/buildx/build'; import {Build} from '../../src/buildx/build';
import {BuildMetadata} from '../../src/types/build'; import {BuildMetadata} from '../../src/types/buildx/build';
const fixturesDir = path.join(__dirname, '..', 'fixtures'); const fixturesDir = path.join(__dirname, '..', 'fixtures');
// prettier-ignore // prettier-ignore

View File

@@ -21,7 +21,7 @@ import * as path from 'path';
import {Builder} from '../../src/buildx/builder'; import {Builder} from '../../src/buildx/builder';
import {Exec} from '../../src/exec'; import {Exec} from '../../src/exec';
import {BuilderInfo} from '../../src/types/builder'; import {BuilderInfo} from '../../src/types/buildx/builder';
const fixturesDir = path.join(__dirname, '..', 'fixtures'); const fixturesDir = path.join(__dirname, '..', 'fixtures');

View File

@@ -24,7 +24,7 @@ import {Buildx} from '../../src/buildx/buildx';
import {Context} from '../../src/context'; import {Context} from '../../src/context';
import {Exec} from '../../src/exec'; import {Exec} from '../../src/exec';
import {Cert} from '../../src/types/buildx'; import {Cert} from '../../src/types/buildx/buildx';
const fixturesDir = path.join(__dirname, '..', 'fixtures'); const fixturesDir = path.join(__dirname, '..', 'fixtures');
// prettier-ignore // prettier-ignore

View File

@@ -86,6 +86,7 @@ maybe('exportBuild', () => {
expect(exportRes?.dockerbuildFilename).toBeDefined(); expect(exportRes?.dockerbuildFilename).toBeDefined();
expect(exportRes?.dockerbuildSize).toBeDefined(); expect(exportRes?.dockerbuildSize).toBeDefined();
expect(fs.existsSync(exportRes?.dockerbuildFilename)).toBe(true); expect(fs.existsSync(exportRes?.dockerbuildFilename)).toBe(true);
expect(exportRes?.summaries).toBeDefined();
}); });
// prettier-ignore // prettier-ignore
@@ -147,5 +148,6 @@ maybe('exportBuild', () => {
expect(exportRes?.dockerbuildFilename).toBeDefined(); expect(exportRes?.dockerbuildFilename).toBeDefined();
expect(exportRes?.dockerbuildSize).toBeDefined(); expect(exportRes?.dockerbuildSize).toBeDefined();
expect(fs.existsSync(exportRes?.dockerbuildFilename)).toBe(true); expect(fs.existsSync(exportRes?.dockerbuildFilename)).toBe(true);
expect(exportRes?.summaries).toBeDefined();
}); });
}); });

View File

@@ -24,7 +24,7 @@ import * as rimraf from 'rimraf';
import {Docker} from '../../src/docker/docker'; import {Docker} from '../../src/docker/docker';
import {Exec} from '../../src/exec'; import {Exec} from '../../src/exec';
import {ConfigFile} from '../../src/types/docker'; import {ConfigFile} from '../../src/types/docker/docker';
const fixturesDir = path.join(__dirname, '..', 'fixtures'); const fixturesDir = path.join(__dirname, '..', 'fixtures');

View File

@@ -14,13 +14,22 @@
* limitations under the License. * limitations under the License.
*/ */
import {beforeEach, describe, expect, it, jest} from '@jest/globals'; import {beforeEach, describe, expect, it, jest, test} from '@jest/globals';
import fs from 'fs';
import * as path from 'path'; import * as path from 'path';
import {Buildx} from '../src/buildx/buildx';
import {Bake} from '../src/buildx/bake';
import {Build} from '../src/buildx/build';
import {Exec} from '../src/exec';
import {GitHub} from '../src/github'; import {GitHub} from '../src/github';
import {History} from '../src/buildx/history';
const fixturesDir = path.join(__dirname, 'fixtures'); const fixturesDir = path.join(__dirname, 'fixtures');
// prettier-ignore
const tmpDir = path.join(process.env.TEMP || '/tmp', 'github-jest');
const maybe = !process.env.GITHUB_ACTIONS || (process.env.GITHUB_ACTIONS === 'true' && process.env.ImageOS && process.env.ImageOS.startsWith('ubuntu')) ? describe : describe.skip; const maybe = !process.env.GITHUB_ACTIONS || (process.env.GITHUB_ACTIONS === 'true' && process.env.ImageOS && process.env.ImageOS.startsWith('ubuntu')) ? describe : describe.skip;
beforeEach(() => { beforeEach(() => {
@@ -39,3 +48,149 @@ maybe('uploadArtifact', () => {
expect(res?.url).toBeDefined(); expect(res?.url).toBeDefined();
}); });
}); });
maybe('writeBuildSummary', () => {
// prettier-ignore
test.each([
[
"single",
[
'build',
'-f', path.join(fixturesDir, 'hello.Dockerfile'),
fixturesDir
],
],
[
"multiplatform",
[
'build',
'-f', path.join(fixturesDir, 'hello.Dockerfile'),
'--platform', 'linux/amd64,linux/arm64',
fixturesDir
],
]
])('write build summary %p', async (_, bargs) => {
const buildx = new Buildx();
const build = new Build({buildx: buildx});
fs.mkdirSync(tmpDir, {recursive: true});
await expect(
(async () => {
// prettier-ignore
const buildCmd = await buildx.getCommand([
'--builder', process.env.CTN_BUILDER_NAME ?? 'default',
...bargs,
'--metadata-file', build.getMetadataFilePath()
]);
await Exec.exec(buildCmd.command, buildCmd.args);
})()
).resolves.not.toThrow();
const metadata = build.resolveMetadata();
expect(metadata).toBeDefined();
const buildRef = build.resolveRef(metadata);
expect(buildRef).toBeDefined();
const history = new History({buildx: buildx});
const exportRes = await history.export({
refs: [buildRef ?? '']
});
expect(exportRes).toBeDefined();
expect(exportRes?.dockerbuildFilename).toBeDefined();
expect(exportRes?.dockerbuildSize).toBeDefined();
expect(exportRes?.summaries).toBeDefined();
const uploadRes = await GitHub.uploadArtifact({
filename: exportRes?.dockerbuildFilename,
mimeType: 'application/gzip',
retentionDays: 1
});
expect(uploadRes).toBeDefined();
expect(uploadRes?.url).toBeDefined();
await GitHub.writeBuildSummary({
exportRes: exportRes,
uploadRes: uploadRes,
inputs: {
context: fixturesDir,
file: path.join(fixturesDir, 'hello.Dockerfile')
}
});
});
// prettier-ignore
test.each([
[
'single',
[
'bake',
'-f', path.join(fixturesDir, 'hello-bake.hcl'),
'hello'
],
],
[
'group',
[
'bake',
'-f', path.join(fixturesDir, 'hello-bake.hcl'),
'hello-all'
],
],
[
'matrix',
[
'bake',
'-f', path.join(fixturesDir, 'hello-bake.hcl'),
'hello-matrix'
],
]
])('write bake summary %p', async (_, bargs) => {
const buildx = new Buildx();
const bake = new Bake({buildx: buildx});
fs.mkdirSync(tmpDir, {recursive: true});
await expect(
(async () => {
// prettier-ignore
const buildCmd = await buildx.getCommand([
'--builder', process.env.CTN_BUILDER_NAME ?? 'default',
...bargs,
'--metadata-file', bake.getMetadataFilePath()
]);
await Exec.exec(buildCmd.command, buildCmd.args, {
cwd: fixturesDir
});
})()
).resolves.not.toThrow();
const metadata = bake.resolveMetadata();
expect(metadata).toBeDefined();
const buildRefs = bake.resolveRefs(metadata);
expect(buildRefs).toBeDefined();
const history = new History({buildx: buildx});
const exportRes = await history.export({
refs: buildRefs ?? []
});
expect(exportRes).toBeDefined();
expect(exportRes?.dockerbuildFilename).toBeDefined();
expect(exportRes?.dockerbuildSize).toBeDefined();
expect(exportRes?.summaries).toBeDefined();
const uploadRes = await GitHub.uploadArtifact({
filename: exportRes?.dockerbuildFilename,
mimeType: 'application/gzip',
retentionDays: 1
});
expect(uploadRes).toBeDefined();
expect(uploadRes?.url).toBeDefined();
await GitHub.writeBuildSummary({
exportRes: exportRes,
uploadRes: uploadRes,
inputs: {
files: path.join(fixturesDir, 'hello-bake.hcl')
}
});
});
});

View File

@@ -16,7 +16,7 @@
ARG NODE_VERSION=20 ARG NODE_VERSION=20
ARG DOCKER_VERSION=26.0.2 ARG DOCKER_VERSION=26.0.2
ARG BUILDX_VERSION=0.14.0 ARG BUILDX_VERSION=0.14.1
FROM node:${NODE_VERSION}-alpine AS base FROM node:${NODE_VERSION}-alpine AS base
RUN apk add --no-cache cpio findutils git RUN apk add --no-cache cpio findutils git

View File

@@ -59,12 +59,14 @@
"async-retry": "^1.3.3", "async-retry": "^1.3.3",
"csv-parse": "^5.5.6", "csv-parse": "^5.5.6",
"handlebars": "^4.7.8", "handlebars": "^4.7.8",
"js-yaml": "^4.1.0",
"jwt-decode": "^4.0.0", "jwt-decode": "^4.0.0",
"semver": "^7.6.2", "semver": "^7.6.2",
"tmp": "^0.2.3" "tmp": "^0.2.3"
}, },
"devDependencies": { "devDependencies": {
"@types/csv-parse": "^1.2.2", "@types/csv-parse": "^1.2.2",
"@types/js-yaml": "^4.0.9",
"@types/node": "^20.12.10", "@types/node": "^20.12.10",
"@types/semver": "^7.5.8", "@types/semver": "^7.5.8",
"@types/tmp": "^0.2.6", "@types/tmp": "^0.2.6",

View File

@@ -22,7 +22,7 @@ import {Builder} from '../buildx/builder';
import {Config} from './config'; import {Config} from './config';
import {Exec} from '../exec'; import {Exec} from '../exec';
import {BuilderInfo, NodeInfo} from '../types/builder'; import {BuilderInfo, NodeInfo} from '../types/buildx/builder';
export interface BuildKitOpts { export interface BuildKitOpts {
buildx?: Buildx; buildx?: Buildx;

View File

@@ -24,7 +24,7 @@ import {Exec} from '../exec';
import {Util} from '../util'; import {Util} from '../util';
import {ExecOptions} from '@actions/exec'; import {ExecOptions} from '@actions/exec';
import {BakeDefinition, BakeMetadata} from '../types/bake'; import {BakeDefinition, BakeMetadata} from '../types/buildx/bake';
export interface BakeOpts { export interface BakeOpts {
buildx?: Buildx; buildx?: Buildx;

View File

@@ -24,7 +24,7 @@ import {Context} from '../context';
import {GitHub} from '../github'; import {GitHub} from '../github';
import {Util} from '../util'; import {Util} from '../util';
import {BuildMetadata} from '../types/build'; import {BuildMetadata} from '../types/buildx/build';
export interface BuildOpts { export interface BuildOpts {
buildx?: Buildx; buildx?: Buildx;

View File

@@ -19,7 +19,7 @@ import * as core from '@actions/core';
import {Buildx} from './buildx'; import {Buildx} from './buildx';
import {Exec} from '../exec'; import {Exec} from '../exec';
import {BuilderInfo, GCPolicy, NodeInfo} from '../types/builder'; import {BuilderInfo, GCPolicy, NodeInfo} from '../types/buildx/builder';
export interface BuilderOpts { export interface BuilderOpts {
buildx?: Buildx; buildx?: Buildx;

View File

@@ -22,7 +22,7 @@ import * as semver from 'semver';
import {Docker} from '../docker/docker'; import {Docker} from '../docker/docker';
import {Exec} from '../exec'; import {Exec} from '../exec';
import {Cert, LocalRefsOpts, LocalRefsResponse, LocalState} from '../types/buildx'; import {Cert, LocalRefsOpts, LocalRefsResponse, LocalState} from '../types/buildx/buildx';
export interface BuildxOpts { export interface BuildxOpts {
standalone?: boolean; standalone?: boolean;

View File

@@ -27,7 +27,7 @@ import {Docker} from '../docker/docker';
import {Exec} from '../exec'; import {Exec} from '../exec';
import {GitHub} from '../github'; import {GitHub} from '../github';
import {ExportRecordOpts, ExportRecordResponse} from '../types/history'; import {ExportRecordOpts, ExportRecordResponse, Summaries} from '../types/buildx/history';
export interface HistoryOpts { export interface HistoryOpts {
buildx?: Buildx; buildx?: Buildx;
@@ -95,6 +95,7 @@ export class History {
buildxDialStdioProc.stdout.pipe(fs.createWriteStream(buildxOutFifoPath)); buildxDialStdioProc.stdout.pipe(fs.createWriteStream(buildxOutFifoPath));
const tmpDockerbuildFilename = path.join(outDir, 'rec.dockerbuild'); const tmpDockerbuildFilename = path.join(outDir, 'rec.dockerbuild');
const summaryFilename = path.join(outDir, 'summary.json');
await new Promise<void>((resolve, reject) => { await new Promise<void>((resolve, reject) => {
const ebargs: Array<string> = ['--ref-state-dir=/buildx-refs', `--node=${builderName}/${nodeName}`]; const ebargs: Array<string> = ['--ref-state-dir=/buildx-refs', `--node=${builderName}/${nodeName}`];
@@ -145,9 +146,14 @@ export class History {
fs.renameSync(tmpDockerbuildFilename, dockerbuildPath); fs.renameSync(tmpDockerbuildFilename, dockerbuildPath);
const dockerbuildStats = fs.statSync(dockerbuildPath); const dockerbuildStats = fs.statSync(dockerbuildPath);
core.info(`Parsing ${summaryFilename}`);
fs.statSync(summaryFilename);
const summaries = <Summaries>JSON.parse(fs.readFileSync(summaryFilename, {encoding: 'utf-8'}));
return { return {
dockerbuildFilename: dockerbuildPath, dockerbuildFilename: dockerbuildPath,
dockerbuildSize: dockerbuildStats.size, dockerbuildSize: dockerbuildStats.size,
summaries: summaries,
builderName: builderName, builderName: builderName,
nodeName: nodeName, nodeName: nodeName,
refs: refs refs: refs

View File

@@ -31,7 +31,7 @@ import {Docker} from '../docker/docker';
import {Git} from '../git'; import {Git} from '../git';
import {Util} from '../util'; import {Util} from '../util';
import {DownloadVersion} from '../types/buildx'; import {DownloadVersion} from '../types/buildx/buildx';
import {GitHubRelease} from '../types/github'; import {GitHubRelease} from '../types/github';
export interface InstallOpts { export interface InstallOpts {

View File

@@ -25,7 +25,7 @@ import {Cache} from '../cache';
import {Exec} from '../exec'; import {Exec} from '../exec';
import {Util} from '../util'; import {Util} from '../util';
import {ConfigFile} from '../types/docker'; import {ConfigFile} from '../types/docker/docker';
export class Docker { export class Docker {
static get configDir(): string { static get configDir(): string {

View File

@@ -16,6 +16,8 @@
import crypto from 'crypto'; import crypto from 'crypto';
import fs from 'fs'; import fs from 'fs';
import jsyaml from 'js-yaml';
import os from 'os';
import path from 'path'; import path from 'path';
import {CreateArtifactRequest, FinalizeArtifactRequest, StringValue} from '@actions/artifact/lib/generated'; import {CreateArtifactRequest, FinalizeArtifactRequest, StringValue} from '@actions/artifact/lib/generated';
import {internalArtifactTwirpClient} from '@actions/artifact/lib/internal/shared/artifact-twirp-client'; import {internalArtifactTwirpClient} from '@actions/artifact/lib/internal/shared/artifact-twirp-client';
@@ -23,6 +25,7 @@ import {getBackendIdsFromToken} from '@actions/artifact/lib/internal/shared/util
import {getExpiration} from '@actions/artifact/lib/internal/upload/retention'; import {getExpiration} from '@actions/artifact/lib/internal/upload/retention';
import {InvalidResponseError, NetworkError} from '@actions/artifact'; import {InvalidResponseError, NetworkError} from '@actions/artifact';
import * as core from '@actions/core'; import * as core from '@actions/core';
import {SummaryTableCell} from '@actions/core/lib/summary';
import * as github from '@actions/github'; import * as github from '@actions/github';
import {GitHub as Octokit} from '@actions/github/lib/utils'; import {GitHub as Octokit} from '@actions/github/lib/utils';
import {Context} from '@actions/github/lib/context'; import {Context} from '@actions/github/lib/context';
@@ -30,7 +33,9 @@ import {TransferProgressEvent} from '@azure/core-http';
import {BlobClient, BlobHTTPHeaders} from '@azure/storage-blob'; import {BlobClient, BlobHTTPHeaders} from '@azure/storage-blob';
import {jwtDecode, JwtPayload} from 'jwt-decode'; import {jwtDecode, JwtPayload} from 'jwt-decode';
import {GitHubActionsRuntimeToken, GitHubActionsRuntimeTokenAC, GitHubRepo, UploadArtifactOpts, UploadArtifactResponse} from './types/github'; import {Util} from './util';
import {BuildSummaryOpts, GitHubActionsRuntimeToken, GitHubActionsRuntimeTokenAC, GitHubRepo, UploadArtifactOpts, UploadArtifactResponse} from './types/github';
export interface GitHubOpts { export interface GitHubOpts {
token?: string; token?: string;
@@ -190,4 +195,84 @@ export class GitHub {
url: artifactURL url: artifactURL
}; };
} }
public static async writeBuildSummary(opts: BuildSummaryOpts): Promise<void> {
// can't use original core.summary.addLink due to the need to make
// EOL optional
const addLink = function (text: string, url: string, addEOL = false): string {
return `<a href="${url}">${text}</a>` + (addEOL ? os.EOL : '');
};
const refsSize = Object.keys(opts.exportRes.refs).length;
// prettier-ignore
const sum = core.summary
.addHeading('Docker Build summary', 1)
.addRaw(`<p>`)
.addRaw(`For a detailed look at the build, download the following build record archive and import it into Docker Desktop's Builds view. `)
.addBreak()
.addRaw(`Build records include details such as timing, dependencies, results, logs, traces, and other information about a build. `)
.addRaw(addLink('Learn more', 'https://docs.docker.com/go/build-summary/'))
.addRaw('</p>')
.addRaw(`<p>`)
.addRaw(`:arrow_down: ${addLink(`<strong>${opts.uploadRes.filename}</strong>`, opts.uploadRes.url)} (${Util.formatFileSize(opts.uploadRes.size)})`)
.addBreak()
.addRaw(`This file includes <strong>${refsSize} build record${refsSize > 1 ? 's' : ''}</strong>.`)
.addRaw(`</p>`)
.addRaw(`<p>`)
.addRaw(`Find this useful? `)
.addRaw(addLink('Let us know', 'https://docs.docker.com/feedback/gha-build-summary'))
.addRaw('</p>');
sum.addHeading('Preview', 2);
const summaryTableData: Array<Array<SummaryTableCell>> = [
[
{header: true, data: 'ID'},
{header: true, data: 'Name'},
{header: true, data: 'Status'},
{header: true, data: 'Cached'},
{header: true, data: 'Duration'}
]
];
let summaryError: string | undefined;
for (const ref in opts.exportRes.summaries) {
if (Object.prototype.hasOwnProperty.call(opts.exportRes.summaries, ref)) {
const summary = opts.exportRes.summaries[ref];
// prettier-ignore
summaryTableData.push([
{data: `<code>${ref.substring(0, 6).toUpperCase()}</code>`},
{data: `<strong>${summary.name}</strong>`},
{data: `${summary.status === 'completed' ? ':white_check_mark:' : summary.status === 'canceled' ? ':no_entry_sign:' : ':x:'} ${summary.status}`},
{data: `${summary.numCachedSteps > 0 ? Math.round((summary.numCachedSteps / summary.numTotalSteps) * 100) : 0}%`},
{data: summary.duration}
]);
if (summary.error) {
summaryError = summary.error;
}
}
}
sum.addTable([...summaryTableData]);
if (summaryError) {
sum.addHeading('Error', 4);
sum.addCodeBlock(summaryError, 'text');
}
if (opts.inputs) {
sum.addHeading('Build inputs', 2).addCodeBlock(
jsyaml.dump(opts.inputs, {
indent: 2,
lineWidth: -1
}),
'yaml'
);
}
if (opts.bakeDefinition) {
sum.addHeading('Bake definition', 2).addCodeBlock(JSON.stringify(opts.bakeDefinition, null, 2), 'json');
}
core.info(`Writing summary`);
await sum.addSeparator().write();
}
} }

View File

@@ -22,7 +22,23 @@ export interface ExportRecordOpts {
export interface ExportRecordResponse { export interface ExportRecordResponse {
dockerbuildFilename: string; dockerbuildFilename: string;
dockerbuildSize: number; dockerbuildSize: number;
summaries: Summaries;
builderName: string; builderName: string;
nodeName: string; nodeName: string;
refs: Array<string>; refs: Array<string>;
} }
export interface Summaries {
[ref: string]: RecordSummary;
}
export interface RecordSummary {
name: string;
status: string;
duration: string;
numCachedSteps: number;
numTotalSteps: number;
numCompletedSteps: number;
frontendAttrs: Record<string, string>;
error?: string;
}

View File

@@ -17,6 +17,9 @@
import {components as OctoOpenApiTypes} from '@octokit/openapi-types'; import {components as OctoOpenApiTypes} from '@octokit/openapi-types';
import {JwtPayload} from 'jwt-decode'; import {JwtPayload} from 'jwt-decode';
import {BakeDefinition} from './buildx/bake';
import {ExportRecordResponse} from './buildx/history';
export interface GitHubRelease { export interface GitHubRelease {
id: number; id: number;
tag_name: string; tag_name: string;
@@ -47,3 +50,11 @@ export interface UploadArtifactResponse {
size: number; size: number;
url: string; url: string;
} }
export interface BuildSummaryOpts {
exportRes: ExportRecordResponse;
uploadRes: UploadArtifactResponse;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
inputs?: any;
bakeDefinition?: BakeDefinition;
}

View File

@@ -1111,6 +1111,7 @@ __metadata:
"@octokit/core": ^5.1.0 "@octokit/core": ^5.1.0
"@octokit/plugin-rest-endpoint-methods": ^10.4.0 "@octokit/plugin-rest-endpoint-methods": ^10.4.0
"@types/csv-parse": ^1.2.2 "@types/csv-parse": ^1.2.2
"@types/js-yaml": ^4.0.9
"@types/node": ^20.12.10 "@types/node": ^20.12.10
"@types/semver": ^7.5.8 "@types/semver": ^7.5.8
"@types/tmp": ^0.2.6 "@types/tmp": ^0.2.6
@@ -1126,6 +1127,7 @@ __metadata:
eslint-plugin-prettier: ^5.1.3 eslint-plugin-prettier: ^5.1.3
handlebars: ^4.7.8 handlebars: ^4.7.8
jest: ^29.7.0 jest: ^29.7.0
js-yaml: ^4.1.0
jwt-decode: ^4.0.0 jwt-decode: ^4.0.0
prettier: ^3.2.5 prettier: ^3.2.5
rimraf: ^5.0.5 rimraf: ^5.0.5
@@ -2185,6 +2187,13 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@types/js-yaml@npm:^4.0.9":
version: 4.0.9
resolution: "@types/js-yaml@npm:4.0.9"
checksum: e5e5e49b5789a29fdb1f7d204f82de11cb9e8f6cb24ab064c616da5d6e1b3ccfbf95aa5d1498a9fbd3b9e745564e69b4a20b6c530b5a8bbb2d4eb830cda9bc69
languageName: node
linkType: hard
"@types/json-schema@npm:^7.0.15": "@types/json-schema@npm:^7.0.15":
version: 7.0.15 version: 7.0.15
resolution: "@types/json-schema@npm:7.0.15" resolution: "@types/json-schema@npm:7.0.15"