Compare commits
114 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5205f4197c | ||
|
|
c76674dd4a | ||
|
|
8471422135 | ||
|
|
e266e3e984 | ||
|
|
1b7201d572 | ||
|
|
6983a397f4 | ||
|
|
81e959d041 | ||
|
|
475cefa34e | ||
|
|
c14688a151 | ||
|
|
dde9860104 | ||
|
|
ee6e7bbd95 | ||
|
|
fe58cc26f5 | ||
|
|
1bf4b58db1 | ||
|
|
82d10009f7 | ||
|
|
bf985d0056 | ||
|
|
129955ee04 | ||
|
|
6d74aad91b | ||
|
|
24546185f6 | ||
|
|
1b5c574732 | ||
|
|
2ace0cd1f7 | ||
|
|
33d4b448ac | ||
|
|
ee91773603 | ||
|
|
5186ba6fdf | ||
|
|
1309d2023e | ||
|
|
6a4479ebc2 | ||
|
|
cd9f97a8c5 | ||
|
|
65f5b77696 | ||
|
|
9ba5af418c | ||
|
|
93ae2ded04 | ||
|
|
15788e8b93 | ||
|
|
92053e1988 | ||
|
|
6d856fd53e | ||
|
|
e67313ac6d | ||
|
|
881230f4b0 | ||
|
|
6fb52d2a23 | ||
|
|
2941f52b66 | ||
|
|
760d0c2369 | ||
|
|
d344961874 | ||
|
|
5958c823ef | ||
|
|
a033bb70cd | ||
|
|
8f8c0bb7ec | ||
|
|
0903e498a4 | ||
|
|
1e903f84b6 | ||
|
|
3a2e4a89a6 | ||
|
|
b3dc87c0e0 | ||
|
|
bd1955c564 | ||
|
|
956acbf3c6 | ||
|
|
ea36deec7f | ||
|
|
9d829e4f4a | ||
|
|
66c00b9bbd | ||
|
|
448f9ac218 | ||
|
|
624e16fb7c | ||
|
|
ee84f2ac79 | ||
|
|
7eb10a1871 | ||
|
|
27a4b44e2c | ||
|
|
75c874dd62 | ||
|
|
c94131a9e9 | ||
|
|
ec0a6e279b | ||
|
|
e0dd35a21c | ||
|
|
b25aadfb15 | ||
|
|
70f40871ae | ||
|
|
61d2e66416 | ||
|
|
c425c1b90c | ||
|
|
4a832ddb12 | ||
|
|
adf692bdc3 | ||
|
|
022c68391f | ||
|
|
eea3ac78bc | ||
|
|
76526d71ff | ||
|
|
4078ffc721 | ||
|
|
ffa2fadd58 | ||
|
|
53d4eba877 | ||
|
|
2c7c8d2118 | ||
|
|
4e56c9c296 | ||
|
|
ae20b6fb50 | ||
|
|
a99525f2f1 | ||
|
|
5820a0ba86 | ||
|
|
62e3923775 | ||
|
|
a459c7c911 | ||
|
|
4c3e9b6acf | ||
|
|
139c4c71de | ||
|
|
4383056550 | ||
|
|
40802f0aa9 | ||
|
|
8f9d3a3d14 | ||
|
|
e41efdd2aa | ||
|
|
33688c4ac8 | ||
|
|
f549f7954e | ||
|
|
5bbaf90158 | ||
|
|
00abdc0e59 | ||
|
|
0f39343265 | ||
|
|
97b80719d2 | ||
|
|
e03b1899b0 | ||
|
|
aece826a8c | ||
|
|
e6bbe6fe93 | ||
|
|
7621606be3 | ||
|
|
4ebe781891 | ||
|
|
a783f79a57 | ||
|
|
8d18a4a3a8 | ||
|
|
045a9c213c | ||
|
|
db0a36131e | ||
|
|
8d4d79eeb7 | ||
|
|
d44748420a | ||
|
|
b4e58da038 | ||
|
|
db6f070033 | ||
|
|
f35cc699c5 | ||
|
|
be6d9ea002 | ||
|
|
579376516d | ||
|
|
3c3a909fe3 | ||
|
|
53bcd3e6fe | ||
|
|
c6f16e945f | ||
|
|
06acacde0e | ||
|
|
2bba1c12c1 | ||
|
|
ad54dd379e | ||
|
|
a40fd9420f | ||
|
|
4d8bd68c1c |
@@ -17,7 +17,7 @@
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": "2023",
|
||||
"ecmaVersion": 2023,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": [
|
||||
|
||||
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -1,2 +1,3 @@
|
||||
/.yarn/releases/** binary
|
||||
/.yarn/plugins/** binary
|
||||
/__tests__/fixtures/oci-archive/** binary
|
||||
|
||||
197
.github/buildx-lab-releases.json
vendored
197
.github/buildx-lab-releases.json
vendored
@@ -1,43 +1,166 @@
|
||||
{
|
||||
"latest": {
|
||||
"id": 137689487,
|
||||
"tag_name": "v0.12.1-desktop.4",
|
||||
"html_url": "https://github.com/docker/buildx-desktop/releases/tag/v0.12.1-desktop.4",
|
||||
"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.12.1-desktop.4/buildx-v0.12.1-desktop.4.darwin-amd64",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.darwin-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.darwin-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.darwin-arm64",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.darwin-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.darwin-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.linux-amd64",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.linux-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.linux-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.linux-arm-v6",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.linux-arm-v6.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.linux-arm-v6.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.linux-arm-v7",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.linux-arm-v7.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.linux-arm-v7.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.linux-arm64",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.linux-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.linux-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.linux-ppc64le",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.linux-ppc64le.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.linux-ppc64le.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.linux-riscv64",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.linux-riscv64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.linux-riscv64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.linux-s390x",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.linux-s390x.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.linux-s390x.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.windows-amd64.exe",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.windows-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.windows-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.windows-arm64.exe",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.windows-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/buildx-v0.12.1-desktop.4.windows-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.12.1-desktop.4/checksums.txt"
|
||||
"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.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": {
|
||||
"id": 155523887,
|
||||
"tag_name": "v0.14.0-desktop.1",
|
||||
"html_url": "https://github.com/docker/buildx-desktop/releases/tag/v0.14.0-desktop.1",
|
||||
"assets": [
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.darwin-amd64",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.darwin-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.darwin-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.darwin-arm64",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.darwin-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.darwin-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.linux-amd64",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.linux-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.linux-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.linux-arm-v6",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.linux-arm-v6.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.linux-arm-v6.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.linux-arm-v7",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.linux-arm-v7.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.linux-arm-v7.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.linux-arm64",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.linux-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.linux-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.linux-ppc64le",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.linux-ppc64le.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.linux-ppc64le.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.linux-riscv64",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.linux-riscv64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.linux-riscv64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.linux-s390x",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.linux-s390x.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.linux-s390x.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.windows-amd64.exe",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.windows-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.windows-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.windows-arm64.exe",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.windows-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/buildx-v0.14.0-desktop.1.windows-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.14.0-desktop.1/checksums.txt"
|
||||
]
|
||||
},
|
||||
"v0.13.1-desktop-preview.2": {
|
||||
"id": 151417247,
|
||||
"tag_name": "v0.13.1-desktop-preview.2",
|
||||
"html_url": "https://github.com/docker/buildx-desktop/releases/tag/v0.13.1-desktop-preview.2",
|
||||
"assets": [
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.darwin-amd64",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.darwin-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.darwin-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.darwin-arm64",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.darwin-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.darwin-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.linux-amd64",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.linux-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.linux-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.linux-arm-v6",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.linux-arm-v6.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.linux-arm-v6.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.linux-arm-v7",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.linux-arm-v7.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.linux-arm-v7.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.linux-arm64",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.linux-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.linux-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.linux-ppc64le",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.linux-ppc64le.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.linux-ppc64le.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.linux-riscv64",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.linux-riscv64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.linux-riscv64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.linux-s390x",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.linux-s390x.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.linux-s390x.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.windows-amd64.exe",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.windows-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.windows-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.windows-arm64.exe",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.windows-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/buildx-v0.13.1-desktop-preview.2.windows-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx-desktop/releases/download/v0.13.1-desktop-preview.2/checksums.txt"
|
||||
]
|
||||
},
|
||||
"v0.12.1-desktop.4": {
|
||||
|
||||
320
.github/buildx-releases.json
vendored
320
.github/buildx-releases.json
vendored
@@ -1,43 +1,289 @@
|
||||
{
|
||||
"latest": {
|
||||
"id": 146098987,
|
||||
"tag_name": "v0.13.1",
|
||||
"html_url": "https://github.com/docker/buildx/releases/tag/v0.13.1",
|
||||
"id": 159941316,
|
||||
"tag_name": "v0.15.0",
|
||||
"html_url": "https://github.com/docker/buildx/releases/tag/v0.15.0",
|
||||
"assets": [
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.darwin-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.darwin-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.darwin-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.darwin-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.darwin-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.darwin-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-arm-v6",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-arm-v6.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-arm-v6.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-arm-v7",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-arm-v7.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-arm-v7.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-ppc64le",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-ppc64le.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-ppc64le.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-riscv64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-riscv64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-riscv64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-s390x",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-s390x.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-s390x.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.windows-amd64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.windows-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.windows-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.windows-arm64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.windows-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.windows-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.13.1/checksums.txt"
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.darwin-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.darwin-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.darwin-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.darwin-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.darwin-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.darwin-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-arm-v6",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-arm-v6.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-arm-v6.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-arm-v7",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-arm-v7.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-arm-v7.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-ppc64le",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-ppc64le.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-ppc64le.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-riscv64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-riscv64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-riscv64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-s390x",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-s390x.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-s390x.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.windows-amd64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.windows-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.windows-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.windows-arm64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.windows-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.windows-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/checksums.txt"
|
||||
]
|
||||
},
|
||||
"v0.15.0": {
|
||||
"id": 159941316,
|
||||
"tag_name": "v0.15.0",
|
||||
"html_url": "https://github.com/docker/buildx/releases/tag/v0.15.0",
|
||||
"assets": [
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.darwin-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.darwin-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.darwin-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.darwin-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.darwin-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.darwin-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-arm-v6",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-arm-v6.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-arm-v6.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-arm-v7",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-arm-v7.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-arm-v7.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-ppc64le",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-ppc64le.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-ppc64le.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-riscv64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-riscv64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-riscv64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-s390x",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-s390x.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.linux-s390x.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.windows-amd64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.windows-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.windows-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.windows-arm64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.windows-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/buildx-v0.15.0.windows-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0/checksums.txt"
|
||||
]
|
||||
},
|
||||
"v0.15.0-rc2": {
|
||||
"id": 159285616,
|
||||
"tag_name": "v0.15.0-rc2",
|
||||
"html_url": "https://github.com/docker/buildx/releases/tag/v0.15.0-rc2",
|
||||
"assets": [
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.darwin-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.darwin-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.darwin-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.darwin-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.darwin-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.darwin-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-arm-v6",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-arm-v6.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-arm-v6.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-arm-v7",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-arm-v7.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-arm-v7.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-ppc64le",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-ppc64le.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-ppc64le.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-riscv64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-riscv64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-riscv64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-s390x",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-s390x.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-s390x.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.windows-amd64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.windows-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.windows-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.windows-arm64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.windows-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.windows-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc2/checksums.txt"
|
||||
]
|
||||
},
|
||||
"v0.15.0-rc1": {
|
||||
"id": 158684634,
|
||||
"tag_name": "v0.15.0-rc1",
|
||||
"html_url": "https://github.com/docker/buildx/releases/tag/v0.15.0-rc1",
|
||||
"assets": [
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.darwin-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.darwin-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.darwin-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.darwin-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.darwin-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.darwin-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-arm-v6",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-arm-v6.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-arm-v6.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-arm-v7",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-arm-v7.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-arm-v7.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-ppc64le",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-ppc64le.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-ppc64le.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-riscv64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-riscv64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-riscv64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-s390x",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-s390x.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-s390x.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.windows-amd64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.windows-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.windows-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.windows-arm64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.windows-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.windows-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.15.0-rc1/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": {
|
||||
"id": 151768856,
|
||||
"tag_name": "v0.14.0",
|
||||
"html_url": "https://github.com/docker/buildx/releases/tag/v0.14.0",
|
||||
"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.0/buildx-v0.14.0.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.0/buildx-v0.14.0.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.0/buildx-v0.14.0.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.0/buildx-v0.14.0.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.0/buildx-v0.14.0.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.0/buildx-v0.14.0.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.0/buildx-v0.14.0.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.0/buildx-v0.14.0.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.0/buildx-v0.14.0.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.0/buildx-v0.14.0.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.0/buildx-v0.14.0.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.0/buildx-v0.14.0.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.0/buildx-v0.14.0.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.0/buildx-v0.14.0.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.0/buildx-v0.14.0.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.0/buildx-v0.14.0.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.0/checksums.txt"
|
||||
]
|
||||
},
|
||||
"v0.14.0-rc2": {
|
||||
"id": 151606490,
|
||||
"tag_name": "v0.14.0-rc2",
|
||||
"html_url": "https://github.com/docker/buildx/releases/tag/v0.14.0-rc2",
|
||||
"assets": [
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.darwin-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.darwin-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.darwin-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.darwin-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.darwin-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.darwin-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.linux-amd64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.linux-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.linux-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.linux-arm-v6",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.linux-arm-v6.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.linux-arm-v6.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.linux-arm-v7",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.linux-arm-v7.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.linux-arm-v7.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.linux-arm64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.linux-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.linux-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.linux-ppc64le",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.linux-ppc64le.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.linux-ppc64le.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.linux-riscv64",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.linux-riscv64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.linux-riscv64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.linux-s390x",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.linux-s390x.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.linux-s390x.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.windows-amd64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.windows-amd64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.windows-amd64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.windows-arm64.exe",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.windows-arm64.provenance.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/buildx-v0.14.0-rc2.windows-arm64.sbom.json",
|
||||
"https://github.com/docker/buildx/releases/download/v0.14.0-rc2/checksums.txt"
|
||||
]
|
||||
},
|
||||
"v0.14.0-rc1": {
|
||||
|
||||
4
.github/dependabot.yml
vendored
4
.github/dependabot.yml
vendored
@@ -14,6 +14,10 @@ updates:
|
||||
versioning-strategy: "increase"
|
||||
allow:
|
||||
- dependency-type: "production"
|
||||
ignore:
|
||||
- # we want to match the same version as the one used by @actions/artifact
|
||||
# https://github.com/actions/toolkit/blob/ae38557bb0dba824cdda26ce787bd6b66cf07a83/packages/artifact/package.json#L46
|
||||
dependency-name: "@azure/storage-blob"
|
||||
labels:
|
||||
- "dependencies"
|
||||
- "bot"
|
||||
|
||||
60
.github/docker-releases.json
vendored
60
.github/docker-releases.json
vendored
@@ -1,8 +1,62 @@
|
||||
{
|
||||
"latest": {
|
||||
"id": 149921469,
|
||||
"tag_name": "v26.0.1",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v26.0.1",
|
||||
"id": 159031384,
|
||||
"tag_name": "v26.1.4",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v26.1.4",
|
||||
"assets": []
|
||||
},
|
||||
"v27.0.0-rc.1": {
|
||||
"id": 160112985,
|
||||
"tag_name": "v27.0.0-rc.1",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v27.0.0-rc.1",
|
||||
"assets": []
|
||||
},
|
||||
"v26.1.4": {
|
||||
"id": 159031384,
|
||||
"tag_name": "v26.1.4",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v26.1.4",
|
||||
"assets": []
|
||||
},
|
||||
"v23.0.12": {
|
||||
"id": 158038616,
|
||||
"tag_name": "v23.0.12",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v23.0.12",
|
||||
"assets": []
|
||||
},
|
||||
"v26.1.3": {
|
||||
"id": 155867714,
|
||||
"tag_name": "v26.1.3",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v26.1.3",
|
||||
"assets": []
|
||||
},
|
||||
"v26.1.2": {
|
||||
"id": 154733361,
|
||||
"tag_name": "v26.1.2",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v26.1.2",
|
||||
"assets": []
|
||||
},
|
||||
"v23.0.11": {
|
||||
"id": 154425437,
|
||||
"tag_name": "v23.0.11",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v23.0.11",
|
||||
"assets": []
|
||||
},
|
||||
"v26.1.1": {
|
||||
"id": 153294610,
|
||||
"tag_name": "v26.1.1",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v26.1.1",
|
||||
"assets": []
|
||||
},
|
||||
"v26.1.0": {
|
||||
"id": 149919896,
|
||||
"tag_name": "v26.1.0",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v26.1.0",
|
||||
"assets": []
|
||||
},
|
||||
"v26.0.2": {
|
||||
"id": 151768426,
|
||||
"tag_name": "v26.0.2",
|
||||
"html_url": "https://github.com/moby/moby/releases/tag/v26.0.2",
|
||||
"assets": []
|
||||
},
|
||||
"v26.0.1": {
|
||||
|
||||
@@ -45,7 +45,7 @@ jobs:
|
||||
git add -A .
|
||||
-
|
||||
name: Create PR
|
||||
uses: peter-evans/create-pull-request@70a41aba780001da0a30141984ae2a0c95d8704e # v6.0.2
|
||||
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5
|
||||
with:
|
||||
base: main
|
||||
branch: bot/buildx-lab-releases-json
|
||||
|
||||
2
.github/workflows/buildx-releases-json.yml
vendored
2
.github/workflows/buildx-releases-json.yml
vendored
@@ -45,7 +45,7 @@ jobs:
|
||||
git add -A .
|
||||
-
|
||||
name: Create PR
|
||||
uses: peter-evans/create-pull-request@70a41aba780001da0a30141984ae2a0c95d8704e # v6.0.2
|
||||
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5
|
||||
with:
|
||||
base: main
|
||||
branch: bot/buildx-releases-json
|
||||
|
||||
5
.github/workflows/codeql.yml
vendored
5
.github/workflows/codeql.yml
vendored
@@ -21,6 +21,11 @@ jobs:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Enable corepack
|
||||
run: |
|
||||
corepack enable
|
||||
yarn --version
|
||||
-
|
||||
name: Set up Node
|
||||
uses: actions/setup-node@v4
|
||||
|
||||
2
.github/workflows/docker-releases-json.yml
vendored
2
.github/workflows/docker-releases-json.yml
vendored
@@ -45,7 +45,7 @@ jobs:
|
||||
git add -A .
|
||||
-
|
||||
name: Create PR
|
||||
uses: peter-evans/create-pull-request@70a41aba780001da0a30141984ae2a0c95d8704e # v6.0.2
|
||||
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5
|
||||
with:
|
||||
base: main
|
||||
branch: bot/docker-releases-json
|
||||
|
||||
36
.github/workflows/test.yml
vendored
36
.github/workflows/test.yml
vendored
@@ -15,7 +15,7 @@ on:
|
||||
|
||||
env:
|
||||
NODE_VERSION: "20"
|
||||
BUILDX_VERSION: "v0.14.0-rc1"
|
||||
BUILDX_VERSION: "v0.15.0"
|
||||
|
||||
jobs:
|
||||
test:
|
||||
@@ -57,6 +57,11 @@ jobs:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Enable corepack
|
||||
run: |
|
||||
corepack enable
|
||||
yarn --version
|
||||
-
|
||||
name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
@@ -90,13 +95,29 @@ jobs:
|
||||
test: ${{ fromJson(needs.prepare-itg.outputs.matrix) }}
|
||||
os:
|
||||
- ubuntu-latest
|
||||
#- macos-13 # https://github.com/docker/actions-toolkit/issues/279
|
||||
- macos-latest
|
||||
#- macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317
|
||||
- macos-13
|
||||
- macos-12
|
||||
- windows-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Expose GitHub Runtime
|
||||
uses: crazy-max/ghaction-github-runtime@v3
|
||||
-
|
||||
# FIXME: Needs to setup node twice on Windows due to a bug with runner
|
||||
name: Setup Node
|
||||
if: startsWith(matrix.os, 'windows')
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
-
|
||||
name: Enable corepack
|
||||
run: |
|
||||
corepack enable
|
||||
yarn --version
|
||||
-
|
||||
name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
@@ -110,6 +131,14 @@ jobs:
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver: docker
|
||||
-
|
||||
name: Set up container builder
|
||||
if: startsWith(matrix.os, 'ubuntu')
|
||||
id: builder
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
use: false
|
||||
-
|
||||
name: Install
|
||||
run: yarn install
|
||||
@@ -119,6 +148,7 @@ jobs:
|
||||
yarn test:itg-coverage --runTestsByPath __tests__/${{ matrix.test }} --coverageDirectory=./coverage
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
CTN_BUILDER_NAME: ${{ steps.builder.outputs.name }}
|
||||
-
|
||||
name: Check coverage
|
||||
run: |
|
||||
|
||||
3
.github/workflows/virtual-env.yml
vendored
3
.github/workflows/virtual-env.yml
vendored
@@ -21,6 +21,7 @@ jobs:
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- ubuntu-24.04
|
||||
- ubuntu-22.04
|
||||
- ubuntu-20.04
|
||||
steps:
|
||||
@@ -42,7 +43,7 @@ jobs:
|
||||
-
|
||||
name: Docker daemon conf
|
||||
run: |
|
||||
cat /etc/docker/daemon.json
|
||||
cat /etc/docker/daemon.json || true
|
||||
-
|
||||
name: Docker info
|
||||
run: docker info
|
||||
|
||||
874
.yarn/releases/yarn-3.6.3.cjs
vendored
874
.yarn/releases/yarn-3.6.3.cjs
vendored
File diff suppressed because one or more lines are too long
@@ -1,6 +1,8 @@
|
||||
logFilters:
|
||||
- code: YN0013
|
||||
level: discard
|
||||
- code: YN0019
|
||||
level: discard
|
||||
- code: YN0076
|
||||
level: discard
|
||||
|
||||
@@ -11,5 +13,3 @@ npmAuthToken: "${NODE_AUTH_TOKEN:-fallback}"
|
||||
plugins:
|
||||
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
|
||||
spec: "@yarnpkg/plugin-interactive-tools"
|
||||
|
||||
yarnPath: .yarn/releases/yarn-3.6.3.cjs
|
||||
|
||||
@@ -22,7 +22,8 @@ export const context = {
|
||||
repo: 'actions-toolkit'
|
||||
},
|
||||
ref: 'refs/heads/master',
|
||||
runId: 123,
|
||||
runId: 2188748038,
|
||||
runNumber: 15,
|
||||
payload: {
|
||||
after: '860c1904a1ce19322e91ac35af1ab07466440c37',
|
||||
base_ref: null,
|
||||
|
||||
@@ -19,7 +19,7 @@ import {beforeEach, describe, expect, it, jest, test} from '@jest/globals';
|
||||
import {BuildKit} from '../../src/buildkit/buildkit';
|
||||
import {Builder} from '../../src/buildx/builder';
|
||||
|
||||
import {BuilderInfo} from '../../src/types/builder';
|
||||
import {BuilderInfo} from '../../src/types/buildx/builder';
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
|
||||
@@ -19,7 +19,7 @@ import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
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');
|
||||
|
||||
|
||||
@@ -14,21 +14,65 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {beforeEach, describe, expect, jest, test} from '@jest/globals';
|
||||
import {afterEach, beforeEach, describe, expect, it, jest, test} from '@jest/globals';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as rimraf from 'rimraf';
|
||||
|
||||
import {Bake} from '../../src/buildx/bake';
|
||||
import {Context} from '../../src/context';
|
||||
|
||||
import {ExecOptions} from '@actions/exec';
|
||||
import {BakeDefinition} from '../../src/types/bake';
|
||||
import {BakeDefinition, BakeMetadata} from '../../src/types/buildx/bake';
|
||||
|
||||
const fixturesDir = path.join(__dirname, '..', 'fixtures');
|
||||
// prettier-ignore
|
||||
const tmpDir = path.join(process.env.TEMP || '/tmp', 'buildx-inputs-jest');
|
||||
const tmpName = path.join(tmpDir, '.tmpname-jest');
|
||||
const metadata: BakeMetadata = {
|
||||
app: {
|
||||
'buildx.build.ref': 'default/default/7frbdw1fmfozgtqavghowsepk'
|
||||
},
|
||||
db: {
|
||||
'buildx.build.ref': 'default/default/onic7g2axylf56rxetob7qruy'
|
||||
}
|
||||
};
|
||||
|
||||
jest.spyOn(Context, 'tmpDir').mockImplementation((): string => {
|
||||
if (!fs.existsSync(tmpDir)) {
|
||||
fs.mkdirSync(tmpDir, {recursive: true});
|
||||
}
|
||||
return tmpDir;
|
||||
});
|
||||
|
||||
jest.spyOn(Context, 'tmpName').mockImplementation((): string => {
|
||||
return tmpName;
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
rimraf.sync(tmpDir);
|
||||
});
|
||||
|
||||
describe('resolveMetadata', () => {
|
||||
it('matches', async () => {
|
||||
const bake = new Bake();
|
||||
fs.writeFileSync(bake.getMetadataFilePath(), JSON.stringify(metadata));
|
||||
expect(bake.resolveMetadata()).toEqual(metadata as BakeMetadata);
|
||||
});
|
||||
});
|
||||
|
||||
describe('resolveRefs', () => {
|
||||
it('matches', async () => {
|
||||
const bake = new Bake();
|
||||
fs.writeFileSync(bake.getMetadataFilePath(), JSON.stringify(metadata));
|
||||
expect(bake.resolveRefs()).toEqual(['default/default/7frbdw1fmfozgtqavghowsepk', 'default/default/onic7g2axylf56rxetob7qruy']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getDefinition', () => {
|
||||
// prettier-ignore
|
||||
test.each([
|
||||
|
||||
@@ -20,16 +20,13 @@ import * as path from 'path';
|
||||
import * as rimraf from 'rimraf';
|
||||
|
||||
import {Context} from '../../src/context';
|
||||
import {Inputs} from '../../src/buildx/inputs';
|
||||
import {Build} from '../../src/buildx/build';
|
||||
|
||||
const fixturesDir = path.join(__dirname, '..', 'fixtures');
|
||||
// prettier-ignore
|
||||
const tmpDir = path.join(process.env.TEMP || '/tmp', 'buildx-inputs-jest');
|
||||
const tmpName = path.join(tmpDir, '.tmpname-jest');
|
||||
const metadata = `{
|
||||
"containerimage.config.digest": "sha256:059b68a595b22564a1cbc167af369349fdc2ecc1f7bc092c2235cbf601a795fd",
|
||||
"containerimage.digest": "sha256:b09b9482c72371486bb2c1d2c2a2633ed1d0b8389e12c8d52b9e052725c0c83c"
|
||||
}`;
|
||||
const metadata = JSON.parse(fs.readFileSync(path.join(fixturesDir, 'metadata.json'), 'utf-8'));
|
||||
|
||||
jest.spyOn(Context, 'tmpDir').mockImplementation((): string => {
|
||||
if (!fs.existsSync(tmpDir)) {
|
||||
@@ -50,31 +47,48 @@ afterEach(() => {
|
||||
rimraf.sync(tmpDir);
|
||||
});
|
||||
|
||||
describe('resolveBuildImageID', () => {
|
||||
describe('resolveImageID', () => {
|
||||
it('matches', async () => {
|
||||
const imageID = 'sha256:bfb45ab72e46908183546477a08f8867fc40cebadd00af54b071b097aed127a9';
|
||||
const imageIDFile = Inputs.getBuildImageIDFilePath();
|
||||
await fs.writeFileSync(imageIDFile, imageID);
|
||||
const expected = Inputs.resolveBuildImageID();
|
||||
expect(expected).toEqual(imageID);
|
||||
const build = new Build();
|
||||
fs.writeFileSync(build.getImageIDFilePath(), imageID);
|
||||
expect(build.resolveImageID()).toEqual(imageID);
|
||||
});
|
||||
});
|
||||
|
||||
describe('resolveBuildMetadata', () => {
|
||||
describe('resolveMetadata', () => {
|
||||
it('matches', async () => {
|
||||
const metadataFile = Inputs.getBuildMetadataFilePath();
|
||||
await fs.writeFileSync(metadataFile, metadata);
|
||||
const expected = Inputs.resolveBuildMetadata();
|
||||
expect(expected).toEqual(metadata);
|
||||
const build = new Build();
|
||||
fs.writeFileSync(build.getMetadataFilePath(), JSON.stringify(metadata));
|
||||
expect(build.resolveMetadata()).toEqual(metadata);
|
||||
});
|
||||
});
|
||||
|
||||
describe('resolveRef', () => {
|
||||
it('matches', async () => {
|
||||
const build = new Build();
|
||||
fs.writeFileSync(build.getMetadataFilePath(), JSON.stringify(metadata));
|
||||
expect(build.resolveRef()).toEqual('default/default/n6ibcp9b2pw108rrz7ywdznvo');
|
||||
});
|
||||
});
|
||||
|
||||
describe('resolveProvenance', () => {
|
||||
it('matches', async () => {
|
||||
const build = new Build();
|
||||
fs.writeFileSync(build.getMetadataFilePath(), JSON.stringify(metadata));
|
||||
const provenance = build.resolveProvenance();
|
||||
expect(provenance).toBeDefined();
|
||||
expect(provenance?.buildType).toEqual('https://mobyproject.org/buildkit@v1');
|
||||
expect(provenance?.materials).toBeDefined();
|
||||
expect(provenance?.materials?.length).toEqual(2);
|
||||
});
|
||||
});
|
||||
|
||||
describe('resolveDigest', () => {
|
||||
it('matches', async () => {
|
||||
const metadataFile = Inputs.getBuildMetadataFilePath();
|
||||
await fs.writeFileSync(metadataFile, metadata);
|
||||
const expected = Inputs.resolveDigest();
|
||||
expect(expected).toEqual('sha256:b09b9482c72371486bb2c1d2c2a2633ed1d0b8389e12c8d52b9e052725c0c83c');
|
||||
const build = new Build();
|
||||
fs.writeFileSync(build.getMetadataFilePath(), JSON.stringify(metadata));
|
||||
expect(build.resolveDigest()).toEqual('sha256:b09b9482c72371486bb2c1d2c2a2633ed1d0b8389e12c8d52b9e052725c0c83c');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -92,7 +106,7 @@ describe('getProvenanceInput', () => {
|
||||
test.each([
|
||||
[
|
||||
'true',
|
||||
'builder-id=https://github.com/docker/actions-toolkit/actions/runs/123'
|
||||
'builder-id=https://github.com/docker/actions-toolkit/actions/runs/2188748038/attempts/2'
|
||||
],
|
||||
[
|
||||
'false',
|
||||
@@ -100,11 +114,11 @@ describe('getProvenanceInput', () => {
|
||||
],
|
||||
[
|
||||
'mode=min',
|
||||
'mode=min,builder-id=https://github.com/docker/actions-toolkit/actions/runs/123'
|
||||
'mode=min,builder-id=https://github.com/docker/actions-toolkit/actions/runs/2188748038/attempts/2'
|
||||
],
|
||||
[
|
||||
'mode=max',
|
||||
'mode=max,builder-id=https://github.com/docker/actions-toolkit/actions/runs/123'
|
||||
'mode=max,builder-id=https://github.com/docker/actions-toolkit/actions/runs/2188748038/attempts/2'
|
||||
],
|
||||
[
|
||||
'builder-id=foo',
|
||||
@@ -119,8 +133,8 @@ describe('getProvenanceInput', () => {
|
||||
''
|
||||
],
|
||||
])('given input %p', async (input: string, expected: string) => {
|
||||
await setInput('provenance', input);
|
||||
expect(Inputs.getProvenanceInput('provenance')).toEqual(expected);
|
||||
setInput('provenance', input);
|
||||
expect(Build.getProvenanceInput('provenance')).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -129,11 +143,11 @@ describe('resolveProvenanceAttrs', () => {
|
||||
test.each([
|
||||
[
|
||||
'mode=min',
|
||||
'mode=min,builder-id=https://github.com/docker/actions-toolkit/actions/runs/123'
|
||||
'mode=min,builder-id=https://github.com/docker/actions-toolkit/actions/runs/2188748038/attempts/2'
|
||||
],
|
||||
[
|
||||
'mode=max',
|
||||
'mode=max,builder-id=https://github.com/docker/actions-toolkit/actions/runs/123'
|
||||
'mode=max,builder-id=https://github.com/docker/actions-toolkit/actions/runs/2188748038/attempts/2'
|
||||
],
|
||||
[
|
||||
'builder-id=foo',
|
||||
@@ -145,14 +159,14 @@ describe('resolveProvenanceAttrs', () => {
|
||||
],
|
||||
[
|
||||
'',
|
||||
'builder-id=https://github.com/docker/actions-toolkit/actions/runs/123'
|
||||
'builder-id=https://github.com/docker/actions-toolkit/actions/runs/2188748038/attempts/2'
|
||||
],
|
||||
])('given %p', async (input: string, expected: string) => {
|
||||
expect(Inputs.resolveProvenanceAttrs(input)).toEqual(expected);
|
||||
expect(Build.resolveProvenanceAttrs(input)).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
describe('resolveBuildSecret', () => {
|
||||
describe('resolveSecret', () => {
|
||||
test.each([
|
||||
['A_SECRET=abcdef0123456789', false, 'A_SECRET', 'abcdef0123456789', null],
|
||||
['GIT_AUTH_TOKEN=abcdefghijklmno=0123456789', false, 'GIT_AUTH_TOKEN', 'abcdefghijklmno=0123456789', null],
|
||||
@@ -166,9 +180,9 @@ describe('resolveBuildSecret', () => {
|
||||
try {
|
||||
let secret: string;
|
||||
if (file) {
|
||||
secret = Inputs.resolveBuildSecretFile(kvp);
|
||||
secret = Build.resolveSecretFile(kvp);
|
||||
} else {
|
||||
secret = Inputs.resolveBuildSecretString(kvp);
|
||||
secret = Build.resolveSecretString(kvp);
|
||||
}
|
||||
expect(secret).toEqual(`id=${exKey},src=${tmpName}`);
|
||||
expect(fs.readFileSync(tmpName, 'utf-8')).toEqual(exValue);
|
||||
@@ -185,7 +199,7 @@ describe('resolveBuildSecret', () => {
|
||||
['FOO=bar=baz', 'FOO', 'bar=baz', null]
|
||||
])('given %p key and %p env', async (kvp: string, exKey: string, exValue: string, error: Error | null) => {
|
||||
try {
|
||||
const secret = Inputs.resolveBuildSecretEnv(kvp);
|
||||
const secret = Build.resolveSecretEnv(kvp);
|
||||
expect(secret).toEqual(`id=${exKey},env=${exValue}`);
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line jest/no-conditional-expect
|
||||
@@ -194,6 +208,54 @@ describe('resolveBuildSecret', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('resolveCacheToAttrs', () => {
|
||||
// prettier-ignore
|
||||
test.each([
|
||||
[
|
||||
'',
|
||||
undefined,
|
||||
''
|
||||
],
|
||||
[
|
||||
'user/app:cache',
|
||||
undefined,
|
||||
'user/app:cache'
|
||||
],
|
||||
[
|
||||
'type=inline',
|
||||
undefined,
|
||||
'type=inline'
|
||||
],
|
||||
[
|
||||
'type=gha',
|
||||
undefined,
|
||||
'type=gha,repository=docker/actions-toolkit',
|
||||
],
|
||||
[
|
||||
'type=gha,mode=max',
|
||||
undefined,
|
||||
'type=gha,mode=max,repository=docker/actions-toolkit',
|
||||
],
|
||||
[
|
||||
'type=gha,mode=max',
|
||||
'abcd1234',
|
||||
'type=gha,mode=max,repository=docker/actions-toolkit,ghtoken=abcd1234',
|
||||
],
|
||||
[
|
||||
'type=gha,repository=foo/bar,mode=max',
|
||||
undefined,
|
||||
'type=gha,repository=foo/bar,mode=max',
|
||||
],
|
||||
[
|
||||
'type=gha,repository=foo/bar,mode=max',
|
||||
'abcd1234',
|
||||
'type=gha,repository=foo/bar,mode=max,ghtoken=abcd1234',
|
||||
],
|
||||
])('given %p', async (input: string, githubToken: string | undefined, expected: string) => {
|
||||
expect(Build.resolveCacheToAttrs(input, githubToken)).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
describe('hasLocalExporter', () => {
|
||||
// prettier-ignore
|
||||
test.each([
|
||||
@@ -206,7 +268,7 @@ describe('hasLocalExporter', () => {
|
||||
[['" type= local" , dest=./release-out'], true],
|
||||
[['.'], true]
|
||||
])('given %p returns %p', async (exporters: Array<string>, expected: boolean) => {
|
||||
expect(Inputs.hasLocalExporter(exporters)).toEqual(expected);
|
||||
expect(Build.hasLocalExporter(exporters)).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -222,7 +284,7 @@ describe('hasTarExporter', () => {
|
||||
[['" type= local" , dest=./release-out'], false],
|
||||
[['.'], false]
|
||||
])('given %p returns %p', async (exporters: Array<string>, expected: boolean) => {
|
||||
expect(Inputs.hasTarExporter(exporters)).toEqual(expected);
|
||||
expect(Build.hasTarExporter(exporters)).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -240,7 +302,7 @@ describe('hasDockerExporter', () => {
|
||||
[['type=docker'], true, true],
|
||||
[['.'], true, true],
|
||||
])('given %p returns %p', async (exporters: Array<string>, expected: boolean, load: boolean | undefined) => {
|
||||
expect(Inputs.hasDockerExporter(exporters, load)).toEqual(expected);
|
||||
expect(Build.hasDockerExporter(exporters, load)).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -251,7 +313,7 @@ describe('hasAttestationType', () => {
|
||||
['type=sbom,true', 'sbom', true],
|
||||
['type=foo,bar', 'provenance', false],
|
||||
])('given %p for %p returns %p', async (attrs: string, name: string, expected: boolean) => {
|
||||
expect(Inputs.hasAttestationType(name, attrs)).toEqual(expected);
|
||||
expect(Build.hasAttestationType(name, attrs)).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -275,7 +337,7 @@ describe('resolveAttestationAttrs', () => {
|
||||
''
|
||||
],
|
||||
])('given %p', async (input: string, expected: string) => {
|
||||
expect(Inputs.resolveAttestationAttrs(input)).toEqual(expected);
|
||||
expect(Build.resolveAttestationAttrs(input)).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -285,7 +347,7 @@ describe('hasGitAuthTokenSecret', () => {
|
||||
[['A_SECRET=abcdef0123456789'], false],
|
||||
[['GIT_AUTH_TOKEN=abcdefghijklmno=0123456789'], true],
|
||||
])('given %p secret', async (kvp: Array<string>, expected: boolean) => {
|
||||
expect(Inputs.hasGitAuthTokenSecret(kvp)).toBe(expected);
|
||||
expect(Build.hasGitAuthTokenSecret(kvp)).toBe(expected);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -21,7 +21,7 @@ import * as path from 'path';
|
||||
import {Builder} from '../../src/buildx/builder';
|
||||
import {Exec} from '../../src/exec';
|
||||
|
||||
import {BuilderInfo} from '../../src/types/builder';
|
||||
import {BuilderInfo} from '../../src/types/buildx/builder';
|
||||
|
||||
const fixturesDir = path.join(__dirname, '..', 'fixtures');
|
||||
|
||||
|
||||
@@ -24,8 +24,9 @@ import {Buildx} from '../../src/buildx/buildx';
|
||||
import {Context} from '../../src/context';
|
||||
import {Exec} from '../../src/exec';
|
||||
|
||||
import {Cert} from '../../src/types/buildx';
|
||||
import {Cert} from '../../src/types/buildx/buildx';
|
||||
|
||||
const fixturesDir = path.join(__dirname, '..', 'fixtures');
|
||||
// prettier-ignore
|
||||
const tmpDir = path.join(process.env.TEMP || '/tmp', 'buildx-jest');
|
||||
const tmpName = path.join(tmpDir, '.tmpname-jest');
|
||||
@@ -116,21 +117,6 @@ describe('isAvailable', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('printInspect', () => {
|
||||
it('prints builder2 instance', async () => {
|
||||
const execSpy = jest.spyOn(Exec, 'exec');
|
||||
const buildx = new Buildx({
|
||||
standalone: true
|
||||
});
|
||||
await buildx.printInspect('builder2').catch(() => {
|
||||
// noop
|
||||
});
|
||||
expect(execSpy).toHaveBeenCalledWith(`buildx`, ['inspect', 'builder2'], {
|
||||
failOnStdErr: false
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('printVersion', () => {
|
||||
it('docker cli', async () => {
|
||||
const execSpy = jest.spyOn(Exec, 'exec');
|
||||
@@ -267,3 +253,38 @@ describe('resolveCertsDriverOpts', () => {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('refs', () => {
|
||||
it('returns all refs', async () => {
|
||||
const refs = Buildx.refs({
|
||||
dir: path.join(fixturesDir, 'buildx-refs')
|
||||
});
|
||||
expect(Object.keys(refs).length).toEqual(11);
|
||||
});
|
||||
it('returns default builder refs', async () => {
|
||||
const refs = Buildx.refs({
|
||||
dir: path.join(fixturesDir, 'buildx-refs'),
|
||||
builderName: 'default'
|
||||
});
|
||||
expect(Object.keys(refs).length).toEqual(8);
|
||||
});
|
||||
it('returns foo builder refs', async () => {
|
||||
const refs = Buildx.refs({
|
||||
dir: path.join(fixturesDir, 'buildx-refs'),
|
||||
builderName: 'foo'
|
||||
});
|
||||
expect(Object.keys(refs).length).toEqual(3);
|
||||
});
|
||||
it('returns default builder refs since', async () => {
|
||||
const mdate = new Date('2023-09-05T00:00:00Z');
|
||||
fs.utimesSync(path.join(fixturesDir, 'buildx-refs', 'default', 'default', '36dix0eiv9evr61vrwzn32w7q'), mdate, mdate);
|
||||
fs.utimesSync(path.join(fixturesDir, 'buildx-refs', 'default', 'default', '49p5r8und2konke5pmlyzqp3n'), mdate, mdate);
|
||||
fs.utimesSync(path.join(fixturesDir, 'buildx-refs', 'default', 'default', 'a8zqzhhv5yiazm396jobsgdw2'), mdate, mdate);
|
||||
const refs = Buildx.refs({
|
||||
dir: path.join(fixturesDir, 'buildx-refs'),
|
||||
builderName: 'default',
|
||||
since: new Date('2024-01-10T00:00:00Z')
|
||||
});
|
||||
expect(Object.keys(refs).length).toEqual(5);
|
||||
});
|
||||
});
|
||||
|
||||
153
__tests__/buildx/history.test.itg.ts
Normal file
153
__tests__/buildx/history.test.itg.ts
Normal file
@@ -0,0 +1,153 @@
|
||||
/**
|
||||
* Copyright 2024 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {beforeEach, describe, expect, jest, test} from '@jest/globals';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
import {Buildx} from '../../src/buildx/buildx';
|
||||
import {Bake} from '../../src/buildx/bake';
|
||||
import {Build} from '../../src/buildx/build';
|
||||
import {History} from '../../src/buildx/history';
|
||||
import {Exec} from '../../src/exec';
|
||||
|
||||
const fixturesDir = path.join(__dirname, '..', 'fixtures');
|
||||
|
||||
// prettier-ignore
|
||||
const tmpDir = path.join(process.env.TEMP || '/tmp', 'buildx-history-jest');
|
||||
|
||||
const maybe = !process.env.GITHUB_ACTIONS || (process.env.GITHUB_ACTIONS === 'true' && process.env.ImageOS && process.env.ImageOS.startsWith('ubuntu')) ? describe : describe.skip;
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
maybe('exportBuild', () => {
|
||||
// prettier-ignore
|
||||
test.each([
|
||||
[
|
||||
'single',
|
||||
[
|
||||
'build',
|
||||
'-f', path.join(fixturesDir, 'hello.Dockerfile'),
|
||||
fixturesDir
|
||||
],
|
||||
],
|
||||
[
|
||||
'multi-platform',
|
||||
[
|
||||
'build',
|
||||
'-f', path.join(fixturesDir, 'hello.Dockerfile'),
|
||||
'--platform', 'linux/amd64,linux/arm64',
|
||||
fixturesDir
|
||||
],
|
||||
]
|
||||
])('export build %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(fs.existsSync(exportRes?.dockerbuildFilename)).toBe(true);
|
||||
expect(exportRes?.summaries).toBeDefined();
|
||||
});
|
||||
|
||||
// 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'
|
||||
],
|
||||
]
|
||||
])('export bake build %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(fs.existsSync(exportRes?.dockerbuildFilename)).toBe(true);
|
||||
expect(exportRes?.summaries).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -24,7 +24,7 @@ import * as rimraf from 'rimraf';
|
||||
import {Docker} from '../../src/docker/docker';
|
||||
import {Exec} from '../../src/exec';
|
||||
|
||||
import {ConfigFile} from '../../src/types/docker';
|
||||
import {ConfigFile} from '../../src/types/docker/docker';
|
||||
|
||||
const fixturesDir = path.join(__dirname, '..', 'fixtures');
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ import {jest, describe, expect, test, beforeEach, afterEach} from '@jest/globals
|
||||
|
||||
import {Install} from '../../src/docker/install';
|
||||
import {Docker} from '../../src/docker/docker';
|
||||
import {Exec} from '../../src/exec';
|
||||
|
||||
// prettier-ignore
|
||||
const tmpDir = path.join(process.env.TEMP || '/tmp', 'docker-install-jest');
|
||||
@@ -38,8 +39,19 @@ aarch64:https://cloud.debian.org/images/cloud/bookworm/20231013-1532/debian-12-g
|
||||
process.env = originalEnv;
|
||||
});
|
||||
// prettier-ignore
|
||||
test.each(['v24.0.4'])(
|
||||
test.each(['v26.1.4'])(
|
||||
'install docker %s', async (version) => {
|
||||
if (process.env.ImageOS && process.env.ImageOS.startsWith('ubuntu')) {
|
||||
// Remove containerd first on ubuntu runners to make sure it takes
|
||||
// ones packaged with docker
|
||||
await Exec.exec('sudo', ['apt-get', 'remove', '-y', 'containerd.io'], {
|
||||
env: Object.assign({}, process.env, {
|
||||
DEBIAN_FRONTEND: 'noninteractive'
|
||||
}) as {
|
||||
[key: string]: string;
|
||||
}
|
||||
});
|
||||
}
|
||||
await expect((async () => {
|
||||
const install = new Install({
|
||||
version: version,
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"Definition":"eyJncm91cCI6eyJkZWZhdWx0Ijp7InRhcmdldHMiOlsiZGV2Il19fSwidGFyZ2V0Ijp7ImRldiI6eyJjb250ZXh0IjoiLiIsImRvY2tlcmZpbGUiOiJEb2NrZXJmaWxlIiwiYXJncyI6eyJCVUlMREtJVF9DT05URVhUX0tFRVBfR0lUX0RJUiI6IjEiLCJERUZBVUxUX1BST0RVQ1RfTElDRU5TRSI6IiIsIkRPQ0tFUl9CVUlMRFRBR1MiOiIiLCJET0NLRVJfREVCVUciOiIiLCJET0NLRVJfTERGTEFHUyI6IiIsIkRPQ0tFUl9TVEFUSUMiOiIxIiwiUEFDS0FHRVJfTkFNRSI6IiIsIlBMQVRGT1JNIjoiIiwiUFJPRFVDVCI6IiIsIlNZU1RFTUQiOiJmYWxzZSIsIlZFUlNJT04iOiIifSwidGFncyI6WyJkb2NrZXItZGV2Il0sInRhcmdldCI6ImRldiIsIm91dHB1dCI6WyJ0eXBlPWRvY2tlciJdfX19","Targets":["dev"],"Refs":["vzxn0jxr44khtq7hc8drtzwjv"]}
|
||||
@@ -0,0 +1 @@
|
||||
{"LocalPath":"/home/crazymax/github/docker/docker-alpine-s6","DockerfilePath":""}
|
||||
@@ -0,0 +1 @@
|
||||
{"LocalPath":"/home/crazymax/github/docker_org/buildx","DockerfilePath":""}
|
||||
@@ -0,0 +1 @@
|
||||
{"LocalPath":"/home/crazymax/github/docker_org/buildx","DockerfilePath":"/home/crazymax/github/docker_org/buildx/Dockerfile"}
|
||||
@@ -0,0 +1 @@
|
||||
{"LocalPath":"/home/crazymax/github/docker_org/buildx","DockerfilePath":"/home/crazymax/github/docker_org/buildx/Dockerfile"}
|
||||
@@ -0,0 +1 @@
|
||||
{"LocalPath":"/home/crazymax/github/docker_org/buildx","DockerfilePath":""}
|
||||
@@ -0,0 +1 @@
|
||||
{"LocalPath":"/home/crazymax/github/docker_org/buildx","DockerfilePath":"/home/crazymax/github/docker_org/buildx/Dockerfile"}
|
||||
@@ -0,0 +1 @@
|
||||
{"LocalPath":"/home/crazymax/github/docker_org/buildx","DockerfilePath":""}
|
||||
@@ -0,0 +1 @@
|
||||
{"Target":"dev","LocalPath":"/home/crazymax/github/docker_org/docker","DockerfilePath":"/home/crazymax/github/docker_org/docker/Dockerfile","GroupRef":"1fugf958r4peyg86h6scim5t5"}
|
||||
@@ -0,0 +1 @@
|
||||
{"Target":"default","LocalPath":"/home/crazymax/github/docker_org/compose/.dev/47231","DockerfilePath":"/home/crazymax/github/docker_org/compose/.dev/47231/bad/Dockerfile"}
|
||||
@@ -0,0 +1 @@
|
||||
{"Target":"default","LocalPath":"/home/crazymax/github/docker_org/compose/.dev/47231","DockerfilePath":"/home/crazymax/github/docker_org/compose/.dev/47231/bad/Dockerfile"}
|
||||
@@ -0,0 +1 @@
|
||||
{"Target":"default","LocalPath":"/home/crazymax/github/docker_org/compose/.dev/47231","DockerfilePath":"/home/crazymax/github/docker_org/compose/.dev/47231/bad/Dockerfile"}
|
||||
39
__tests__/fixtures/hello-bake.hcl
Normal file
39
__tests__/fixtures/hello-bake.hcl
Normal file
@@ -0,0 +1,39 @@
|
||||
// Copyright 2024 actions-toolkit authors
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
target "hello" {
|
||||
dockerfile = "hello.Dockerfile"
|
||||
}
|
||||
|
||||
target "hello-bar" {
|
||||
dockerfile = "hello.Dockerfile"
|
||||
args = {
|
||||
NAME = "bar"
|
||||
}
|
||||
}
|
||||
|
||||
group "hello-all" {
|
||||
targets = ["hello", "hello-bar"]
|
||||
}
|
||||
|
||||
target "hello-matrix" {
|
||||
name = "matrix-${name}"
|
||||
matrix = {
|
||||
name = ["bar", "baz", "boo", "far", "faz", "foo", "aaa", "bbb", "ccc", "ddd", "eee", "fff", "ggg", "hhh", "iii", "jjj"]
|
||||
}
|
||||
dockerfile = "hello.Dockerfile"
|
||||
args = {
|
||||
NAME = name
|
||||
}
|
||||
}
|
||||
23
__tests__/fixtures/hello.Dockerfile
Normal file
23
__tests__/fixtures/hello.Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
# Copyright 2024 actions-toolkit authors
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
FROM busybox AS build
|
||||
ARG NAME=foo
|
||||
ARG TARGETPLATFORM
|
||||
RUN echo "Hello $NAME from $TARGETPLATFORM" > foo
|
||||
|
||||
FROM scratch
|
||||
COPY --from=build /foo /
|
||||
45
__tests__/fixtures/metadata.json
Normal file
45
__tests__/fixtures/metadata.json
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"buildx.build.provenance": {
|
||||
"buildType": "https://mobyproject.org/buildkit@v1",
|
||||
"materials": [
|
||||
{
|
||||
"uri": "pkg:docker/docker/dockerfile-upstream@master",
|
||||
"digest": {
|
||||
"sha256": "70433342168dafa34d11bd7236c3c3fcf448b90539733281711050808f32e835"
|
||||
}
|
||||
},
|
||||
{
|
||||
"uri": "pkg:docker/busybox@latest?platform=linux%2Famd64",
|
||||
"digest": {
|
||||
"sha256": "9ae97d36d26566ff84e8893c64a6dc4fe8ca6d1144bf5b87b2b85a32def253c7"
|
||||
}
|
||||
}
|
||||
],
|
||||
"invocation": {
|
||||
"configSource": {
|
||||
"entryPoint": "Dockerfile"
|
||||
},
|
||||
"parameters": {
|
||||
"frontend": "gateway.v0",
|
||||
"args": {
|
||||
"cmdline": "docker/dockerfile-upstream:master",
|
||||
"source": "docker/dockerfile-upstream:master"
|
||||
},
|
||||
"locals": [
|
||||
{
|
||||
"name": "context"
|
||||
},
|
||||
{
|
||||
"name": "dockerfile"
|
||||
}
|
||||
]
|
||||
},
|
||||
"environment": {
|
||||
"platform": "linux/amd64"
|
||||
}
|
||||
}
|
||||
},
|
||||
"buildx.build.ref": "default/default/n6ibcp9b2pw108rrz7ywdznvo",
|
||||
"containerimage.config.digest": "sha256:059b68a595b22564a1cbc167f369349fdc2ecc1f7bc092c2235cbf601a795fd",
|
||||
"containerimage.digest": "sha256:b09b9482c72371486bb2c1d2c2a2633ed1d0b8389e12c8d52b9e052725c0c83c"
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
__tests__/fixtures/oci-archive/hello-oci-gzip.tar
Normal file
BIN
__tests__/fixtures/oci-archive/hello-oci-gzip.tar
Normal file
Binary file not shown.
BIN
__tests__/fixtures/oci-archive/hello-oci-multiplatform-gzip.tar
Normal file
BIN
__tests__/fixtures/oci-archive/hello-oci-multiplatform-gzip.tar
Normal file
Binary file not shown.
BIN
__tests__/fixtures/oci-archive/hello-oci-uncompressed.tar
Normal file
BIN
__tests__/fixtures/oci-archive/hello-oci-uncompressed.tar
Normal file
Binary file not shown.
BIN
__tests__/fixtures/oci-archive/hello-oci-zstd.tar
Normal file
BIN
__tests__/fixtures/oci-archive/hello-oci-zstd.tar
Normal file
Binary file not shown.
BIN
__tests__/fixtures/oci-archive/moby~buildkit~LWDOW6.dockerbuild
Normal file
BIN
__tests__/fixtures/oci-archive/moby~buildkit~LWDOW6.dockerbuild
Normal file
Binary file not shown.
196
__tests__/github.test.itg.ts
Normal file
196
__tests__/github.test.itg.ts
Normal file
@@ -0,0 +1,196 @@
|
||||
/**
|
||||
* Copyright 2024 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {beforeEach, describe, expect, it, jest, test} from '@jest/globals';
|
||||
import fs from 'fs';
|
||||
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 {History} from '../src/buildx/history';
|
||||
|
||||
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;
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
maybe('uploadArtifact', () => {
|
||||
it('uploads an artifact', async () => {
|
||||
const res = await GitHub.uploadArtifact({
|
||||
filename: path.join(fixturesDir, 'github-repo.json'),
|
||||
mimeType: 'application/json',
|
||||
retentionDays: 1
|
||||
});
|
||||
expect(res).toBeDefined();
|
||||
console.log('uploadArtifactResponse', res);
|
||||
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')
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -32,7 +32,7 @@ jest.spyOn(GitHub.prototype, 'repoData').mockImplementation((): Promise<GitHubRe
|
||||
});
|
||||
|
||||
describe('repoData', () => {
|
||||
it('returns GitHub repository', async () => {
|
||||
it('returns GitHub repo data', async () => {
|
||||
const github = new GitHub();
|
||||
expect((await github.repoData()).name).toEqual('Hello-World');
|
||||
});
|
||||
@@ -89,9 +89,18 @@ describe('apiURL', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('repository', () => {
|
||||
it('returns GitHub repository', async () => {
|
||||
expect(GitHub.repository).toEqual('docker/actions-toolkit');
|
||||
});
|
||||
});
|
||||
|
||||
describe('workflowRunURL', () => {
|
||||
it('returns 123', async () => {
|
||||
expect(GitHub.workflowRunURL).toEqual('https://github.com/docker/actions-toolkit/actions/runs/123');
|
||||
it('returns 2188748038', async () => {
|
||||
expect(GitHub.workflowRunURL()).toEqual('https://github.com/docker/actions-toolkit/actions/runs/2188748038');
|
||||
});
|
||||
it('returns 2188748038 with attempts 2', async () => {
|
||||
expect(GitHub.workflowRunURL(true)).toEqual('https://github.com/docker/actions-toolkit/actions/runs/2188748038/attempts/2');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
50
__tests__/oci/oci.test.ts
Normal file
50
__tests__/oci/oci.test.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* Copyright 2024 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {afterEach, beforeEach, describe, expect, jest, test} from '@jest/globals';
|
||||
import * as fs from 'fs';
|
||||
import path from 'path';
|
||||
import * as rimraf from 'rimraf';
|
||||
|
||||
import {OCI} from '../../src/oci/oci';
|
||||
|
||||
const fixturesDir = path.join(__dirname, '..', 'fixtures');
|
||||
|
||||
// prettier-ignore
|
||||
const tmpDir = path.join(process.env.TEMP || '/tmp', 'docker-jest');
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
rimraf.sync(tmpDir);
|
||||
});
|
||||
|
||||
describe('loadArchive', () => {
|
||||
// prettier-ignore
|
||||
test.each(fs.readdirSync(path.join(fixturesDir, 'oci-archive')).filter(file => {
|
||||
return fs.statSync(path.join(path.join(fixturesDir, 'oci-archive'), file)).isFile();
|
||||
}).map(filename => [filename]))('extracting %p', async (filename) => {
|
||||
const res = await OCI.loadArchive({
|
||||
file: path.join(fixturesDir, 'oci-archive', filename)
|
||||
});
|
||||
expect(res).toBeDefined();
|
||||
expect(res?.root.index).toBeDefined();
|
||||
expect(res?.root.layout).toBeDefined();
|
||||
// console.log(JSON.stringify(res, null, 2));
|
||||
});
|
||||
});
|
||||
@@ -31,6 +31,12 @@ describe('getInputList', () => {
|
||||
expect(res).toEqual(['bar']);
|
||||
});
|
||||
|
||||
it('empty correctly', async () => {
|
||||
setInput('foo', '');
|
||||
const res = Util.getInputList('foo');
|
||||
expect(res).toEqual([]);
|
||||
});
|
||||
|
||||
it('multiline correctly', async () => {
|
||||
setInput('foo', 'bar\nbaz');
|
||||
const res = Util.getInputList('foo');
|
||||
@@ -309,6 +315,48 @@ describe('parseBool', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('formatFileSize', () => {
|
||||
test('should return "0 Bytes" when given 0 bytes', () => {
|
||||
expect(Util.formatFileSize(0)).toBe('0 Bytes');
|
||||
});
|
||||
test('should format bytes to KB correctly', () => {
|
||||
expect(Util.formatFileSize(1024)).toBe('1 KB');
|
||||
expect(Util.formatFileSize(2048)).toBe('2 KB');
|
||||
expect(Util.formatFileSize(1500)).toBe('1.46 KB');
|
||||
});
|
||||
test('should format bytes to MB correctly', () => {
|
||||
expect(Util.formatFileSize(1024 * 1024)).toBe('1 MB');
|
||||
expect(Util.formatFileSize(2.5 * 1024 * 1024)).toBe('2.5 MB');
|
||||
expect(Util.formatFileSize(3.8 * 1024 * 1024)).toBe('3.8 MB');
|
||||
});
|
||||
test('should format bytes to GB correctly', () => {
|
||||
expect(Util.formatFileSize(1024 * 1024 * 1024)).toBe('1 GB');
|
||||
expect(Util.formatFileSize(2.5 * 1024 * 1024 * 1024)).toBe('2.5 GB');
|
||||
expect(Util.formatFileSize(3.8 * 1024 * 1024 * 1024)).toBe('3.8 GB');
|
||||
});
|
||||
test('should format bytes to TB correctly', () => {
|
||||
expect(Util.formatFileSize(1024 * 1024 * 1024 * 1024)).toBe('1 TB');
|
||||
expect(Util.formatFileSize(2.5 * 1024 * 1024 * 1024 * 1024)).toBe('2.5 TB');
|
||||
expect(Util.formatFileSize(3.8 * 1024 * 1024 * 1024 * 1024)).toBe('3.8 TB');
|
||||
});
|
||||
});
|
||||
|
||||
describe('generateRandomString', () => {
|
||||
it('should generate a random string of default length 10', async () => {
|
||||
const res = Util.generateRandomString();
|
||||
expect(typeof res).toBe('string');
|
||||
expect(res.length).toBe(10);
|
||||
expect(/^[0-9a-f]+$/i.test(res)).toBe(true);
|
||||
});
|
||||
it('should generate a random string of specified length', async () => {
|
||||
const length = 15;
|
||||
const res = Util.generateRandomString(length);
|
||||
expect(typeof res).toBe('string');
|
||||
expect(res.length).toBe(15);
|
||||
expect(/^[0-9a-f]+$/i.test(res)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
// See: https://github.com/actions/toolkit/blob/a1b068ec31a042ff1e10a522d8fdf0b8869d53ca/packages/core/src/core.ts#L89
|
||||
function getInputName(name: string): string {
|
||||
return `INPUT_${name.replace(/ /g, '_').toUpperCase()}`;
|
||||
|
||||
@@ -15,13 +15,18 @@
|
||||
# limitations under the License.
|
||||
|
||||
ARG NODE_VERSION=20
|
||||
ARG DOCKER_VERSION=26.0.0
|
||||
ARG BUILDX_VERSION=0.14.0-rc1
|
||||
ARG DOCKER_VERSION=26.0.2
|
||||
ARG BUILDX_VERSION=0.15.0
|
||||
|
||||
FROM node:${NODE_VERSION}-alpine AS base
|
||||
RUN apk add --no-cache cpio findutils git
|
||||
RUN yarn config set --home enableTelemetry 0
|
||||
WORKDIR /src
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache <<EOT
|
||||
corepack enable
|
||||
yarn --version
|
||||
yarn config set --home enableTelemetry 0
|
||||
EOT
|
||||
|
||||
FROM base AS deps
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
|
||||
@@ -14,6 +14,24 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-actions-toolkit-'));
|
||||
|
||||
process.env = Object.assign({}, process.env, {
|
||||
TEMP: tmpDir,
|
||||
GITHUB_REPOSITORY: 'docker/actions-toolkit',
|
||||
GITHUB_RUN_ATTEMPT: 2,
|
||||
GITHUB_RUN_ID: 2188748038,
|
||||
GITHUB_RUN_NUMBER: 15,
|
||||
RUNNER_TEMP: path.join(tmpDir, 'runner-temp'),
|
||||
RUNNER_TOOL_CACHE: path.join(tmpDir, 'runner-tool-cache')
|
||||
}) as {
|
||||
[key: string]: string;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
clearMocks: true,
|
||||
testEnvironment: 'node',
|
||||
|
||||
@@ -23,6 +23,9 @@ const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-actions-toolkit-'))
|
||||
process.env = Object.assign({}, process.env, {
|
||||
TEMP: tmpDir,
|
||||
GITHUB_REPOSITORY: 'docker/actions-toolkit',
|
||||
GITHUB_RUN_ATTEMPT: 2,
|
||||
GITHUB_RUN_ID: 2188748038,
|
||||
GITHUB_RUN_NUMBER: 15,
|
||||
RUNNER_TEMP: path.join(tmpDir, 'runner-temp'),
|
||||
RUNNER_TOOL_CACHE: path.join(tmpDir, 'runner-tool-cache')
|
||||
}) as {
|
||||
|
||||
45
package.json
45
package.json
@@ -45,6 +45,7 @@
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/artifact": "^2.1.7",
|
||||
"@actions/cache": "^3.2.4",
|
||||
"@actions/core": "^1.10.1",
|
||||
"@actions/exec": "^1.1.1",
|
||||
@@ -52,34 +53,40 @@
|
||||
"@actions/http-client": "^2.2.1",
|
||||
"@actions/io": "^1.1.3",
|
||||
"@actions/tool-cache": "^2.0.1",
|
||||
"@azure/storage-blob": "^12.15.0",
|
||||
"@octokit/core": "^5.1.0",
|
||||
"@octokit/plugin-rest-endpoint-methods": "^10.4.0",
|
||||
"async-retry": "^1.3.3",
|
||||
"csv-parse": "^5.5.5",
|
||||
"csv-parse": "^5.5.6",
|
||||
"gunzip-maybe": "^1.4.2",
|
||||
"handlebars": "^4.7.8",
|
||||
"js-yaml": "^4.1.0",
|
||||
"jwt-decode": "^4.0.0",
|
||||
"semver": "^7.6.0",
|
||||
"semver": "^7.6.2",
|
||||
"tar-stream": "^3.1.7",
|
||||
"tmp": "^0.2.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/csv-parse": "^1.2.2",
|
||||
"@types/js-yaml": "^4.0.5",
|
||||
"@types/node": "^20.5.9",
|
||||
"@types/gunzip-maybe": "^1.4.2",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/node": "^20.12.10",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@types/tmp": "^0.2.3",
|
||||
"@typescript-eslint/eslint-plugin": "^6.6.0",
|
||||
"@typescript-eslint/parser": "^6.6.0",
|
||||
"dotenv": "^16.3.1",
|
||||
"eslint": "^8.48.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-import": "^2.28.1",
|
||||
"eslint-plugin-jest": "^27.2.3",
|
||||
"eslint-plugin-prettier": "^5.0.0",
|
||||
"jest": "^29.6.4",
|
||||
"prettier": "^3.0.3",
|
||||
"rimraf": "^5.0.1",
|
||||
"ts-jest": "^29.1.1",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^5.2.2"
|
||||
"@types/tar-stream": "^3.1.3",
|
||||
"@types/tmp": "^0.2.6",
|
||||
"@typescript-eslint/eslint-plugin": "^7.8.0",
|
||||
"@typescript-eslint/parser": "^7.8.0",
|
||||
"dotenv": "^16.4.5",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"eslint-plugin-jest": "^28.5.0",
|
||||
"eslint-plugin-prettier": "^5.1.3",
|
||||
"jest": "^29.7.0",
|
||||
"prettier": "^3.2.5",
|
||||
"rimraf": "^5.0.5",
|
||||
"ts-jest": "^29.1.2",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.4.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import {Builder} from '../buildx/builder';
|
||||
import {Config} from './config';
|
||||
import {Exec} from '../exec';
|
||||
|
||||
import {BuilderInfo, NodeInfo} from '../types/builder';
|
||||
import {BuilderInfo, NodeInfo} from '../types/buildx/builder';
|
||||
|
||||
export interface BuildKitOpts {
|
||||
buildx?: Buildx;
|
||||
|
||||
@@ -14,13 +14,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import {Build} from './build';
|
||||
import {Buildx} from './buildx';
|
||||
import {Context} from '../context';
|
||||
import {Exec} from '../exec';
|
||||
import {Inputs} from './inputs';
|
||||
import {Util} from '../util';
|
||||
|
||||
import {ExecOptions} from '@actions/exec';
|
||||
import {BakeDefinition} from '../types/bake';
|
||||
import {BakeDefinition, BakeMetadata} from '../types/buildx/bake';
|
||||
|
||||
export interface BakeOpts {
|
||||
buildx?: Buildx;
|
||||
@@ -42,9 +46,43 @@ export interface BakeCmdOpts {
|
||||
|
||||
export class Bake {
|
||||
private readonly buildx: Buildx;
|
||||
private readonly metadataFilename: string;
|
||||
|
||||
constructor(opts?: BakeOpts) {
|
||||
this.buildx = opts?.buildx || new Buildx();
|
||||
this.metadataFilename = `bake-metadata-${Util.generateRandomString()}.json`;
|
||||
}
|
||||
|
||||
public getMetadataFilePath(): string {
|
||||
return path.join(Context.tmpDir(), this.metadataFilename);
|
||||
}
|
||||
|
||||
public resolveMetadata(): BakeMetadata | undefined {
|
||||
const metadataFile = this.getMetadataFilePath();
|
||||
if (!fs.existsSync(metadataFile)) {
|
||||
return undefined;
|
||||
}
|
||||
const content = fs.readFileSync(metadataFile, {encoding: 'utf-8'}).trim();
|
||||
if (content === 'null') {
|
||||
return undefined;
|
||||
}
|
||||
return <BakeMetadata>JSON.parse(content);
|
||||
}
|
||||
|
||||
public resolveRefs(metadata?: BakeMetadata): Array<string> | undefined {
|
||||
if (!metadata) {
|
||||
metadata = this.resolveMetadata();
|
||||
if (!metadata) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
const refs = new Array<string>();
|
||||
for (const key in metadata) {
|
||||
if ('buildx.build.ref' in metadata[key]) {
|
||||
refs.push(metadata[key]['buildx.build.ref']);
|
||||
}
|
||||
}
|
||||
return refs;
|
||||
}
|
||||
|
||||
public async getDefinition(cmdOpts: BakeCmdOpts, execOptions?: ExecOptions): Promise<BakeDefinition> {
|
||||
@@ -119,15 +157,15 @@ export class Bake {
|
||||
}
|
||||
|
||||
public static hasLocalExporter(def: BakeDefinition): boolean {
|
||||
return Inputs.hasExporterType('local', Bake.exporters(def));
|
||||
return Build.hasExporterType('local', Bake.exporters(def));
|
||||
}
|
||||
|
||||
public static hasTarExporter(def: BakeDefinition): boolean {
|
||||
return Inputs.hasExporterType('tar', Bake.exporters(def));
|
||||
return Build.hasExporterType('tar', Bake.exporters(def));
|
||||
}
|
||||
|
||||
public static hasDockerExporter(def: BakeDefinition, load?: boolean): boolean {
|
||||
return load || Inputs.hasExporterType('docker', Bake.exporters(def));
|
||||
return load || Build.hasExporterType('docker', Bake.exporters(def));
|
||||
}
|
||||
|
||||
private static exporters(def: BakeDefinition): Array<string> {
|
||||
|
||||
@@ -19,41 +19,47 @@ import path from 'path';
|
||||
import * as core from '@actions/core';
|
||||
import {parse} from 'csv-parse/sync';
|
||||
|
||||
import {Buildx} from './buildx';
|
||||
import {Context} from '../context';
|
||||
import {GitHub} from '../github';
|
||||
import {Util} from '../util';
|
||||
|
||||
const parseKvp = (kvp: string): [string, string] => {
|
||||
const delimiterIndex = kvp.indexOf('=');
|
||||
const key = kvp.substring(0, delimiterIndex);
|
||||
const value = kvp.substring(delimiterIndex + 1);
|
||||
import {BuildMetadata} from '../types/buildx/build';
|
||||
import {ProvenancePredicate} from '../types/intoto/slsa_provenance/v0.2/provenance';
|
||||
|
||||
if (key.length == 0 || value.length == 0) {
|
||||
throw new Error(`${kvp} is not a valid secret`);
|
||||
export interface BuildOpts {
|
||||
buildx?: Buildx;
|
||||
}
|
||||
|
||||
export class Build {
|
||||
private readonly buildx: Buildx;
|
||||
private readonly iidFilename: string;
|
||||
private readonly metadataFilename: string;
|
||||
|
||||
constructor(opts?: BuildOpts) {
|
||||
this.buildx = opts?.buildx || new Buildx();
|
||||
this.iidFilename = `build-iidfile-${Util.generateRandomString()}.txt`;
|
||||
this.metadataFilename = `build-metadata-${Util.generateRandomString()}.json`;
|
||||
}
|
||||
|
||||
return [key, value];
|
||||
};
|
||||
|
||||
export class Inputs {
|
||||
public static getBuildImageIDFilePath(): string {
|
||||
return path.join(Context.tmpDir(), 'iidfile');
|
||||
public getImageIDFilePath(): string {
|
||||
return path.join(Context.tmpDir(), this.iidFilename);
|
||||
}
|
||||
|
||||
public static getBuildMetadataFilePath(): string {
|
||||
return path.join(Context.tmpDir(), 'metadata-file');
|
||||
}
|
||||
|
||||
public static resolveBuildImageID(): string | undefined {
|
||||
const iidFile = Inputs.getBuildImageIDFilePath();
|
||||
public resolveImageID(): string | undefined {
|
||||
const iidFile = this.getImageIDFilePath();
|
||||
if (!fs.existsSync(iidFile)) {
|
||||
return undefined;
|
||||
}
|
||||
return fs.readFileSync(iidFile, {encoding: 'utf-8'}).trim();
|
||||
}
|
||||
|
||||
public static resolveBuildMetadata(): string | undefined {
|
||||
const metadataFile = Inputs.getBuildMetadataFilePath();
|
||||
public getMetadataFilePath(): string {
|
||||
return path.join(Context.tmpDir(), this.metadataFilename);
|
||||
}
|
||||
|
||||
public resolveMetadata(): BuildMetadata | undefined {
|
||||
const metadataFile = this.getMetadataFilePath();
|
||||
if (!fs.existsSync(metadataFile)) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -61,38 +67,65 @@ export class Inputs {
|
||||
if (content === 'null') {
|
||||
return undefined;
|
||||
}
|
||||
return content;
|
||||
return <BuildMetadata>JSON.parse(content);
|
||||
}
|
||||
|
||||
public static resolveDigest(): string | undefined {
|
||||
const metadata = Inputs.resolveBuildMetadata();
|
||||
if (metadata === undefined) {
|
||||
return undefined;
|
||||
public resolveRef(metadata?: BuildMetadata): string | undefined {
|
||||
if (!metadata) {
|
||||
metadata = this.resolveMetadata();
|
||||
if (!metadata) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
const metadataJSON = JSON.parse(metadata);
|
||||
if (metadataJSON['containerimage.digest']) {
|
||||
return metadataJSON['containerimage.digest'];
|
||||
if ('buildx.build.ref' in metadata) {
|
||||
return metadata['buildx.build.ref'];
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public static resolveBuildSecretString(kvp: string): string {
|
||||
const [key, file] = Inputs.resolveBuildSecret(kvp, false);
|
||||
public resolveProvenance(metadata?: BuildMetadata): ProvenancePredicate | undefined {
|
||||
if (!metadata) {
|
||||
metadata = this.resolveMetadata();
|
||||
if (!metadata) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
if ('buildx.build.provenance' in metadata) {
|
||||
return metadata['buildx.build.provenance'] as ProvenancePredicate;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public resolveDigest(metadata?: BuildMetadata): string | undefined {
|
||||
if (!metadata) {
|
||||
metadata = this.resolveMetadata();
|
||||
if (!metadata) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
if ('containerimage.digest' in metadata) {
|
||||
return metadata['containerimage.digest'];
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public static resolveSecretString(kvp: string): string {
|
||||
const [key, file] = Build.resolveSecret(kvp, false);
|
||||
return `id=${key},src=${file}`;
|
||||
}
|
||||
|
||||
public static resolveBuildSecretFile(kvp: string): string {
|
||||
const [key, file] = Inputs.resolveBuildSecret(kvp, true);
|
||||
public static resolveSecretFile(kvp: string): string {
|
||||
const [key, file] = Build.resolveSecret(kvp, true);
|
||||
return `id=${key},src=${file}`;
|
||||
}
|
||||
|
||||
public static resolveBuildSecretEnv(kvp: string): string {
|
||||
const [key, value] = parseKvp(kvp);
|
||||
public static resolveSecretEnv(kvp: string): string {
|
||||
const [key, value] = Build.parseSecretKvp(kvp);
|
||||
return `id=${key},env=${value}`;
|
||||
}
|
||||
|
||||
public static resolveBuildSecret(kvp: string, file: boolean): [string, string] {
|
||||
const [key, _value] = parseKvp(kvp);
|
||||
public static resolveSecret(kvp: string, file: boolean): [string, string] {
|
||||
const [key, _value] = Build.parseSecretKvp(kvp);
|
||||
let value = _value;
|
||||
if (file) {
|
||||
if (!fs.existsSync(value)) {
|
||||
@@ -112,16 +145,16 @@ export class Inputs {
|
||||
return input;
|
||||
}
|
||||
try {
|
||||
return core.getBooleanInput(name) ? `builder-id=${GitHub.workflowRunURL}` : 'false';
|
||||
return core.getBooleanInput(name) ? `builder-id=${GitHub.workflowRunURL(true)}` : 'false';
|
||||
} catch (err) {
|
||||
// not a valid boolean, so we assume it's a string
|
||||
return Inputs.resolveProvenanceAttrs(input);
|
||||
return Build.resolveProvenanceAttrs(input);
|
||||
}
|
||||
}
|
||||
|
||||
public static resolveProvenanceAttrs(input: string): string {
|
||||
if (!input) {
|
||||
return `builder-id=${GitHub.workflowRunURL}`;
|
||||
return `builder-id=${GitHub.workflowRunURL(true)}`;
|
||||
}
|
||||
// parse attributes from input
|
||||
const fields = parse(input, {
|
||||
@@ -139,19 +172,58 @@ export class Inputs {
|
||||
}
|
||||
}
|
||||
// if not add builder-id attribute
|
||||
return `${input},builder-id=${GitHub.workflowRunURL}`;
|
||||
return `${input},builder-id=${GitHub.workflowRunURL(true)}`;
|
||||
}
|
||||
|
||||
public static resolveCacheToAttrs(input: string, githubToken?: string): string {
|
||||
if (!input) {
|
||||
return input;
|
||||
}
|
||||
|
||||
let cacheType = 'registry';
|
||||
let ghaCacheRepository = '';
|
||||
let ghaCacheGHToken = '';
|
||||
|
||||
const fields = parse(input, {
|
||||
relaxColumnCount: true,
|
||||
skipEmptyLines: true
|
||||
})[0];
|
||||
for (const field of fields) {
|
||||
const parts = field
|
||||
.toString()
|
||||
.split(/(?<=^[^=]+?)=/)
|
||||
.map(item => item.trim());
|
||||
if (parts[0] === 'type') {
|
||||
cacheType = parts[1];
|
||||
} else if (parts[0] === 'repository') {
|
||||
ghaCacheRepository = parts[1];
|
||||
} else if (parts[0] === 'ghtoken') {
|
||||
ghaCacheGHToken = parts[1];
|
||||
}
|
||||
}
|
||||
|
||||
if (cacheType === 'gha') {
|
||||
if (!ghaCacheRepository) {
|
||||
input = `${input},repository=${GitHub.repository}`;
|
||||
}
|
||||
if (!ghaCacheGHToken && githubToken) {
|
||||
input = `${input},ghtoken=${githubToken}`;
|
||||
}
|
||||
}
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
public static hasLocalExporter(exporters: string[]): boolean {
|
||||
return Inputs.hasExporterType('local', exporters);
|
||||
return Build.hasExporterType('local', exporters);
|
||||
}
|
||||
|
||||
public static hasTarExporter(exporters: string[]): boolean {
|
||||
return Inputs.hasExporterType('tar', exporters);
|
||||
return Build.hasExporterType('tar', exporters);
|
||||
}
|
||||
|
||||
public static hasDockerExporter(exporters: string[], load?: boolean): boolean {
|
||||
return load || Inputs.hasExporterType('docker', exporters);
|
||||
return load || Build.hasExporterType('docker', exporters);
|
||||
}
|
||||
|
||||
public static hasExporterType(name: string, exporters: string[]): boolean {
|
||||
@@ -223,4 +295,14 @@ export class Inputs {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static parseSecretKvp(kvp: string): [string, string] {
|
||||
const delimiterIndex = kvp.indexOf('=');
|
||||
const key = kvp.substring(0, delimiterIndex);
|
||||
const value = kvp.substring(delimiterIndex + 1);
|
||||
if (key.length == 0 || value.length == 0) {
|
||||
throw new Error(`${kvp} is not a valid secret`);
|
||||
}
|
||||
return [key, value];
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ import * as core from '@actions/core';
|
||||
import {Buildx} from './buildx';
|
||||
import {Exec} from '../exec';
|
||||
|
||||
import {BuilderInfo, GCPolicy, NodeInfo} from '../types/builder';
|
||||
import {BuilderInfo, GCPolicy, NodeInfo} from '../types/buildx/builder';
|
||||
|
||||
export interface BuilderOpts {
|
||||
buildx?: Buildx;
|
||||
@@ -55,7 +55,7 @@ export class Builder {
|
||||
return ok;
|
||||
}
|
||||
|
||||
public async inspect(name: string): Promise<BuilderInfo> {
|
||||
public async inspect(name?: string): Promise<BuilderInfo> {
|
||||
// always enable debug for inspect command, so we can display additional
|
||||
// fields such as features: https://github.com/docker/buildx/pull/1854
|
||||
const envs = Object.assign({}, process.env, {
|
||||
@@ -64,7 +64,12 @@ export class Builder {
|
||||
[key: string]: string;
|
||||
};
|
||||
|
||||
const cmd = await this.buildx.getCommand(['inspect', name]);
|
||||
const args = ['inspect'];
|
||||
if (name) {
|
||||
args.push(name);
|
||||
}
|
||||
|
||||
const cmd = await this.buildx.getCommand(args);
|
||||
return await Exec.getExecOutput(cmd.command, cmd.args, {
|
||||
ignoreReturnCode: true,
|
||||
silent: true,
|
||||
|
||||
@@ -22,7 +22,7 @@ import * as semver from 'semver';
|
||||
import {Docker} from '../docker/docker';
|
||||
import {Exec} from '../exec';
|
||||
|
||||
import {Cert} from '../types/buildx';
|
||||
import {Cert, LocalRefsOpts, LocalRefsResponse, LocalState} from '../types/buildx/buildx';
|
||||
|
||||
export interface BuildxOpts {
|
||||
standalone?: boolean;
|
||||
@@ -45,6 +45,14 @@ export class Buildx {
|
||||
return process.env.BUILDX_CONFIG || path.join(Docker.configDir, 'buildx');
|
||||
}
|
||||
|
||||
static get refsDir(): string {
|
||||
return path.join(Buildx.configDir, 'refs');
|
||||
}
|
||||
|
||||
static get refsGroupDir(): string {
|
||||
return path.join(Buildx.refsDir, '__group__');
|
||||
}
|
||||
|
||||
static get certsDir(): string {
|
||||
return path.join(Buildx.configDir, 'certs');
|
||||
}
|
||||
@@ -86,13 +94,6 @@ export class Buildx {
|
||||
return ok;
|
||||
}
|
||||
|
||||
public async printInspect(name: string): Promise<void> {
|
||||
const cmd = await this.getCommand(['inspect', name]);
|
||||
await Exec.exec(cmd.command, cmd.args, {
|
||||
failOnStdErr: false
|
||||
});
|
||||
}
|
||||
|
||||
public async version(): Promise<string> {
|
||||
if (this._versionOnce) {
|
||||
return this._version;
|
||||
@@ -175,4 +176,46 @@ export class Buildx {
|
||||
}
|
||||
return driverOpts;
|
||||
}
|
||||
|
||||
public static refs(opts: LocalRefsOpts, refs: LocalRefsResponse = {}): LocalRefsResponse {
|
||||
const {dir, builderName, nodeName, since} = opts;
|
||||
|
||||
let dirpath = path.resolve(dir);
|
||||
if (opts.builderName) {
|
||||
dirpath = path.join(dirpath, opts.builderName);
|
||||
}
|
||||
if (opts.nodeName) {
|
||||
dirpath = path.join(dirpath, opts.nodeName);
|
||||
}
|
||||
if (!fs.existsSync(dirpath)) {
|
||||
return refs;
|
||||
}
|
||||
|
||||
const files = fs.readdirSync(dirpath);
|
||||
for (const file of files) {
|
||||
const filePath = path.join(dirpath, file);
|
||||
const stat = fs.statSync(filePath);
|
||||
if (stat.isDirectory()) {
|
||||
const nopts: LocalRefsOpts = {...opts};
|
||||
if (!builderName) {
|
||||
if (file === '__group__') {
|
||||
continue;
|
||||
}
|
||||
nopts.builderName = file;
|
||||
} else if (!nodeName) {
|
||||
nopts.nodeName = file;
|
||||
}
|
||||
Buildx.refs(nopts, refs);
|
||||
} else {
|
||||
if (since && stat.mtime < since) {
|
||||
continue;
|
||||
}
|
||||
const localState = <LocalState>JSON.parse(fs.readFileSync(filePath, 'utf8'));
|
||||
const ref = `${builderName}/${nodeName}/${file}`;
|
||||
refs[ref] = localState;
|
||||
}
|
||||
}
|
||||
|
||||
return refs;
|
||||
}
|
||||
}
|
||||
|
||||
169
src/buildx/history.ts
Normal file
169
src/buildx/history.ts
Normal file
@@ -0,0 +1,169 @@
|
||||
/**
|
||||
* Copyright 2024 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {ChildProcessByStdio, spawn} from 'child_process';
|
||||
import fs from 'fs';
|
||||
import {Readable, Writable} from 'node:stream';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
import {Buildx} from './buildx';
|
||||
import {Context} from '../context';
|
||||
import {Docker} from '../docker/docker';
|
||||
import {Exec} from '../exec';
|
||||
import {GitHub} from '../github';
|
||||
|
||||
import {ExportRecordOpts, ExportRecordResponse, Summaries} from '../types/buildx/history';
|
||||
|
||||
export interface HistoryOpts {
|
||||
buildx?: Buildx;
|
||||
}
|
||||
|
||||
export class History {
|
||||
private readonly buildx: Buildx;
|
||||
|
||||
private static readonly EXPORT_TOOL_IMAGE: string = 'docker.io/dockereng/export-build:latest';
|
||||
|
||||
constructor(opts?: HistoryOpts) {
|
||||
this.buildx = opts?.buildx || new Buildx();
|
||||
}
|
||||
|
||||
public async export(opts: ExportRecordOpts): Promise<ExportRecordResponse> {
|
||||
if (os.platform() === 'win32') {
|
||||
throw new Error('Exporting a build record is currently not supported on Windows');
|
||||
}
|
||||
if (!(await Docker.isAvailable())) {
|
||||
throw new Error('Docker is required to export a build record');
|
||||
}
|
||||
|
||||
let builderName: string = '';
|
||||
let nodeName: string = '';
|
||||
const refs: Array<string> = [];
|
||||
for (const ref of opts.refs) {
|
||||
const refParts = ref.split('/');
|
||||
if (refParts.length != 3) {
|
||||
throw new Error(`Invalid build ref: ${ref}`);
|
||||
}
|
||||
refs.push(refParts[2]);
|
||||
|
||||
// Set builder name and node name from the first ref if not already set.
|
||||
// We assume all refs are from the same builder and node.
|
||||
if (!builderName) {
|
||||
builderName = refParts[0];
|
||||
}
|
||||
if (!nodeName) {
|
||||
nodeName = refParts[1];
|
||||
}
|
||||
}
|
||||
if (refs.length === 0) {
|
||||
throw new Error('No build refs provided');
|
||||
}
|
||||
|
||||
const outDir = path.join(Context.tmpDir(), 'export');
|
||||
core.info(`exporting build record to ${outDir}`);
|
||||
fs.mkdirSync(outDir, {recursive: true});
|
||||
|
||||
const buildxInFifoPath = Context.tmpName({
|
||||
template: 'buildx-in-XXXXXX.fifo',
|
||||
tmpdir: Context.tmpDir()
|
||||
});
|
||||
await Exec.exec('mkfifo', [buildxInFifoPath]);
|
||||
|
||||
const buildxOutFifoPath = Context.tmpName({
|
||||
template: 'buildx-out-XXXXXX.fifo',
|
||||
tmpdir: Context.tmpDir()
|
||||
});
|
||||
await Exec.exec('mkfifo', [buildxOutFifoPath]);
|
||||
|
||||
const buildxCmd = await this.buildx.getCommand(['--builder', builderName, 'dial-stdio']);
|
||||
const buildxDialStdioProc = History.spawn(buildxCmd.command, buildxCmd.args);
|
||||
fs.createReadStream(buildxInFifoPath).pipe(buildxDialStdioProc.stdin);
|
||||
buildxDialStdioProc.stdout.pipe(fs.createWriteStream(buildxOutFifoPath));
|
||||
|
||||
const tmpDockerbuildFilename = path.join(outDir, 'rec.dockerbuild');
|
||||
const summaryFilename = path.join(outDir, 'summary.json');
|
||||
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
const ebargs: Array<string> = ['--ref-state-dir=/buildx-refs', `--node=${builderName}/${nodeName}`];
|
||||
for (const ref of refs) {
|
||||
ebargs.push(`--ref=${ref}`);
|
||||
}
|
||||
if (typeof process.getuid === 'function') {
|
||||
ebargs.push(`--uid=${process.getuid()}`);
|
||||
}
|
||||
if (typeof process.getgid === 'function') {
|
||||
ebargs.push(`--gid=${process.getgid()}`);
|
||||
}
|
||||
// prettier-ignore
|
||||
const dockerRunProc = History.spawn('docker', [
|
||||
'run', '--rm', '-i',
|
||||
'-v', `${Buildx.refsDir}:/buildx-refs`,
|
||||
'-v', `${outDir}:/out`,
|
||||
opts.image || History.EXPORT_TOOL_IMAGE,
|
||||
...ebargs
|
||||
]);
|
||||
fs.createReadStream(buildxOutFifoPath).pipe(dockerRunProc.stdin);
|
||||
dockerRunProc.stdout.pipe(fs.createWriteStream(buildxInFifoPath));
|
||||
dockerRunProc.on('close', code => {
|
||||
if (code === 0) {
|
||||
if (!fs.existsSync(tmpDockerbuildFilename)) {
|
||||
reject(new Error(`Failed to export build record: ${tmpDockerbuildFilename} not found`));
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
} else {
|
||||
reject(new Error(`Process "docker run" exited with code ${code}`));
|
||||
}
|
||||
});
|
||||
dockerRunProc.on('error', err => {
|
||||
core.error(`Error executing buildx dial-stdio: ${err}`);
|
||||
reject(err);
|
||||
});
|
||||
}).catch(err => {
|
||||
throw err;
|
||||
});
|
||||
|
||||
let dockerbuildFilename = `${GitHub.context.repo.owner}~${GitHub.context.repo.repo}~${refs[0].substring(0, 6).toUpperCase()}`;
|
||||
if (refs.length > 1) {
|
||||
dockerbuildFilename += `+${refs.length - 1}`;
|
||||
}
|
||||
|
||||
const dockerbuildPath = path.join(outDir, `${dockerbuildFilename}.dockerbuild`);
|
||||
fs.renameSync(tmpDockerbuildFilename, 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 {
|
||||
dockerbuildFilename: dockerbuildPath,
|
||||
dockerbuildSize: dockerbuildStats.size,
|
||||
summaries: summaries,
|
||||
builderName: builderName,
|
||||
nodeName: nodeName,
|
||||
refs: refs
|
||||
};
|
||||
}
|
||||
|
||||
private static spawn(command: string, args?: ReadonlyArray<string>): ChildProcessByStdio<Writable, Readable, null> {
|
||||
core.info(`[command]${command}${args ? ` ${args.join(' ')}` : ''}`);
|
||||
return spawn(command, args || [], {
|
||||
stdio: ['pipe', 'pipe', 'inherit']
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ import {Docker} from '../docker/docker';
|
||||
import {Git} from '../git';
|
||||
import {Util} from '../util';
|
||||
|
||||
import {DownloadVersion} from '../types/buildx';
|
||||
import {DownloadVersion} from '../types/buildx/buildx';
|
||||
import {GitHubRelease} from '../types/github';
|
||||
|
||||
export interface InstallOpts {
|
||||
|
||||
@@ -79,6 +79,9 @@ if (Get-Service docker -ErrorAction SilentlyContinue) {
|
||||
Write-Host "Service removed"
|
||||
}
|
||||
|
||||
$env:Path = "$ToolDir;" + [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
|
||||
Write-Host "Path: $env:Path"
|
||||
|
||||
$env:DOCKER_HOST = $DockerHost
|
||||
Write-Host "DOCKER_HOST: $env:DOCKER_HOST"
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import {Cache} from '../cache';
|
||||
import {Exec} from '../exec';
|
||||
import {Util} from '../util';
|
||||
|
||||
import {ConfigFile} from '../types/docker';
|
||||
import {ConfigFile} from '../types/docker/docker';
|
||||
|
||||
export class Docker {
|
||||
static get configDir(): string {
|
||||
@@ -136,8 +136,8 @@ export class Docker {
|
||||
await Exec.getExecOutput(`docker`, ['pull', image], {
|
||||
ignoreReturnCode: true
|
||||
}).then(res => {
|
||||
pulled = false;
|
||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||
pulled = false;
|
||||
const err = res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error';
|
||||
if (cacheFoundPath) {
|
||||
core.warning(`Failed to pull image, using one from cache: ${err}`);
|
||||
|
||||
@@ -253,6 +253,12 @@ export class Install {
|
||||
});
|
||||
}
|
||||
|
||||
const envs = Object.assign({}, process.env, {
|
||||
PATH: `${this.toolDir}:${process.env.PATH}`
|
||||
}) as {
|
||||
[key: string]: string;
|
||||
};
|
||||
|
||||
await core.group('Start Docker daemon', async () => {
|
||||
const bashPath: string = await io.which('bash', true);
|
||||
const cmd = `${this.toolDir}/dockerd --host="${dockerHost}" --config-file="${daemonConfigPath}" --exec-root="${this.runDir}/execroot" --data-root="${this.runDir}/data" --pidfile="${this.runDir}/docker.pid" --userland-proxy=false`;
|
||||
@@ -262,11 +268,12 @@ export class Install {
|
||||
// avoid killing it when the action finishes running. Even if detached,
|
||||
// we also need to run dockerd in a subshell and unref the process so
|
||||
// GitHub Action doesn't wait for it to finish.
|
||||
`sudo -E ${bashPath} << EOF
|
||||
`sudo env "PATH=$PATH" ${bashPath} << EOF
|
||||
( ${cmd} 2>&1 | tee "${this.runDir}/dockerd.log" ) &
|
||||
EOF`,
|
||||
[],
|
||||
{
|
||||
env: envs,
|
||||
detached: true,
|
||||
shell: true,
|
||||
stdio: ['ignore', process.stdout, process.stderr]
|
||||
@@ -280,7 +287,7 @@ EOF`,
|
||||
try {
|
||||
await Exec.getExecOutput(`docker version`, undefined, {
|
||||
silent: true,
|
||||
env: Object.assign({}, process.env, {
|
||||
env: Object.assign({}, envs, {
|
||||
DOCKER_HOST: dockerHost
|
||||
}) as {
|
||||
[key: string]: string;
|
||||
|
||||
199
src/github.ts
199
src/github.ts
@@ -14,13 +14,28 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {GitHub as Octokit} from '@actions/github/lib/utils';
|
||||
import crypto from 'crypto';
|
||||
import fs from 'fs';
|
||||
import jsyaml from 'js-yaml';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import {CreateArtifactRequest, FinalizeArtifactRequest, StringValue} from '@actions/artifact/lib/generated';
|
||||
import {internalArtifactTwirpClient} from '@actions/artifact/lib/internal/shared/artifact-twirp-client';
|
||||
import {getBackendIdsFromToken} from '@actions/artifact/lib/internal/shared/util';
|
||||
import {getExpiration} from '@actions/artifact/lib/internal/upload/retention';
|
||||
import {InvalidResponseError, NetworkError} from '@actions/artifact';
|
||||
import * as core from '@actions/core';
|
||||
import {SummaryTableCell} from '@actions/core/lib/summary';
|
||||
import * as github from '@actions/github';
|
||||
import {GitHub as Octokit} from '@actions/github/lib/utils';
|
||||
import {Context} from '@actions/github/lib/context';
|
||||
import {TransferProgressEvent} from '@azure/core-http';
|
||||
import {BlobClient, BlobHTTPHeaders} from '@azure/storage-blob';
|
||||
import {jwtDecode, JwtPayload} from 'jwt-decode';
|
||||
|
||||
import {GitHubActionsRuntimeToken, GitHubActionsRuntimeTokenAC, GitHubRepo} from './types/github';
|
||||
import {Util} from './util';
|
||||
|
||||
import {BuildSummaryOpts, GitHubActionsRuntimeToken, GitHubActionsRuntimeTokenAC, GitHubRepo, UploadArtifactOpts, UploadArtifactResponse} from './types/github';
|
||||
|
||||
export interface GitHubOpts {
|
||||
token?: string;
|
||||
@@ -49,8 +64,14 @@ export class GitHub {
|
||||
return process.env.GITHUB_API_URL || 'https://api.github.com';
|
||||
}
|
||||
|
||||
static get workflowRunURL(): string {
|
||||
return `${GitHub.serverURL}/${github.context.repo.owner}/${github.context.repo.repo}/actions/runs/${github.context.runId}`;
|
||||
static get repository(): string {
|
||||
return `${github.context.repo.owner}/${github.context.repo.repo}`;
|
||||
}
|
||||
|
||||
public static workflowRunURL(setAttempts?: boolean): string {
|
||||
// TODO: runAttempt is not yet part of github.context but will be in a
|
||||
// future release of @actions/github package: https://github.com/actions/toolkit/commit/faa425440f86f9c16587a19dfb59491253a2c92a
|
||||
return `${GitHub.serverURL}/${GitHub.repository}/actions/runs/${github.context.runId}${setAttempts ? `/attempts/${process.env.GITHUB_RUN_ATTEMPT || 1}` : ''}`;
|
||||
}
|
||||
|
||||
static get actionsRuntimeToken(): GitHubActionsRuntimeToken | undefined {
|
||||
@@ -90,4 +111,174 @@ export class GitHub {
|
||||
throw new Error(`Cannot parse GitHub Actions Runtime Token ACs: ${e.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
public static async uploadArtifact(opts: UploadArtifactOpts): Promise<UploadArtifactResponse> {
|
||||
const artifactName = path.basename(opts.filename);
|
||||
const backendIds = getBackendIdsFromToken();
|
||||
const artifactClient = internalArtifactTwirpClient();
|
||||
|
||||
core.info(`Uploading ${artifactName} to blob storage`);
|
||||
|
||||
const createArtifactReq: CreateArtifactRequest = {
|
||||
workflowRunBackendId: backendIds.workflowRunBackendId,
|
||||
workflowJobRunBackendId: backendIds.workflowJobRunBackendId,
|
||||
name: artifactName,
|
||||
version: 4
|
||||
};
|
||||
|
||||
const expiresAt = getExpiration(opts?.retentionDays);
|
||||
if (expiresAt) {
|
||||
createArtifactReq.expiresAt = expiresAt;
|
||||
}
|
||||
|
||||
const createArtifactResp = await artifactClient.CreateArtifact(createArtifactReq);
|
||||
if (!createArtifactResp.ok) {
|
||||
throw new InvalidResponseError('cannot create artifact client');
|
||||
}
|
||||
|
||||
let uploadByteCount = 0;
|
||||
const blobClient = new BlobClient(createArtifactResp.signedUploadUrl);
|
||||
const blockBlobClient = blobClient.getBlockBlobClient();
|
||||
|
||||
const headers: BlobHTTPHeaders = {
|
||||
blobContentDisposition: `attachment; filename="${artifactName}"`
|
||||
};
|
||||
if (opts.mimeType) {
|
||||
headers.blobContentType = opts.mimeType;
|
||||
}
|
||||
core.debug(`Upload headers: ${JSON.stringify(headers)}`);
|
||||
|
||||
try {
|
||||
core.info('Beginning upload of artifact content to blob storage');
|
||||
await blockBlobClient.uploadFile(opts.filename, {
|
||||
blobHTTPHeaders: headers,
|
||||
onProgress: (progress: TransferProgressEvent): void => {
|
||||
core.info(`Uploaded bytes ${progress.loadedBytes}`);
|
||||
uploadByteCount = progress.loadedBytes;
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
if (NetworkError.isNetworkErrorCode(error?.code)) {
|
||||
throw new NetworkError(error?.code);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
|
||||
core.info('Finished uploading artifact content to blob storage!');
|
||||
|
||||
const sha256Hash = crypto.createHash('sha256').update(fs.readFileSync(opts.filename)).digest('hex');
|
||||
core.info(`SHA256 hash of uploaded artifact is ${sha256Hash}`);
|
||||
|
||||
const finalizeArtifactReq: FinalizeArtifactRequest = {
|
||||
workflowRunBackendId: backendIds.workflowRunBackendId,
|
||||
workflowJobRunBackendId: backendIds.workflowJobRunBackendId,
|
||||
name: artifactName,
|
||||
size: uploadByteCount ? uploadByteCount.toString() : '0'
|
||||
};
|
||||
|
||||
if (sha256Hash) {
|
||||
finalizeArtifactReq.hash = StringValue.create({
|
||||
value: `sha256:${sha256Hash}`
|
||||
});
|
||||
}
|
||||
|
||||
core.info(`Finalizing artifact upload`);
|
||||
const finalizeArtifactResp = await artifactClient.FinalizeArtifact(finalizeArtifactReq);
|
||||
if (!finalizeArtifactResp.ok) {
|
||||
throw new InvalidResponseError('Cannot finalize artifact upload');
|
||||
}
|
||||
|
||||
const artifactId = BigInt(finalizeArtifactResp.artifactId);
|
||||
core.info(`Artifact successfully finalized (${artifactId})`);
|
||||
|
||||
const artifactURL = `${GitHub.workflowRunURL()}/artifacts/${artifactId}`;
|
||||
core.info(`Artifact download URL: ${artifactURL}`);
|
||||
|
||||
return {
|
||||
id: Number(artifactId),
|
||||
filename: artifactName,
|
||||
size: uploadByteCount,
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
163
src/oci/oci.ts
Normal file
163
src/oci/oci.ts
Normal file
@@ -0,0 +1,163 @@
|
||||
/**
|
||||
* Copyright 2024 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import fs from 'fs';
|
||||
import gunzip from 'gunzip-maybe';
|
||||
import * as path from 'path';
|
||||
import {Readable} from 'stream';
|
||||
import * as tar from 'tar-stream';
|
||||
|
||||
import {Archive, LoadArchiveOpts} from '../types/oci/oci';
|
||||
import {Index} from '../types/oci';
|
||||
import {Manifest} from '../types/oci/manifest';
|
||||
import {Image} from '../types/oci/config';
|
||||
import {IMAGE_BLOBS_DIR_V1, IMAGE_INDEX_FILE_V1, IMAGE_LAYOUT_FILE_V1, ImageLayout} from '../types/oci/layout';
|
||||
import {MEDIATYPE_IMAGE_INDEX_V1, MEDIATYPE_IMAGE_MANIFEST_V1} from '../types/oci/mediatype';
|
||||
|
||||
export class OCI {
|
||||
public static loadArchive(opts: LoadArchiveOpts): Promise<Archive> {
|
||||
return new Promise<Archive>((resolve, reject) => {
|
||||
const tarex: tar.Extract = tar.extract();
|
||||
|
||||
let rootIndex: Index;
|
||||
let rootLayout: ImageLayout;
|
||||
const indexes: Record<string, Index> = {};
|
||||
const manifests: Record<string, Manifest> = {};
|
||||
const images: Record<string, Image> = {};
|
||||
const blobs: Record<string, unknown> = {};
|
||||
|
||||
tarex.on('entry', async (header, stream, next) => {
|
||||
if (header.type === 'file') {
|
||||
const filename = path.normalize(header.name);
|
||||
if (filename === IMAGE_INDEX_FILE_V1) {
|
||||
rootIndex = await OCI.streamToJson<Index>(stream);
|
||||
} else if (filename === IMAGE_LAYOUT_FILE_V1) {
|
||||
rootLayout = await OCI.streamToJson<ImageLayout>(stream);
|
||||
} else if (filename.startsWith(path.join(IMAGE_BLOBS_DIR_V1, path.sep))) {
|
||||
const blob = await OCI.extractBlob(stream);
|
||||
const digest = `${filename.split(path.sep)[1]}:${filename.split(path.sep)[filename.split(path.sep).length - 1]}`;
|
||||
if (OCI.isIndex(blob)) {
|
||||
indexes[digest] = <Index>JSON.parse(blob);
|
||||
} else if (OCI.isManifest(blob)) {
|
||||
manifests[digest] = <Manifest>JSON.parse(blob);
|
||||
} else if (OCI.isImage(blob)) {
|
||||
images[digest] = <Image>JSON.parse(blob);
|
||||
} else {
|
||||
blobs[digest] = blob;
|
||||
}
|
||||
} else {
|
||||
reject(new Error(`Invalid OCI archive: unexpected file ${filename}`));
|
||||
}
|
||||
}
|
||||
stream.resume();
|
||||
next();
|
||||
});
|
||||
|
||||
tarex.on('finish', () => {
|
||||
if (!rootIndex || !rootLayout) {
|
||||
reject(new Error('Invalid OCI archive: missing index or layout'));
|
||||
}
|
||||
resolve({
|
||||
root: {
|
||||
index: rootIndex,
|
||||
layout: rootLayout
|
||||
},
|
||||
indexes: indexes,
|
||||
manifests: manifests,
|
||||
images: images,
|
||||
blobs: blobs
|
||||
} as Archive);
|
||||
});
|
||||
|
||||
tarex.on('error', error => {
|
||||
reject(error);
|
||||
});
|
||||
|
||||
fs.createReadStream(opts.file).pipe(gunzip()).pipe(tarex);
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
private static isIndex(blob: any): boolean {
|
||||
try {
|
||||
const index = <Index>JSON.parse(blob);
|
||||
return index.mediaType === MEDIATYPE_IMAGE_INDEX_V1;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
private static isManifest(blob: any): boolean {
|
||||
try {
|
||||
const manifest = <Manifest>JSON.parse(blob);
|
||||
return manifest.mediaType === MEDIATYPE_IMAGE_MANIFEST_V1 && manifest.layers.length > 0;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
private static isImage(blob: any): boolean {
|
||||
try {
|
||||
const image = <Image>JSON.parse(blob);
|
||||
return image.rootfs.type !== '';
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
private static extractBlob(stream: Readable): Promise<any> {
|
||||
return new Promise<unknown>((resolve, reject) => {
|
||||
const chunks: Buffer[] = [];
|
||||
const dstream = stream.pipe(gunzip());
|
||||
dstream.on('data', chunk => {
|
||||
chunks.push(chunk);
|
||||
});
|
||||
dstream.on('end', () => {
|
||||
resolve(Buffer.concat(chunks).toString('utf8'));
|
||||
});
|
||||
dstream.on('error', async error => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private static async streamToJson<T>(stream: Readable): Promise<T> {
|
||||
return new Promise<T>((resolve, reject) => {
|
||||
const chunks: string[] = [];
|
||||
let bytes = 0;
|
||||
stream.on('data', chunk => {
|
||||
bytes += chunk.length;
|
||||
if (bytes <= 2 * 1024 * 1024) {
|
||||
chunks.push(chunk.toString('utf8'));
|
||||
} else {
|
||||
reject(new Error('The data stream exceeds the size limit for JSON parsing.'));
|
||||
}
|
||||
});
|
||||
stream.on('end', () => {
|
||||
try {
|
||||
resolve(JSON.parse(chunks.join('')));
|
||||
} catch (error) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
stream.on('error', async error => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -15,8 +15,9 @@
|
||||
*/
|
||||
|
||||
import {Buildx} from './buildx/buildx';
|
||||
import {Build as BuildxBuild} from './buildx/build';
|
||||
import {Bake as BuildxBake} from './buildx/bake';
|
||||
import {Install as BuildxInstall} from './buildx/install';
|
||||
import {Bake} from './buildx/bake';
|
||||
import {Builder} from './buildx/builder';
|
||||
import {BuildKit} from './buildkit/buildkit';
|
||||
import {GitHub} from './github';
|
||||
@@ -32,16 +33,18 @@ export interface ToolkitOpts {
|
||||
export class Toolkit {
|
||||
public github: GitHub;
|
||||
public buildx: Buildx;
|
||||
public buildxBuild: BuildxBuild;
|
||||
public buildxBake: BuildxBake;
|
||||
public buildxInstall: BuildxInstall;
|
||||
public bake: Bake;
|
||||
public builder: Builder;
|
||||
public buildkit: BuildKit;
|
||||
|
||||
constructor(opts: ToolkitOpts = {}) {
|
||||
this.github = new GitHub({token: opts.githubToken});
|
||||
this.buildx = new Buildx();
|
||||
this.buildxBuild = new BuildxBuild({buildx: this.buildx});
|
||||
this.buildxBake = new BuildxBake({buildx: this.buildx});
|
||||
this.buildxInstall = new BuildxInstall();
|
||||
this.bake = new Bake({buildx: this.buildx});
|
||||
this.builder = new Builder({buildx: this.buildx});
|
||||
this.buildkit = new BuildKit({buildx: this.buildx});
|
||||
}
|
||||
|
||||
18
src/types/buildkit/buildkit.ts
Normal file
18
src/types/buildkit/buildkit.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Copyright 2024 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/solver/llbsolver/history.go#L672
|
||||
export const MEDIATYPE_STATUS_V0 = 'application/vnd.buildkit.status.v0';
|
||||
78
src/types/buildkit/client.ts
Normal file
78
src/types/buildkit/client.ts
Normal file
@@ -0,0 +1,78 @@
|
||||
/**
|
||||
* Copyright 2024 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Digest} from '../oci/digest';
|
||||
import {ProgressGroup, Range, SourceInfo} from './ops';
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/client/graph.go#L10-L19
|
||||
export interface Vertex {
|
||||
digest?: Digest;
|
||||
inputs?: Array<Digest>;
|
||||
name?: string;
|
||||
started?: Date;
|
||||
completed?: Date;
|
||||
cached?: boolean;
|
||||
error?: string;
|
||||
progressGroup?: ProgressGroup;
|
||||
}
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/client/graph.go#L21-L30
|
||||
export interface VertexStatus {
|
||||
id: string;
|
||||
vertex?: Digest;
|
||||
name?: string;
|
||||
total?: number;
|
||||
current: number;
|
||||
timestamp?: Date;
|
||||
started?: Date;
|
||||
completed?: Date;
|
||||
}
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/client/graph.go#L32-L37
|
||||
export interface VertexLog {
|
||||
vertex?: Digest;
|
||||
stream?: number;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
data: any;
|
||||
timestamp: Date;
|
||||
}
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/client/graph.go#L39-L48
|
||||
export interface VertexWarning {
|
||||
vertex?: Digest;
|
||||
level?: number;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
short?: any;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
detail?: Array<any>;
|
||||
url?: string;
|
||||
|
||||
sourceInfo?: SourceInfo;
|
||||
range?: Array<Range>;
|
||||
}
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/client/graph.go#L50-L55
|
||||
export interface SolveStatus {
|
||||
vertexes?: Array<Vertex>;
|
||||
statuses?: Array<VertexStatus>;
|
||||
logs?: Array<VertexLog>;
|
||||
warnings?: Array<VertexWarning>;
|
||||
}
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/client/graph.go#L57-L60
|
||||
export interface SolveResponse {
|
||||
exporterResponse: Record<string, string>;
|
||||
}
|
||||
108
src/types/buildkit/control.ts
Normal file
108
src/types/buildkit/control.ts
Normal file
@@ -0,0 +1,108 @@
|
||||
/**
|
||||
* Copyright 2024 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Descriptor} from '../oci/descriptor';
|
||||
import {Digest} from '../oci/digest';
|
||||
import {ProgressGroup, Range, SourceInfo} from './ops';
|
||||
import {RpcStatus} from './rpc';
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/api/services/control/control.pb.go#L1504-L1525
|
||||
export interface BuildHistoryRecord {
|
||||
Ref: string;
|
||||
Frontend: string;
|
||||
FrontendAttrs: Record<string, string>;
|
||||
Exporters: Array<Exporter>;
|
||||
error?: RpcStatus;
|
||||
CreatedAt?: Date;
|
||||
CompletedAt?: Date;
|
||||
logs?: Descriptor;
|
||||
ExporterResponse: Record<string, string>;
|
||||
Result?: BuildResultInfo;
|
||||
Results: Record<string, BuildResultInfo>;
|
||||
Generation: number;
|
||||
trace?: Descriptor;
|
||||
pinned: boolean;
|
||||
numCachedSteps: number;
|
||||
numTotalSteps: number;
|
||||
numCompletedSteps: number;
|
||||
}
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/api/services/control/control.pb.go#L1909-L1917
|
||||
export interface Exporter {
|
||||
Type: string;
|
||||
Attrs: Record<string, string>;
|
||||
}
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/api/services/control/control.pb.go#L1845-L1852
|
||||
export interface BuildResultInfo {
|
||||
ResultDeprecated?: Descriptor;
|
||||
Attestations?: Array<Descriptor>;
|
||||
Results?: Record<number, Descriptor>;
|
||||
}
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/api/services/control/control.pb.go#L751-L759
|
||||
export interface StatusResponse {
|
||||
vertexes?: Array<Vertex>;
|
||||
statuses?: Array<VertexStatus>;
|
||||
logs?: Array<VertexLog>;
|
||||
warnings?: Array<VertexWarning>;
|
||||
}
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/api/services/control/control.pb.go#L822-L834
|
||||
export interface Vertex {
|
||||
digest: Digest;
|
||||
inputs: Array<Digest>;
|
||||
name?: string;
|
||||
cached?: boolean;
|
||||
started?: Date;
|
||||
completed?: Date;
|
||||
error?: string;
|
||||
progressGroup?: ProgressGroup;
|
||||
}
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/api/services/control/control.pb.go#L911-L923
|
||||
export interface VertexStatus {
|
||||
ID?: string;
|
||||
vertex: Digest;
|
||||
name?: string;
|
||||
current?: number;
|
||||
total?: number;
|
||||
timestamp: Date;
|
||||
started?: Date;
|
||||
completed?: Date;
|
||||
}
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/api/services/control/control.pb.go#L1007-L1015
|
||||
export interface VertexLog {
|
||||
vertex: Digest;
|
||||
timestamp: Date;
|
||||
stream?: number;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
msg?: any;
|
||||
}
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/api/services/control/control.pb.go#L1071-L1082
|
||||
export interface VertexWarning {
|
||||
vertex: Digest;
|
||||
level?: number;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
short?: any;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
detail?: Array<any>;
|
||||
url?: string;
|
||||
info?: SourceInfo;
|
||||
ranges?: Array<Range>;
|
||||
}
|
||||
82
src/types/buildkit/ops.ts
Normal file
82
src/types/buildkit/ops.ts
Normal file
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
* Copyright 2024 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/solver/pb/ops.pb.go#L1901-L1909
|
||||
export interface Definition {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
def?: Array<any>;
|
||||
metadata: Record<string, OpMetadata>;
|
||||
Source?: Source;
|
||||
}
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/solver/pb/ops.pb.go#L1313-L1323
|
||||
export interface OpMetadata {
|
||||
ignore_cache?: boolean;
|
||||
description?: Record<string, string>;
|
||||
export_cache?: ExportCache;
|
||||
caps: Record<string, boolean>;
|
||||
progress_group?: ProgressGroup;
|
||||
}
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/solver/pb/ops.pb.go#L1390-L1393
|
||||
export interface Source {
|
||||
locations?: Record<string, Locations>;
|
||||
infos?: Array<SourceInfo>;
|
||||
}
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/solver/pb/ops.pb.go#L1439-L1441
|
||||
export interface Locations {
|
||||
locations?: Array<Location>;
|
||||
}
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/solver/pb/ops.pb.go#L1545-L1548
|
||||
export interface Location {
|
||||
sourceIndex?: number;
|
||||
ranges?: Array<Range>;
|
||||
}
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/solver/pb/ops.pb.go#L1594-L1597
|
||||
export interface Range {
|
||||
start: Position;
|
||||
end: Position;
|
||||
}
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/solver/pb/ops.pb.go#L1643-L1646
|
||||
export interface Position {
|
||||
line: number;
|
||||
character: number;
|
||||
}
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/solver/pb/ops.pb.go#L1480-L1485
|
||||
export interface SourceInfo {
|
||||
filename?: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
data?: any;
|
||||
definition?: Definition;
|
||||
language?: string;
|
||||
}
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/solver/pb/ops.pb.go#L1691-L1693
|
||||
export interface ExportCache {
|
||||
Value?: boolean;
|
||||
}
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/solver/pb/ops.pb.go#L1731-L1735
|
||||
export interface ProgressGroup {
|
||||
id?: string;
|
||||
name?: string;
|
||||
weak?: boolean;
|
||||
}
|
||||
31
src/types/buildkit/rpc.ts
Normal file
31
src/types/buildkit/rpc.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Copyright 2024 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/vendor/github.com/gogo/googleapis/google/rpc/status.pb.go#L36-L49
|
||||
export interface RpcStatus {
|
||||
code: number;
|
||||
message: string;
|
||||
details: Array<RpcAny>;
|
||||
}
|
||||
|
||||
// https://github.com/moby/buildkit/blob/v0.14.0/vendor/github.com/gogo/protobuf/types/any.pb.go#L108-L143
|
||||
// Define properties based on google.protobuf.Any. For simplicity, assuming it
|
||||
// has at least a type_url and a value.
|
||||
export interface RpcAny {
|
||||
type_url: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
value: any;
|
||||
}
|
||||
@@ -19,6 +19,10 @@ export interface BakeDefinition {
|
||||
target: Record<string, Target>;
|
||||
}
|
||||
|
||||
export interface BakeMetadata {
|
||||
[target: string]: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface Group {
|
||||
targets: Array<string>;
|
||||
}
|
||||
20
src/types/buildx/build.ts
Normal file
20
src/types/buildx/build.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Copyright 2024 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export type BuildMetadata = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
[key: string]: any;
|
||||
};
|
||||
@@ -26,3 +26,21 @@ export interface DownloadVersion {
|
||||
downloadURL: string;
|
||||
releasesURL: string;
|
||||
}
|
||||
|
||||
export interface LocalRefsOpts {
|
||||
dir: string;
|
||||
builderName?: string;
|
||||
nodeName?: string;
|
||||
since?: Date;
|
||||
}
|
||||
|
||||
export interface LocalRefsResponse {
|
||||
[ref: string]: LocalState;
|
||||
}
|
||||
|
||||
export interface LocalState {
|
||||
Target: string;
|
||||
LocalPath: string;
|
||||
DockerfilePath: string;
|
||||
GroupRef?: string;
|
||||
}
|
||||
44
src/types/buildx/history.ts
Normal file
44
src/types/buildx/history.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* Copyright 2024 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export interface ExportRecordOpts {
|
||||
refs: Array<string>;
|
||||
image?: string;
|
||||
}
|
||||
|
||||
export interface ExportRecordResponse {
|
||||
dockerbuildFilename: string;
|
||||
dockerbuildSize: number;
|
||||
summaries: Summaries;
|
||||
builderName: string;
|
||||
nodeName: 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;
|
||||
}
|
||||
@@ -17,6 +17,9 @@
|
||||
import {components as OctoOpenApiTypes} from '@octokit/openapi-types';
|
||||
import {JwtPayload} from 'jwt-decode';
|
||||
|
||||
import {BakeDefinition} from './buildx/bake';
|
||||
import {ExportRecordResponse} from './buildx/history';
|
||||
|
||||
export interface GitHubRelease {
|
||||
id: number;
|
||||
tag_name: string;
|
||||
@@ -34,3 +37,24 @@ export interface GitHubActionsRuntimeTokenAC {
|
||||
Scope: string;
|
||||
Permission: number;
|
||||
}
|
||||
|
||||
export interface UploadArtifactOpts {
|
||||
filename: string;
|
||||
mimeType?: string;
|
||||
retentionDays?: number;
|
||||
}
|
||||
|
||||
export interface UploadArtifactResponse {
|
||||
id: number;
|
||||
filename: string;
|
||||
size: number;
|
||||
url: string;
|
||||
}
|
||||
|
||||
export interface BuildSummaryOpts {
|
||||
exportRes: ExportRecordResponse;
|
||||
uploadRes: UploadArtifactResponse;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
inputs?: any;
|
||||
bakeDefinition?: BakeDefinition;
|
||||
}
|
||||
|
||||
20
src/types/intoto/intoto.ts
Normal file
20
src/types/intoto/intoto.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Copyright 2024 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// https://github.com/in-toto/in-toto-golang/blob/dd6278764ab1dae7301609c7510129888e2fd569/in_toto/envelope.go#L17
|
||||
export const MEDIATYPE_PAYLOAD = 'application/vnd.in-toto+json';
|
||||
|
||||
export const MEDIATYPE_PREDICATE = 'in-toto.io/predicate-type';
|
||||
69
src/types/intoto/slsa_provenance/v0.2/provenance.ts
Normal file
69
src/types/intoto/slsa_provenance/v0.2/provenance.ts
Normal file
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* Copyright 2024 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// https://github.com/in-toto/in-toto-golang/blob/master/in_toto/slsa_provenance/v0.2/provenance.go
|
||||
|
||||
export const PREDICATE_SLSA_PROVENANCE = 'https://slsa.dev/provenance/v0.2';
|
||||
|
||||
export interface ProvenancePredicate {
|
||||
builder: ProvenanceBuilder;
|
||||
buildType: string;
|
||||
invocation?: ProvenanceInvocation;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
buildConfig?: any;
|
||||
metadata: ProvenanceMetadata;
|
||||
materials?: Material[];
|
||||
}
|
||||
|
||||
export interface ProvenanceBuilder {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ProvenanceInvocation {
|
||||
configSource?: ConfigSource;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
parameters?: any;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
environment?: any;
|
||||
}
|
||||
|
||||
export interface DigestSet {
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
export interface ConfigSource {
|
||||
uri?: string;
|
||||
digest?: DigestSet;
|
||||
entryPoint?: string;
|
||||
}
|
||||
|
||||
export interface Completeness {
|
||||
parameters?: boolean;
|
||||
environment?: boolean;
|
||||
materials?: boolean;
|
||||
}
|
||||
|
||||
export interface ProvenanceMetadata {
|
||||
buildInvocationId?: string;
|
||||
buildStartedOn?: string;
|
||||
completeness?: Completeness;
|
||||
reproducible?: boolean;
|
||||
}
|
||||
|
||||
export interface Material {
|
||||
uri: string;
|
||||
digest: DigestSet;
|
||||
}
|
||||
52
src/types/oci/config.ts
Normal file
52
src/types/oci/config.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* Copyright 2024 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Digest} from './digest';
|
||||
import {Platform} from './descriptor';
|
||||
|
||||
export interface ImageConfig {
|
||||
User?: string;
|
||||
ExposedPorts?: Record<string, unknown>;
|
||||
Env?: string[];
|
||||
Entrypoint?: string[];
|
||||
Cmd?: string[];
|
||||
Volumes?: Record<string, unknown>;
|
||||
WorkingDir?: string;
|
||||
Labels?: Record<string, string>;
|
||||
StopSignal?: string;
|
||||
ArgsEscaped?: boolean;
|
||||
}
|
||||
|
||||
export interface RootFS {
|
||||
type: string;
|
||||
diff_ids: Digest[];
|
||||
}
|
||||
|
||||
export interface History {
|
||||
created?: string; // assuming RFC 3339 formatted string
|
||||
created_by?: string;
|
||||
author?: string;
|
||||
comment?: string;
|
||||
empty_layer?: boolean;
|
||||
}
|
||||
|
||||
export interface Image extends Platform {
|
||||
created?: string; // assuming RFC 3339 formatted string
|
||||
author?: string;
|
||||
config?: ImageConfig;
|
||||
rootfs: RootFS;
|
||||
history?: History[];
|
||||
}
|
||||
45
src/types/oci/descriptor.ts
Normal file
45
src/types/oci/descriptor.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* Copyright 2024 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Digest} from './digest';
|
||||
|
||||
import {MEDIATYPE_EMPTY_JSON_V1} from './mediatype';
|
||||
|
||||
export interface Descriptor {
|
||||
mediaType: string;
|
||||
digest: Digest;
|
||||
size: number;
|
||||
urls?: string[];
|
||||
annotations?: Record<string, string>;
|
||||
data?: string;
|
||||
platform?: Platform;
|
||||
artifactType?: string;
|
||||
}
|
||||
|
||||
export interface Platform {
|
||||
architecture: string;
|
||||
os: string;
|
||||
'os.version'?: string;
|
||||
'os.features'?: string[];
|
||||
variant?: string;
|
||||
}
|
||||
|
||||
export const DescriptorEmptyJSON: Descriptor = {
|
||||
mediaType: MEDIATYPE_EMPTY_JSON_V1,
|
||||
digest: 'sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a',
|
||||
size: 2,
|
||||
data: '{}'
|
||||
};
|
||||
17
src/types/oci/digest.ts
Normal file
17
src/types/oci/digest.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Copyright 2024 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export type Digest = string;
|
||||
26
src/types/oci/index.ts
Normal file
26
src/types/oci/index.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Copyright 2024 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Versioned} from './versioned';
|
||||
import {Descriptor} from './descriptor';
|
||||
|
||||
export interface Index extends Versioned {
|
||||
mediaType?: string;
|
||||
artifactType?: string;
|
||||
manifests: Descriptor[];
|
||||
subject?: Descriptor;
|
||||
annotations?: Record<string, string>;
|
||||
}
|
||||
27
src/types/oci/layout.ts
Normal file
27
src/types/oci/layout.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Copyright 2024 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export const IMAGE_LAYOUT_FILE_V1 = 'oci-layout';
|
||||
|
||||
export const IMAGE_LAYOUT_VERSION_V1 = '1.0.0';
|
||||
|
||||
export const IMAGE_INDEX_FILE_V1 = 'index.json';
|
||||
|
||||
export const IMAGE_BLOBS_DIR_V1 = 'blobs';
|
||||
|
||||
export interface ImageLayout {
|
||||
version: string;
|
||||
}
|
||||
27
src/types/oci/manifest.ts
Normal file
27
src/types/oci/manifest.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Copyright 2024 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Descriptor} from './descriptor';
|
||||
import {Versioned} from './versioned';
|
||||
|
||||
export interface Manifest extends Versioned {
|
||||
mediaType?: string;
|
||||
artifactType?: string;
|
||||
config: Descriptor;
|
||||
layers: Descriptor[];
|
||||
subject?: Descriptor;
|
||||
annotations?: Record<string, string>;
|
||||
}
|
||||
25
src/types/oci/mediatype.ts
Normal file
25
src/types/oci/mediatype.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Copyright 2024 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export const MEDIATYPE_DESCRIPTOR_V1 = 'application/vnd.oci.descriptor.v1+json';
|
||||
|
||||
export const MEDIATYPE_IMAGE_MANIFEST_V1 = 'application/vnd.oci.image.manifest.v1+json';
|
||||
|
||||
export const MEDIATYPE_IMAGE_INDEX_V1 = 'application/vnd.oci.image.index.v1+json';
|
||||
|
||||
export const MEDIATYPE_IMAGE_LAYER_V1 = 'application/vnd.oci.image.layer.v1.tar';
|
||||
|
||||
export const MEDIATYPE_EMPTY_JSON_V1 = 'application/vnd.oci.empty.v1+json';
|
||||
36
src/types/oci/oci.ts
Normal file
36
src/types/oci/oci.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Copyright 2024 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Index} from './index';
|
||||
import {ImageLayout} from './layout';
|
||||
import {Manifest} from './manifest';
|
||||
import {Image} from './config';
|
||||
|
||||
export interface LoadArchiveOpts {
|
||||
file: string;
|
||||
}
|
||||
|
||||
export interface Archive {
|
||||
root: {
|
||||
index: Index;
|
||||
layout: ImageLayout;
|
||||
};
|
||||
indexes: Record<string, Index>;
|
||||
manifests: Record<string, Manifest>;
|
||||
images: Record<string, Image>;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
blobs: Record<string, any>;
|
||||
}
|
||||
19
src/types/oci/versioned.ts
Normal file
19
src/types/oci/versioned.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Copyright 2024 actions-toolkit authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export interface Versioned {
|
||||
schemaVersion: number;
|
||||
}
|
||||
13
src/util.ts
13
src/util.ts
@@ -166,4 +166,17 @@ export class Util {
|
||||
throw new Error(`parseBool syntax error: ${str}`);
|
||||
}
|
||||
}
|
||||
|
||||
public static formatFileSize(bytes: number): string {
|
||||
if (bytes === 0) return '0 Bytes';
|
||||
const k = 1024;
|
||||
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
|
||||
}
|
||||
|
||||
public static generateRandomString(length = 10) {
|
||||
const bytes = crypto.randomBytes(Math.ceil(length / 2));
|
||||
return bytes.toString('hex').slice(0, length);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"esModuleInterop": true,
|
||||
"target": "ES2022",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"strict": true,
|
||||
"declaration": true,
|
||||
"sourceMap": true,
|
||||
|
||||
Reference in New Issue
Block a user