Compare commits
25 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8e5442c4ef | ||
|
eda41b71bf | ||
|
388c08f740 | ||
|
dbef88086f | ||
|
b73e7a71ac | ||
|
b9fba690eb | ||
|
ac82374ba6 | ||
|
c92519a44e | ||
|
3b4179d34d | ||
|
0784993ef8 | ||
|
52c3e9e410 | ||
|
82a5e6726c | ||
|
41e1fe3437 | ||
|
48cce1cba0 | ||
|
61879b94bc | ||
|
36ea4ee555 | ||
|
74fa878183 | ||
|
9dc751fe24 | ||
|
c94c54c4e6 | ||
|
187f09259d | ||
|
6d6eaf3451 | ||
|
1484a7ec95 | ||
|
31cebacef4 | ||
|
394bbab10c | ||
|
ee4c9054ec |
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -424,7 +424,7 @@ jobs:
|
|||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: v0.12.0-rc1
|
version: latest
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/bake-action@v4
|
uses: docker/bake-action@v4
|
||||||
|
14
dist/index.js
generated
vendored
14
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -29,12 +29,12 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.1",
|
"@actions/core": "^1.10.1",
|
||||||
"@actions/github": "^6.0.0",
|
"@actions/github": "^6.0.0",
|
||||||
"@docker/actions-toolkit": "^0.14.0",
|
"@docker/actions-toolkit": "^0.16.1",
|
||||||
"@renovate/pep440": "^1.0.0",
|
"@renovate/pep440": "^1.0.0",
|
||||||
"csv-parse": "^5.5.2",
|
"csv-parse": "^5.5.3",
|
||||||
"handlebars": "^4.7.8",
|
"handlebars": "^4.7.8",
|
||||||
"moment": "^2.29.4",
|
"moment": "^2.30.1",
|
||||||
"moment-timezone": "^0.5.43",
|
"moment-timezone": "^0.5.44",
|
||||||
"semver": "^7.5.4"
|
"semver": "^7.5.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@@ -105,6 +105,6 @@ actionsToolkit.run(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Bake file with tags and labels
|
// Bake file with tags and labels
|
||||||
setOutput(`bake-file`, meta.getBakeFileTagsLabels());
|
setOutput(`bake-file`, `${meta.getBakeFileTagsLabels()}`);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
42
src/meta.ts
42
src/meta.ts
@@ -522,15 +522,19 @@ export class Meta {
|
|||||||
|
|
||||||
public getBakeFile(kind: string): string {
|
public getBakeFile(kind: string): string {
|
||||||
if (kind == 'tags') {
|
if (kind == 'tags') {
|
||||||
return this.generateBakeFile(kind, {
|
return this.generateBakeFile(
|
||||||
|
{
|
||||||
tags: this.getTags(),
|
tags: this.getTags(),
|
||||||
args: {
|
args: {
|
||||||
DOCKER_META_IMAGES: this.getImageNames().join(','),
|
DOCKER_META_IMAGES: this.getImageNames().join(','),
|
||||||
DOCKER_META_VERSION: this.version.main
|
DOCKER_META_VERSION: this.version.main
|
||||||
}
|
}
|
||||||
});
|
},
|
||||||
|
kind
|
||||||
|
);
|
||||||
} else if (kind == 'labels') {
|
} else if (kind == 'labels') {
|
||||||
return this.generateBakeFile(kind, {
|
return this.generateBakeFile(
|
||||||
|
{
|
||||||
labels: this.getLabels().reduce((res, label) => {
|
labels: this.getLabels().reduce((res, label) => {
|
||||||
const matches = label.match(/([^=]*)=(.*)/);
|
const matches = label.match(/([^=]*)=(.*)/);
|
||||||
if (!matches) {
|
if (!matches) {
|
||||||
@@ -539,28 +543,27 @@ export class Meta {
|
|||||||
res[matches[1]] = matches[2];
|
res[matches[1]] = matches[2];
|
||||||
return res;
|
return res;
|
||||||
}, {})
|
}, {})
|
||||||
});
|
},
|
||||||
|
kind
|
||||||
|
);
|
||||||
} else if (kind.startsWith('annotations:')) {
|
} else if (kind.startsWith('annotations:')) {
|
||||||
const name = kind.split(':')[0];
|
const name = kind.split(':')[0];
|
||||||
const annotations: Array<string> = [];
|
const annotations: Array<string> = [];
|
||||||
for (const level of kind.split(':')[1].split(',')) {
|
for (const level of kind.split(':')[1].split(',')) {
|
||||||
annotations.push(...this.getAnnotations().map(label => `${level}:${label}`));
|
annotations.push(...this.getAnnotations().map(label => `${level}:${label}`));
|
||||||
}
|
}
|
||||||
return this.generateBakeFile(name, {
|
return this.generateBakeFile(
|
||||||
|
{
|
||||||
annotations: annotations
|
annotations: annotations
|
||||||
});
|
},
|
||||||
|
name
|
||||||
|
);
|
||||||
}
|
}
|
||||||
throw new Error(`Unknown bake file type: ${kind}`);
|
throw new Error(`Unknown bake file type: ${kind}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
public getBakeFileTagsLabels(): string {
|
public getBakeFileTagsLabels(): string {
|
||||||
const bakeFile = path.join(ToolkitContext.tmpDir(), 'docker-metadata-action-bake.json');
|
return this.generateBakeFile({
|
||||||
fs.writeFileSync(
|
|
||||||
bakeFile,
|
|
||||||
JSON.stringify(
|
|
||||||
{
|
|
||||||
target: {
|
|
||||||
[this.inputs.bakeTarget]: {
|
|
||||||
tags: this.getTags(),
|
tags: this.getTags(),
|
||||||
labels: this.getLabels().reduce((res, label) => {
|
labels: this.getLabels().reduce((res, label) => {
|
||||||
const matches = label.match(/([^=]*)=(.*)/);
|
const matches = label.match(/([^=]*)=(.*)/);
|
||||||
@@ -574,18 +577,11 @@ export class Meta {
|
|||||||
DOCKER_META_IMAGES: this.getImageNames().join(','),
|
DOCKER_META_IMAGES: this.getImageNames().join(','),
|
||||||
DOCKER_META_VERSION: this.version.main
|
DOCKER_META_VERSION: this.version.main
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
|
||||||
},
|
|
||||||
null,
|
|
||||||
2
|
|
||||||
)
|
|
||||||
);
|
|
||||||
return bakeFile;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private generateBakeFile(name: string, dt): string {
|
private generateBakeFile(dt, suffix?: string): string {
|
||||||
const bakeFile = path.join(ToolkitContext.tmpDir(), `docker-metadata-action-bake-${name}.json`);
|
const bakeFile = path.join(ToolkitContext.tmpDir(), `docker-metadata-action-bake${suffix ? `-${suffix}` : ''}.json`);
|
||||||
fs.writeFileSync(bakeFile, JSON.stringify({target: {[this.inputs.bakeTarget]: dt}}, null, 2));
|
fs.writeFileSync(bakeFile, JSON.stringify({target: {[this.inputs.bakeTarget]: dt}}, null, 2));
|
||||||
return bakeFile;
|
return bakeFile;
|
||||||
}
|
}
|
||||||
|
49
yarn.lock
49
yarn.lock
@@ -773,10 +773,10 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@jridgewell/trace-mapping" "0.3.9"
|
"@jridgewell/trace-mapping" "0.3.9"
|
||||||
|
|
||||||
"@docker/actions-toolkit@^0.14.0":
|
"@docker/actions-toolkit@^0.16.1":
|
||||||
version "0.14.0"
|
version "0.16.1"
|
||||||
resolved "https://registry.yarnpkg.com/@docker/actions-toolkit/-/actions-toolkit-0.14.0.tgz#1cc7108aa1da0df708fb65915cc927d0cc420584"
|
resolved "https://registry.yarnpkg.com/@docker/actions-toolkit/-/actions-toolkit-0.16.1.tgz#797f843acee50dd3e01e976a6305ce57516b7347"
|
||||||
integrity sha512-5PZ49FgZLcS421Py60Zm5CGzQt1OyGVVx2CHZbjr2S0Vm6Rqks4diB3io/nt4EkccUb3EgwClZPopICOPzyIPw==
|
integrity sha512-RVlNRBJLBdRh3SC+GejtT0z47j5GgTc2hA3sNlWXYw7syQJON++/fgqWn7OqjCmT7c9MtdeqxwT3MTx1WvgSsw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@actions/cache" "^3.2.2"
|
"@actions/cache" "^3.2.2"
|
||||||
"@actions/core" "^1.10.1"
|
"@actions/core" "^1.10.1"
|
||||||
@@ -785,12 +785,11 @@
|
|||||||
"@actions/http-client" "^2.2.0"
|
"@actions/http-client" "^2.2.0"
|
||||||
"@actions/io" "^1.1.3"
|
"@actions/io" "^1.1.3"
|
||||||
"@actions/tool-cache" "^2.0.1"
|
"@actions/tool-cache" "^2.0.1"
|
||||||
"@octokit/core" "^5.0.1"
|
"@octokit/core" "^5.0.2"
|
||||||
"@octokit/plugin-rest-endpoint-methods" "^10.1.5"
|
"@octokit/plugin-rest-endpoint-methods" "^10.2.0"
|
||||||
async-retry "^1.3.3"
|
async-retry "^1.3.3"
|
||||||
csv-parse "^5.5.2"
|
csv-parse "^5.5.3"
|
||||||
handlebars "^4.7.8"
|
handlebars "^4.7.8"
|
||||||
js-yaml "^4.1.0"
|
|
||||||
jwt-decode "^4.0.0"
|
jwt-decode "^4.0.0"
|
||||||
semver "^7.5.4"
|
semver "^7.5.4"
|
||||||
tmp "^0.2.1"
|
tmp "^0.2.1"
|
||||||
@@ -1180,10 +1179,10 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-4.0.0.tgz#40d203ea827b9f17f42a29c6afb93b7745ef80c7"
|
resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-4.0.0.tgz#40d203ea827b9f17f42a29c6afb93b7745ef80c7"
|
||||||
integrity sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==
|
integrity sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==
|
||||||
|
|
||||||
"@octokit/core@^5.0.1":
|
"@octokit/core@^5.0.1", "@octokit/core@^5.0.2":
|
||||||
version "5.0.1"
|
version "5.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/@octokit/core/-/core-5.0.1.tgz#865da2b30d54354cccb6e30861ddfa0e24494780"
|
resolved "https://registry.yarnpkg.com/@octokit/core/-/core-5.0.2.tgz#ae7c5d61fdd98ba348a27c3cc510879a130b1234"
|
||||||
integrity sha512-lyeeeZyESFo+ffI801SaBKmCfsvarO+dgV8/0gD8u1d87clbEdWsP5yC+dSj3zLhb2eIf5SJrn6vDz9AheETHw==
|
integrity sha512-cZUy1gUvd4vttMic7C0lwPed8IYXWYp8kHIMatyhY8t8n3Cpw2ILczkV5pGMPqef7v0bLo0pOHrEHarsau2Ydg==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@octokit/auth-token" "^4.0.0"
|
"@octokit/auth-token" "^4.0.0"
|
||||||
"@octokit/graphql" "^7.0.0"
|
"@octokit/graphql" "^7.0.0"
|
||||||
@@ -1228,7 +1227,7 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@octokit/types" "^12.0.0"
|
"@octokit/types" "^12.0.0"
|
||||||
|
|
||||||
"@octokit/plugin-rest-endpoint-methods@^10.0.0", "@octokit/plugin-rest-endpoint-methods@^10.1.5":
|
"@octokit/plugin-rest-endpoint-methods@^10.0.0", "@octokit/plugin-rest-endpoint-methods@^10.2.0":
|
||||||
version "10.2.0"
|
version "10.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-10.2.0.tgz#eeaa4de97a2ae26404dea30ce3e17b11928e027c"
|
resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-10.2.0.tgz#eeaa4de97a2ae26404dea30ce3e17b11928e027c"
|
||||||
integrity sha512-ePbgBMYtGoRNXDyKGvr9cyHjQ163PbwD0y1MkDJCpkO2YH4OeXX40c4wYHKikHGZcpGPbcRLuy0unPUuafco8Q==
|
integrity sha512-ePbgBMYtGoRNXDyKGvr9cyHjQ163PbwD0y1MkDJCpkO2YH4OeXX40c4wYHKikHGZcpGPbcRLuy0unPUuafco8Q==
|
||||||
@@ -1993,10 +1992,10 @@ cross-spawn@^7.0.2, cross-spawn@^7.0.3:
|
|||||||
shebang-command "^2.0.0"
|
shebang-command "^2.0.0"
|
||||||
which "^2.0.1"
|
which "^2.0.1"
|
||||||
|
|
||||||
csv-parse@*, csv-parse@^5.5.2:
|
csv-parse@*, csv-parse@^5.5.3:
|
||||||
version "5.5.2"
|
version "5.5.3"
|
||||||
resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-5.5.2.tgz#ab525e642093dccff7c5cca5c7b71fd3e99fe8f2"
|
resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-5.5.3.tgz#0261050761ee46cd0e46421854bf9bf4de1317bf"
|
||||||
integrity sha512-YRVtvdtUNXZCMyK5zd5Wty1W6dNTpGKdqQd4EQ8tl/c6KW1aMBB1Kg1ppky5FONKmEqGJ/8WjLlTNLPne4ioVA==
|
integrity sha512-v0KW6C0qlZzoGjk6u5tLmVfyZxNgPGXZsWTXshpAgKVGmGXzaVWGdlCFxNx5iuzcXT/oJN1HHM9DZKwtAtYa+A==
|
||||||
|
|
||||||
debug@^4.1.0, debug@^4.1.1:
|
debug@^4.1.0, debug@^4.1.1:
|
||||||
version "4.3.2"
|
version "4.3.2"
|
||||||
@@ -3354,17 +3353,17 @@ minimist@^1.2.5:
|
|||||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44"
|
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44"
|
||||||
integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==
|
integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==
|
||||||
|
|
||||||
moment-timezone@^0.5.43:
|
moment-timezone@^0.5.44:
|
||||||
version "0.5.43"
|
version "0.5.44"
|
||||||
resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.43.tgz#3dd7f3d0c67f78c23cd1906b9b2137a09b3c4790"
|
resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.44.tgz#a64a4e47b68a43deeab5ae4eb4f82da77cdf595f"
|
||||||
integrity sha512-72j3aNyuIsDxdF1i7CEgV2FfxM1r6aaqJyLB2vwb33mXYyoyLly+F1zbWqhA3/bVIoJ4szlUoMbUnVdid32NUQ==
|
integrity sha512-nv3YpzI/8lkQn0U6RkLd+f0W/zy/JnoR5/EyPz/dNkPTBjA2jNLCVxaiQ8QpeLymhSZvX0wCL5s27NQWdOPwAw==
|
||||||
dependencies:
|
dependencies:
|
||||||
moment "^2.29.4"
|
moment "^2.29.4"
|
||||||
|
|
||||||
moment@^2.29.4:
|
moment@^2.29.4, moment@^2.30.1:
|
||||||
version "2.29.4"
|
version "2.30.1"
|
||||||
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108"
|
resolved "https://registry.yarnpkg.com/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae"
|
||||||
integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==
|
integrity sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==
|
||||||
|
|
||||||
ms@2.1.2:
|
ms@2.1.2:
|
||||||
version "2.1.2"
|
version "2.1.2"
|
||||||
|
Reference in New Issue
Block a user